2 Replies Latest reply on Feb 14, 2011 3:03 PM by gilbert gonzalez

    Multiple EJB Modules with Seam 2.2 and JBoss 5.1

    Nicolás Carrasco Newbie
      Hello,

      (All with JBoss 5.1 and Seam 2.2)

      I am trying to separate an EAR application that originally had the structure:

      GuiSeam.ear

      -META-INF
      -- application.xml
      - lib (with the libraries)
      - GuiSeam.jar
      - jboss-seam.jar
      - GuiSeam.war

      I am trying to split the module GuiSeam.jar into two different jars:  GuiSeam.jar and Wecare4U-EJB.jar.

      one contains some Session beans with @Name annotation
      and  the other backing beans that are not Session beans, also with @Name annotation.


      After that change my application.xml resulted to be:

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://java.sun.com/xml/ns/javaee"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
                   version="5">
         
         <display-name>GuiSeam</display-name>
        
        
         <!-- Seam and EL -->
         <module>
             <ejb>jboss-seam.jar</ejb>
         </module>
               
         <module>
            <ejb>Wecare4U-EJB.jar</ejb>
         </module>
        
         <module>
            <ejb>GuiSeam.jar</ejb>
         </module>

         <module>
            <web>
               <web-uri>GuiSeam.war</web-uri>
               <context-root>/GuiSeam</context-root>
            </web>
         </module>  
         
      </application>

      Wecare4U-EJB.jar have at META-INF a persistence.xml , ejb-jar.xml and MANIFEST.MS.
      GuiSeam.jar have at META-INF ejb-jar.xml and MANIFEST.MS. (This file has no direct access to database, the PersistenceContext injections are only at the Wecare4U-EJB.jar module.

      I am having a strange error that will be at the end of the message.

      Any help would be extremly appreciated.

      Thanks in advance,
      Nicolas Carrasco

      21:33:00,560 SEVERE [viewhandler] Error Rendering View[/home.xhtml]
      com.sun.facelets.tag.TagAttributeException: /home.xhtml @156,73 src="#{treeConfigurationBean.editorControlName}" Could not instantiate Seam component: treeConfigurationBean
              at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:235)
              at com.sun.facelets.tag.TagAttribute.getValue(TagAttribute.java:200)
              at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:57)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
              at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
              at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
              at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
              at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
              at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
              at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
              at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
              at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
              at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
              at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
              at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
              at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
              at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              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:206)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
              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)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: treeConfigurationBean
              at org.jboss.seam.Component.newInstance(Component.java:2156)
              at org.jboss.seam.Component.getInstance(Component.java:2021)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
              at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
              at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
              at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
              at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
              at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
              at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
              at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
              at com.sun.facelets.tag.TagAttribute.getObject(TagAttribute.java:233)
              ... 84 more
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: ruleInstancesBackingBean
              at org.jboss.seam.Component.newInstance(Component.java:2156)
              at org.jboss.seam.Component.getInstance(Component.java:2021)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2361)
              at org.jboss.seam.Component.getValueToInject(Component.java:2313)
              at org.jboss.seam.Component.injectAttributes(Component.java:1736)
              at org.jboss.seam.Component.inject(Component.java:1554)
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at org.webgui.action.treeconfiguration.TreeConfigurationBean_$$_javassist_seam_3.initialize(TreeConfigurationBean_$$_javassist_seam_3.java)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2261)
              at org.jboss.seam.Component.callCreateMethod(Component.java:2184)
              at org.jboss.seam.Component.newInstance(Component.java:2144)
              ... 98 more
      Caused by: java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: ruleTreeConfigurationSessionBean. If you are using hot deploy, you may have attempted to hot deploy a session or application-scoped component definition while using an old instance in the session.
              at org.jboss.seam.Component.getInstance(Component.java:2037)
              at org.jboss.seam.Component.getInstance(Component.java:1983)
              at org.jboss.seam.Component.getInstance(Component.java:1977)
              at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2361)
              at org.jboss.seam.Component.getValueToInject(Component.java:2313)
              at org.jboss.seam.Component.injectAttributes(Component.java:1736)
              at org.jboss.seam.Component.inject(Component.java:1554)
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at org.webgui.action.treeconfiguration.editor.ruleinstance.RuleInstancesBackingBean_$$_javassist_seam_5.initialize(RuleInstancesBackingBean_$$_javassist_seam_5.java)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2261)
              at org.jboss.seam.Component.callCreateMethod(Component.java:2184)
              at org.jboss.seam.Component.newInstance(Component.java:2144)
              ... 124 more