2 Replies Latest reply on Jan 13, 2005 10:23 AM by mat

    EJB lookup under JBoss-4.0.1

    mat Newbie

      Changing from JBoss-4.0.1RC2 to JBoss-4.0.1 encountered the following problem:

      The application contains 2 stateless session beans: sessionA and sessionB.
      The application installed on two different machines as local server and remote server.
      Simple lookup from sessionA in a local server to sessionB of a remote server results
      in the sessionA pointing to the sessionB of the same local server.
      ie the environment Properties is ignored and 'new InitialContext(p)' behaves the same as 'new InitialContext()'.

      The following code is used in sessionA to lookup sessionB which is fine under JBoss-4.0.1RC2.


      private sessionBHome lookupsessionB() throws NamingException {

      java.util.Properties p = new java.util.Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      p.put(Context.PROVIDER_URL, remoteServerName+":1099");
      InitialContext jndi = new InitialContext(p);

      return (PersistentUpdateSessionHome) jndi.lookup("sessionBJNDIName");
      }


      Any help is greatly appreciated.
      Many thanks.
      nasser

        • 1. Re: EJB lookup under JBoss-4.0.1
          911as Newbie

          I'm having the same problem, are you able to fix it?

          Thank you.

          • 2. Re: EJB lookup under JBoss-4.0.1
            mat Newbie

             

            "mat" wrote:
            Changing from JBoss-4.0.1RC2 to JBoss-4.0.1 encountered the following problem:

            The application contains 2 stateless session beans: sessionA and sessionB.
            The application installed on two different machines as local server and remote server.
            Simple lookup from sessionA in a local server to sessionB of a remote server results
            in the sessionA pointing to the sessionB of the same local server.
            ie the environment Properties is ignored and 'new InitialContext(p)' behaves the same as 'new InitialContext()'.

            The following code is used in sessionA to lookup sessionB which is fine under JBoss-4.0.1RC2.


            private sessionBHome lookupsessionB() throws NamingException {

            java.util.Properties p = new java.util.Properties();
            p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
            p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
            p.put(Context.PROVIDER_URL, remoteServerName+":1099");
            InitialContext jndi = new InitialContext(p);

            return (PersistentUpdateSessionHome) jndi.lookup("sessionBJNDIName");
            }


            Any help is greatly appreciated.
            Many thanks.
            nasser




            The NullPointerException error occurs within a stateless sessionBean as a timer bean: javax.ejb.TimedObject

            public class MyTimerSessionBean implements SessionBean, javax.ejb.TimedObject {

            public void ejbTimeout(javax.ejb.Timer timer) {
            ...
            }
            ...
            }

            nm