4 Replies Latest reply on Mar 9, 2010 12:49 AM by Arbi Sookazian

    Component not found in JNDI when accessed from EL expression

    Ryan Nideffer Newbie


      My SFSB Seam component is bound to JNDI on deployment, as evidenced by this log message:


      Component: example, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class:com.purecharger.action.ExampleAction, JNDI: purecharger/ExampleAction/local


      My interface:


      @Local
      public interface Example {   
          public List<String> getExample();
          public void destroy();
      }


      and my implementation:


      @Stateful
      @Scope(ScopeType.CONVERSATION)
      @Name("example")
      @Restrict("#{identity.loggedIn}")
      public class ExampleAction implements Example, Serializable {

          ....
      }

      However, when I access the voting component in an xhtml page like, I get the following error:


      javax.el.ELException: /home.xhtml: Could not instantiate Seam component: voting
      ....
      Caused by: javax.naming.NameNotFoundException: ExampleAction not bound


      If Seam was smart enough to install my component using the JNDI pattern in components.xml (purecharger/#{ejbName}/local), why does it not also apply the pattern when looking up components?


      Thank you.

        • 1. Re: Component not found in JNDI when accessed from EL expression
          Ryan Nideffer Newbie

          Seriously, no ability to edit the initial post..?!


          the exception should be:


          javax.el.ELException: /home.xhtml: Could not instantiate Seam component: example 
          .... 
          Caused by: javax.naming.NameNotFoundException: ExampleAction not bound



          Trying to get rid of proprietary references :)




          • 2. Re: Component not found in JNDI when accessed from EL expression
            Ryan Nideffer Newbie

            I eventually solved my problem, with help from StackOverflow. Turns out that I was missing a critical understanding of EJB, namely that jars containing EJB classes need to live in the root of the .ear, and be added as modules to application.xml. Once I did this, JBoss installed the EJBs into JNDI.


            What I was trying to do was have the EJB jar, and the jars of its dependencies, live in the .war/WEB-INF/lib directory. As part of my investigation though, I did find that this structure is supported by v3.1 of the EJB specification, and JBoss 6.0 M2 contains support for it.


            Too bad this forum is not more active,..

            • 3. Re: Component not found in JNDI when accessed from EL expression
              Arbi Sookazian Master

              Bonquisha Shoniqua wrote on Mar 05, 2010 21:13:


              Seriously, no ability to edit the initial post..?!



              We've complained about this to deaf ears.  Even the new core guy (LB) won't fix it I'm sure...

              • 4. Re: Component not found in JNDI when accessed from EL expression
                Arbi Sookazian Master

                Bonquisha Shoniqua wrote on Mar 08, 2010 20:30:


                I eventually solved my problem, with help from StackOverflow. Turns out that I was missing a critical understanding of EJB, namely that jars containing EJB classes need to live in the root of the .ear, and be added as modules to application.xml. Once I did this, JBoss installed the EJBs into JNDI.

                What I was trying to do was have the EJB jar, and the jars of its dependencies, live in the .war/WEB-INF/lib directory. As part of my investigation though, I did find that this structure is supported by v3.1 of the EJB specification, and JBoss 6.0 M2 contains support for it.


                You can always check http://localhost:8080/jmx-console to check status on your EJB deployments.



                Too bad this forum is not more active,..


                Yep, and they hired the new core dev (with one gone, NRichards) and I have a feeling the core devs still won't be responding to this forum.  Fantastic!