0 Replies Latest reply on Feb 9, 2011 9:38 AM by mikevader

    Fail to access session beans on glassfish v3.1 with a stand-alone client

    mikevader

      Hello folks

      I have now failed for quite some time to accomplish an easy task:
      I have a simple ejb3 stateless session bean with one remote interface which I build with maven3 to a ear and client.jar.
      I deployed it on the glassfish v3.1 with no problem. I created a simple webapplication just to make sure the ear and its deployment is correct. And it is.

      But what I really want is to access this session bean from a standalone JavaSE client (at the end it should be a NetBeans platform richclient but for ease of test I postponed that).

      But no matter what I do I always get the following exception:

      java.lang.RuntimeException: Orb initialization erorr
              at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:148)
              ....
      Caused by: java.lang.NullPointerException
              at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:120)
              ... 8 more
      09.02.2011 07:52:28 javaapplication.JavaApplication main
      SCHWERWIEGEND: null
      javax.naming.NamingException: Lookup failed for 'java:global/test/TestService' in SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.RuntimeException: Orb initialization erorr]]
              at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
              at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at javaapplication.JavaApplication.main(JavaApplication.java:48)
      Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=localhost, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl} [Root exception is java.lang.RuntimeException: Orb initialization erorr]
              at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:352)
              at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
              ... 3 more
      Caused by: java.lang.RuntimeException: Orb initialization erorr
              at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:148)
              at com.sun.enterprise.naming.impl.SerialContext.getORB(SerialContext.java:365)
              at com.sun.enterprise.naming.impl.SerialContext.getProviderCacheKey(SerialContext.java:372)
              at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:402)
              at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:347)
              ... 4 more
      Caused by: java.lang.NullPointerException
              at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:120)
              ... 8 more
       

      I first thought that I made a mistake with the JNDI name. After I realised that for some reason the very very very VERY useful JNDI Browser was removed, I looked into the deployment log information where glassfish writes the portable and non-portable JNDI names for every deployed bean.
      So there should be no problem with the JNDI name.

      Then I tried to verify that I have the correct classpath but abandoned that quite soon because its impossible: I just can verify that I include gf-client.jar from the glassfish installation and thats it. (Which would require to install glassfish on the client machines or ship the 70MB libs from this folder with my client .... which is both mental but I have to face this later or not at all if I can not figure out my current problem)

      So what could be the problem here?

      Thanks for your help
      Michael