8 Replies Latest reply on Mar 16, 2008 4:20 AM by skidvd.seamframework.abilsoft.com

    SFSB component not being recognized or found

    skidvd.seamframework.abilsoft.com

      I'm sure this is a newbie question, but I am attempting to define a Seam component out of my SFSB without success.  I'm working with Seam 2.0.1.GA and JBoss 4.2.2.GA.


      I have an SFSB in a jar that is annotated with


      @Stateful
      @Name("eventsController")



      The SFSB also has a method with the signature:


      @Unwrap 
      public void List<MyEvents>getEvents()



      My facelet is bundled in a war and both the war and jar are bundled in a ear which deploys successfully.  I'm also sure that the SFSB is deployed as the JBoss console output shows it's successful deployment as well as the fact that I can see it in the JNDI tree. 


      However, when my facelet attempts to reference the SFSB via


      #{eventsController.events}

      is get an error stating that the eventsController target is not reachable:



      TargetUnreachable, identifier eventsController resolved to null

      I've verified the interceptors and other configuration against the examples, but still seem to be missing something (probably something simple).  I do notice a number of seam components being listed in the JBoss console when the ear is deployed; but my SFSB is definately not in that list.  Do I need to do something beyond annotating it with @Name and adding the Seam interceptors to the ejb-jar.xml to get it to be recognized as a component? What should I check next?  I'd be happy to provide whatever code/configuration snippets you may need, but did not want to flood with everything since they already appear to compare correctly to the examples.


      Thanks in advance!


        • 1. Re: SFSB component not being recognized or found
          jbalunas.jbalunas.jboss.org

          Could you show us your ejb-jar.xml and application.xml - just to be sure :)


          And maybe a little more info on the error [stacktrace].


          -Jay

          • 2. Re: SFSB component not being recognized or found

            Did you try adding @AutoCreate to your bean?


            -mp

            • 3. Re: SFSB component not being recognized or found
              skidvd.seamframework.abilsoft.com

              Here is the ejb-jar.xml


              <?xml version="1.0" encoding="UTF-8"?>
              <ejb-jar 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/ejb-jar_3_0.xsd"
                       version="3.0">
                  
                  <enterprise-beans>
                      <session>
                          <ejb-name>EventsController</ejb-name>
                          <business-local>com.myco.eventBrowser.IEventsControllerLocal</business-local>
                          <business-remote>com.myco.eventBrowser.IEventsControllerRemote</business-remote>
                          <ejb-class>com.myco.eventBrowser.EventsControllerBean</ejb-class>
                          <session-type>Stateful</session-type>
                          <transaction-type>Container</transaction-type>
                      </session>
                  </enterprise-beans>
                  
                  <interceptors>
                      <interceptor>
                          <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
                      </interceptor>
                  </interceptors>
                       
                  <assembly-descriptor>
                     <container-transaction>
                        <method>
                           <ejb-name>EventsController</ejb-name>
                           <method-name>*</method-name>
                        </method>
                        <trans-attribute>Required</trans-attribute>
                     </container-transaction>
                     <interceptor-binding>
                         <ejb-name>*</ejb-name>
                         <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
                     </interceptor-binding>
                  </assembly-descriptor>
                      
              </ejb-jar>



              Here is application.xml


              <?xml version="1.0" encoding="UTF-8"?>
              <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
                
                  <display-name>Event Historian</display-name>
                  <description>MYCO Event Historian</description>
              
                  <module>
                      <ejb>myco-server-common.jar</ejb>
                  </module>
              
                  <!-- This contains the Event Browser Beans ... The SFSB/component is here -->
                  <module>
                      <ejb>eventBrowser.jar</ejb>
                  </module>
              
                  <!-- This contains the MDB -->
                  <module>
                      <ejb>myco.jar</ejb>
                  </module>
                  
                  <!-- The Event Browser web application -->
                  <module>
                      <web>
                          <web-uri>eventBrowser.war</web-uri>
                          <context-root>/eventBrowser</context-root>
                      </web>
                  </module>
              
                  <!-- Required by the Event Browser Seam web app -->
                  <module>
                      <java>jboss-seam.jar</java>
                  </module>
                  <module>
                      <java>jboss-el.jar</java>
                  </module>
                      
                  <library-directory>lib</library-directory>
              </application>




              Here is an excerpt from the resulting stack trace of the run.



              12:40:26,328 FATAL [application] /pages/index.xhtml @65,57 action="#{eventsContr
              oller.getEvents}": Target Unreachable, identifier 'eventsController' resolved t
              o null
              javax.faces.el.EvaluationException: /pages/index.xhtml @65,57 action="#{eventsCo
              ntroller.getEvents}": Target Unreachable, identifier 'eventsController' resolve
              d to null
                      at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.ja
              va:73)
                      at com.sun.faces.application.ActionListenerImpl.processAction(ActionList
              enerImpl.java:91)
                      at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                      at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionCompon
              ent.java:62)
                      at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:1
              84)
                      at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java
              :162)
                      at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.j
              ava:350)
                      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicat
              ionPhase.java:97)
                      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
              
                      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:307)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
              .java:83)
                      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                      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.BaseFilter.doFilter(BaseFilter.java:307)
                      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
              .java:69)
                      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
              .java:69)
                      at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.jav
              a:68)
                      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(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
              
                      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
              lter.java:96)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
              icationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
              ilterChain.java:206)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
              alve.java:230)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
              alve.java:175)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
              yAssociationValve.java:179)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
              torBase.java:524)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
              e.java:84)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
              ava:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
              ava:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
              onnectionValve.java:157)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
              ve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
              a:262)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
              :844)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
              ss(Http11Protocol.java:583)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
              6)
                      at java.lang.Thread.run(Thread.java:619)



              • 4. Re: SFSB component not being recognized or found
                jbalunas.jbalunas.jboss.org


                From the booking example application.xml:


                    <module>
                        <ejb>jboss-seam-booking.jar</ejb>
                    </module>
                    
                    <module>
                        <ejb>jboss-seam.jar</ejb>
                    </module>
                



                I believe the problem is that your's is using <java> modules not ejb modules.


                   <module>
                        <java>jboss-seam.jar</java>
                    </module>
                    <module>
                        <java>jboss-el.jar</java>
                    </module>
                



                Give that a shot - it may be needed to have the intercepters available.


                -Jay

                • 5. Re: SFSB component not being recognized or found
                  skidvd.seamframework.abilsoft.com

                  Thanks for the idea.  The dvdstore example seems to use the

                  <ejb>

                  varient.  I get exactly the same error either way though.  I'm really puzzled.

                  • 6. Re: SFSB component not being recognized or found
                    skidvd.seamframework.abilsoft.com

                    Thanks for your reply and idea.  However, I just tried adding the @AutoCreate to the bean with exactly the same results as shown above.  What else can I be missing or have wrong?

                    • 7. Re: SFSB component not being recognized or found
                      srini.ragu

                      check your jar containing the ejb has the seam.properties file in it..

                      • 8. Re: SFSB component not being recognized or found
                        skidvd.seamframework.abilsoft.com

                        Thanks! That was it.  I suspected I was missing something simple.  I just need an empty seam.properties file.


                        Thanks again.