6 Replies Latest reply on Jan 4, 2005 9:36 PM by daryoush

    Naming issue

    daryoush

      I have deployed the following session bean (Jboss 4.0):

      ejb-jar.xml
      ...
      ...

      <ejb-name>ConcurroSession</ejb-name>


      <\home> com.concurro.hcs.access.security.ConcurroSessionHome /home>

      <\remote> com.concurro.hcs.access.security.ConcurroSession /remote>


      <ejb-class> com.concurro.hcs.access.security.ConcurroSessionBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>


      Here is message from the deployer:
      16:05:10,984 INFO [EjbModule] Deploying ConcurroSession

      It seems the bean was deployed without any issue.
      When I try to do an object lookup for "ConcurroSessionHome" the following exception is thrown: "NameNotFoundException" the detail message is: com.concurro.hcs.access.security.ConcurroSessionHome not bound".

      Here is a snippet of code used to do the lookup:

      Context ctx = new InitialContext();
      Object ref = ctx.lookup("java:comp/env/" +homeClass.getName());
      EJBHome anEJBHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow ( ref, homeClass);


      Any help is appreciated.



        • 1. Re: Naming issue
          darranl

          Loose the 'java:comp/env/' in your lookup.

          Check JNDI View in JMX Console to double check what is bound.

          • 2. Re: Naming issue
            daryoush

            Thanks for your message. Unfortunately, getting rid of the the ?java:comp/env/? didn?t fix the problem. I did check the jmx-console?ConcurrosSessionHome seems to be bound. I was wondering if I should change the name separator ?.? To ?/? in my ejb.jar.xml. Any thoughts??

            Thanks

            • 3. Re: Naming issue
              darranl

              The "java:comp/env/" is not needed.

              The string passed to lookup should match the String the component is bound as in JNDI View (This is also not the fully qualified classname).

              • 4. Re: Naming issue
                daryoush

                Okay, I got rid of java:comp/env/
                Below is what I see under jmx-console jndi view:

                Ejb Module: EJBs.jar

                java:comp namespace of the ConcurroSession bean:
                +- HandleDelegate (class: org.jboss.proxy.ejb.handle.HandleDelegateImpl)
                +- ORB (class: org.jacorb.orb.ORB)
                +- env (class: org.jnp.interfaces.NamingContext)


                Global JNDI Namespace

                +- ConcurroSession (proxy: $Proxy488 implements interface com.concurro.hcs.access.security.ConcurroSessionHome,interface javax.ejb.Handle)


                My ejb-jar.xml contains:


                <ejb-name>ConcurroSession</ejb-name>
                com.concurro.hcs.access.security.ConcurroSessionHome
                com.concurro.hcs.access.security.ConcurroSession
                <ejb-class>com.concurro.hcs.access.security.ConcurroSessionBean</ejb-class>
                <session-type>Stateful</session-type>
                <transaction-type>Container</transaction-type>



                <container-transaction>

                <ejb-name>ConcurroSession</ejb-name>
                <method-name>*</method-name>

                <trans-attribute>Required</trans-attribute>
                </container-transaction>


                And here is my call:

                ctx = new InitialContext();
                Object ref = ctx.lookup( "com.concurro.hcs.access.security.ConcurroSessionHome" );

                I don't see ConcurroSessionHome under jmx-cosole->jndi view; however ConcurroSession is there. I also tried passing "ConcurroSessionHome" to the lookup method with no avails.

                I appreciate any pointer.

                • 5. Re: Naming issue
                  darranl

                  The name you want to look up from the external client is 'ConcurroSession'

                  • 6. Re: Naming issue
                    daryoush

                    Thanks... passing non-qualified names to the lookup method worked!!
                    I am in the process of porting an application from Weblogic to jboss?we make a lot of calls to the lookup method and almost all of them use the fully qualified names (com.concurro.hcs.security.ConcurroSession). Is there a trick that one can use to have the jndi server accept the qualified names through jndi.properties config file?

                    Thanks again,
                    Daryoush