2 Replies Latest reply on May 7, 2004 3:50 PM by celticprince

    context.lookup finds Local Home from remote jvm

    celticprince

      We are porting our application that is running on Weblogic 7.x to run on JBoss 3.2.3. We have Manager classes that handle getting Session beans, and test first to get the local interface, and if the lookup on the local home fails, then they try the remote interface. These Managers are used both inside the container and from "remote" clients.

      Funny thing is, even from the remote clients, the context.lookup returns a non-null reference to the local homes on our Session beans. However when you try to create the local interface it throws a NullPointerException - and the local home is NOT NULL!

      I've been using various app servers for several years now and this just doesn't seem right. Is there a configuration issue item that I could have wrong or could change?

        • 1. Re: context.lookup finds Local Home from remote jvm

          Bind your local home in the java:/ namespace if you don't want it to be available
          from a remote lookup.

          You'll find the local home is completely unusable from a remote VM.

          Regards,
          Adrian

          • 2. Re: context.lookup finds Local Home from remote jvm
            celticprince

            Adrian,

            Thanks for the reply. I know the local is not usable from a remote JVM - hence my surprise that the lookup returned a non-null object for a local. We have code that tries first to find the local home and use that if successful. If an exception is thrown - the lookup fails, then we look for the remote home. This way we don't have to worry if our ServiceLocator is being used inside the container or out.

            We'll give your suggestion a try and see if that yields better results.

            Thanks again.
            Jeff