3 Replies Latest reply on Jan 5, 2010 11:08 AM by Ran Bittmann

    Newbie - Problem Creating an Entity with JBoss Tools

    Ran Bittmann Newbie

      Hi,

       

      I am making my first steps trying to develop with JBoss Tools so my apologies if I missing something trivial. I am using the following versions:

      Eclipse 3.5.1, JBoss Tools 3.1.0.M4, JBoss AS 5.1.0GA-jdk6, Seam 2.2.0.GA, JBoss 4.2.2GA & MySQL 5.1.37.

       

      I am making a new project using the New -> Seam Web Project and it works.

       

      I tried to add an action. Initially it fails but after cleaning the project, rebuilding it, exiting eclipse and re-entering it it starts working.

       

      My real problem is when I try to add a new entity (testEntity) to an existing schema without any tables (I tested the datasource connection and everything seems to be good). The entity class and pages are created and when running the testEntity.xhtml on the embedded JBoss AS server it comes up fine. Trying to add an entry fails with the error stack listed below.

       

      I did not enter any code or made any changes to the default configuations.

       

      I will appreciate your help in figuring out what went wrong.

       

      Thanks,

      Rani.

       

      20:10:36,984 WARNING [lifecycle] /testEntity.xhtml @21,71 value="#{testEntityHome.instance.name}": Target Unreachable, identifier 'testEntityHome' resolved to null
      javax.el.PropertyNotFoundException: /testEntity.xhtml @21,71 value="#{testEntityHome.instance.name}": Target Unreachable, identifier 'testEntityHome' resolved to null
          at com.sun.facelets.el.TagValueExpression.getType(TagValueExpression.java:62)
          at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:92)
          at javax.faces.component.UIInput.getConvertedValue(UIInput.java:942)
          at javax.faces.component.UIInput.validate(UIInput.java:868)
          at javax.faces.component.UIInput.executeValidate(UIInput.java:1072)
          at javax.faces.component.UIInput.processValidators(UIInput.java:672)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1058)
          at javax.faces.component.UIForm.processValidators(UIForm.java:235)
          at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
          at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
          at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
          at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:619)
      20:10:37,000 SEVERE [lifecycle] JSF1054: (Phase ID: PROCESS_VALIDATIONS 3, View ID: /testEntity.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@105823]

       

       

        • 1. Re: Newbie - Problem Creating an Entity with JBoss Tools
          Ran Bittmann Newbie

          Hi,

           

          I think I solved the issue, and it really was trivial. So for the sake of other newbies, the solution I came up is that adding a new entity is not enough, but you have to run the generate entities as well (Right Click on the project -> New -> Other -> Seam -> Seam Generate Entities).


          Thanks,

          Rani.

          • 2. Re: Newbie - Problem Creating an Entity with JBoss Tools
            Max Rydahl Andersen Master

            Well Generate entities looks at your database and generates the matching entities and view layer.

             

            New Entity just create a simple entity and a simple view. The table are not created for you.

             

            Also remember to restart/redeploy the app since new entities are not picked up dynamically.

            • 3. Re: Newbie - Problem Creating an Entity with JBoss Tools
              Ran Bittmann Newbie

              Hi,

               

              Thanks for the clarification. I might have done something wrong, but it did not work that way for me, and the Entity classes were not deployed until I ran the Seam Generate Entities with the Use Existing Entities option (i.e. NOT the Reverse Engineer from Database option) checked.

               

              I am aware to that the Entities are not hot deployed, but for some reason new Actions are not deployed for me either, and I have to clean and rebuild the project from Eclipse. Another annoying thing is that this confuses the Eclipse internal browser and I have to exit Eclipse and re-enter it, for it to clear its cache (there must be an easier way but I am still learning). Changes to existing pages are hot deployed fine.

               

              Anyway I appreciate your helpful feedback and continue to dive into seam development, hopefully I will figure it out better over time.

               

              Rani.