[jboss-user] [JBoss Seam] - ARGH! Seam 2.0.0 Beta, Ajax4JSF, <s:convertEntity/>, <s:sele

dhinojosa do-not-reply at jboss.com
Wed Jul 18 14:48:28 EDT 2007


I am going crazy with this, in fact I am about to eat glass.  Anyone encountered this before?


  | 
  | javax.servlet.ServletException
  | 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
  | 	org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  | 	org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  | 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | ROOT CAUSE:
  | 
  | java.lang.NullPointerException
  | 	org.jboss.seam.ui.converter.EntityConverter.getAsString(EntityConverter.java:69)
  | 	org.jboss.seam.ui.converter.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
  | 	org.jboss.seam.ui.converter.ConverterChain.getAsString(ConverterChain.java:123)
  | 	com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:469)
  | 	com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:502)
  | 	com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:757)
  | 	com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:811)
  | 	com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:335)
  | 	javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
  | 	org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
  | 	org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
  | 	org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
  | 	javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
  | 	org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
  | 	javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
  | 	javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
  | 	javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
  | 	javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
  | 	javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
  | 	com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
  | 	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
  | 	org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
  | 	org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
  | 	org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:87)
  | 	org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
  | 	org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
  | 	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
  | 	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
  | 	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
  | 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
  | 	org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  | 	org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  | 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  | 
  | 


Here is my .jsp file from where this is originated...

  | <%@page pageEncoding="UTF-8"%>
  | <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  | <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  | <%@taglib uri="http://jboss.com/products/seam/taglib" prefix="s"%>
  | <%@taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
  | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  | "http://www.w3.org/TR/html4/loose.dtd">
  | 
  | <f:view>
  |     <h:form>
  |         <div id="selectGate">
  |             <a4j:region selfRendered="true">
  |                 <h:selectOneMenu value="#{selectGateBean.gate}">
  |                     <s:selectItems var="gate" value="#{gateStyle.gates}" label="#{gate.name}"  noSelectionLabel="please choose" /> 
  |            
  |                     <a4j:support event="onchange" reRender="selectColor, selectPost"/>    
  |                              <s:convertEntity />
  |                 </h:selectOneMenu>
  |             </a4j:region>
  |         </div>
  |         <a4j:outputPanel id="selectColor">
  |             <h:selectOneMenu value="#{selectGateBean.color}">
  |                 <s:selectItems var="color" value="#{gate.colors}" label="#{color.name}"/>
  |             </h:selectOneMenu>
  |         </a4j:outputPanel>
  |         <a4j:outputPanel id="selectSwing">
  |             <h:messages />
  |             <h:selectOneMenu value="#{selectGateBean.swingType}">
  |                 <s:convertEnum />
  |                 <s:enumItem enumValue="PUSH" label="Push" />
  |                 <s:enumItem enumValue="PULL" label="Pull" />
  |             </h:selectOneMenu>
  |         </a4j:outputPanel>
  |         <a4j:outputPanel id="selectPost">
  |             <h:messages />
  |             <h:selectOneMenu value="#{selectGateBean.posts}">
  |                 <s:selectItems var="post" value="#{selectGateBean.recommendedPostPaks}" label="#{post.name}"/>
  |             </h:selectOneMenu>
  |         </a4j:outputPanel>
  |     </h:form>
  | </f:view>
  | 


My gateStyle bean and my gate bean is annotation with @Id fields correctly. My components.xml is I believe correct:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <components xmlns="http://jboss.com/products/seam/components"
  |             xmlns:core="http://jboss.com/products/seam/core"
  |             xmlns:persistence="http://jboss.com/products/seam/persistence"
  |             xmlns:drools="http://jboss.com/products/seam/drools"
  |             xmlns:security="http://jboss.com/products/seam/security"
  |             xmlns:mail="http://jboss.com/products/seam/mail"
  |             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |             xsi:schemaLocation=
  |                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd 
  |                  http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd 
  |                  http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
  |                  http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
  |                  http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
  |                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
  |     
  |     <core:init jndi-pattern="amazinggates/#{ejbName}/local"/>
  |     <persistence:managed-persistence-context name="em"
  |                                              auto-create="true"
  |                                              persistence-unit-jndi-name="java:/amazinggatesEntityManagerFactory"/>
  |     <component name="org.jboss.seam.ui.EntityConverter">
  |         <property name="entityManager">#{em}</property>
  |     </component>	
  | </components>
  | 


Here is my persistence.xml for safe measure:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <persistence>
  |     <persistence-unit name="amazinggates">
  |         <jta-data-source>java:/amazinggatesDS</jta-data-source>
  |         <properties>
  |             <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
  |             <property name="hibernate.hbm2ddl.auto" value="update"/>
  |             <property name="jboss.entity.manager.factory.jndi.name" value="java:/amazinggatesEntityManagerFactory"/>
  |         </properties>
  |     </persistence-unit>
  | </persistence>
  | 

I appreciate your help....

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065523#4065523

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065523



More information about the jboss-user mailing list