1 Reply Latest reply on Aug 17, 2006 3:38 PM by ngtdave

    Packaging question.

      So I successfully downloaded and ran the examples and everything worked fine. But for our projects, we want the entities to live in a separate project and package than the "action classes"/ejbs in their own jar, put a seam.properties in the root of that jar, and added it to my ear.

      My Ear looks like this:

      booking.ear
       booking.jar - The entities (Hotel, User, Booking)
       bookingserv.jar - The ejbs/services/actions (Other classes)
       booking.war - The web app
       jboss-seam.jar - Seam jar


      I updated META-INF/application.xml as follows:
      ...
       <module>
       <web>
       <web-uri>booking.war</web-uri>
       <context-root>/booking</context-root>
       </web>
       </module>
       <module>
       <ejb>booking.jar</ejb>
       </module>
       <module>
       <ejb>bookingserv.jar</ejb>
       </module>
       <module>
       <java>jboss-seam.jar</java>
       </module>
      ...


      It had deployment problems so I had to explicitly set 'unitName="Booking"' on all the @PersistenceContext tags in the project.

      Then it deployed fine, and the application comes up. But when I go to login, I get this error:
      ...
      Faces Servlet threw exception
      javax.faces.FacesException: Error calling action method of component with id _id2:_id14
      ...
      IllegalArgumentException: value found for In attribute has the wrong type: login


      Full stack trace here:
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Contexts] destroying: class org.apache.myfaces.renderkit.html.util.JavascriptUtils.OLD_VIEW_ID
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
      2006-08-17 13:02:27,613 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
      2006-08-17 13:02:33,347 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.core.Manager] No stored conversation
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(11)
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.contexts.Contexts] found in session context: user
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: login
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.Component] instantiating Seam component: login
      2006-08-17 13:02:33,363 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFact
      ory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-08-17 13:02:33,363 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/ngtbooking].[Faces Servlet]] Servlet.service() for servlet
      Faces Servlet threw exception
      javax.faces.FacesException: Error calling action method of component with id _id2:_id14
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:79)
       at javax.faces.component.UICommand.broadcast(UICommand.java:106)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalArgumentException: value found for In attribute has the wrong type: login
       at org.jboss.seam.Component.getInstance(Component.java:1273)
       at org.jboss.seam.Component.getInstance(Component.java:1246)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
       at com.sun.el.parser.AstValue.getTarget(AstValue.java:62)
       at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
       at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
       at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
       at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
       at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
       ... 27 more



      Any ideas?

      Thanks in advance!

        • 1. Re: Packaging question.

          Okay, my bad. I had originally tried to put the "action classes" in the /war file in WEB-INF/classes, but that didn't work. So I made the new jar bookingserv.jar, but had not removed the classes from the war. So that got rid of the problem. And I'm back trying to figure out how to deploy the two seam parts seperately.

          Hopefully my mistake will help someone not make the same. :)