groovy
  1. groovy
  2. GROOVY-3321

"can't instantiate default ORB implementation" when connecting with a Glassfish Server

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 1.5.6
    • Fix Version/s: None
    • Component/s: bytecode
    • Labels:
      None
    • Environment:
      Linux 2.6.22-16-generic i686 GNU/Linux
    • Testcase included:
      yes
    • Number of attachments :
      1

      Description

      I have tried to use AMX with groovy to configure a Glassfish Server Instance. I always get the following Exception:

      30-Jan-2009 15:07:36 com.sun.enterprise.util.ORBManager initORB
      SEVERE: UTIL6009:Unexcpected Exception in createORB.
      org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.sun.corba.ee.impl.orb.ORBImpl  vmcid: 0x0  minor code: 0  completed
      : No
      .
      .
      .
      Caused by: java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBImpl, method: create_context_list signature: ()Lorg/omg/CORBA/ContextLi                                    st;) Incompatible argument to function
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:247)
              at org.omg.CORBA.ORB.create_impl(ORB.java:324)
      
      

      My Classpath exists of the needed Glassfish classes:

      glassfish-v2.1/lib/javaee.jar
      glassfish-v2.1/lib/install/applications/jmsra/imqjmsra.jar
      glassfish-v2.1/lib/appserv-admin.jar
      glassfish-v2.1/lib/appserv-ws.jar
      glassfish-v2.1/lib/appserv-deployment-client.jar
      glassfish-v2.1/lib/appserv-ext.jar
      glassfish-v2.1/lib/appserv-rt.jar
      

      When running the code from Eclipse it works, when trying to run this from a command line it fails. I checked the Classpath and Eclipse workspace settings and find no different. So I compiled the class and execute it with java instead of groovy. This works fine.

      GlassfishTest.groovy
      import com.sun.appserv.management.client.AppserverConnectionSource;
      import com.sun.appserv.management.helper.Connect;
      
      public class GlassfishTest {
      
          public static void main( String[] args ) throws Exception{
              Connect.connectNoTLS( "localhost", 
                                                     10086, 
                                                     "user", 
                                                     "geheim" ).getDomainRoot().getDomainConfig().createCustomResourceConfig( 
                           "jdniName",
                           "res",
                          "factory",
                           null );
      
          }
      
      }
      

      Thanks for any help.

        Activity

        Hide
        Marcel Szalbach added a comment -

        I have done some more test and could reduce it to the following problem:

        groovy -cp appserv-rt.jar -e "Class.forName('com.sun.corba.ee.impl.orb.ORBImpl')"
        
        Caught: java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBSingleton, method: create_context_list signature: ()Lorg/omg/CORBA/ContextList;) Incompatible argument to function
                at script_from_command_line.run(script_from_command_line:1)
                at script_from_command_line.main(script_from_command_line)
        

        The same problem also occurs for some other classes in the package, but not for all. Within Eclipse the Class.forName methods works.

        Show
        Marcel Szalbach added a comment - I have done some more test and could reduce it to the following problem: groovy -cp appserv-rt.jar -e " Class .forName('com.sun.corba.ee.impl.orb.ORBImpl')" Caught: java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBSingleton, method: create_context_list signature: ()Lorg/omg/CORBA/ContextList;) Incompatible argument to function at script_from_command_line.run(script_from_command_line:1) at script_from_command_line.main(script_from_command_line) The same problem also occurs for some other classes in the package, but not for all. Within Eclipse the Class.forName methods works.
        Hide
        blackdrag blackdrag added a comment -

        does loading that class using a normal URLClassLoader work? Does it work with the system class loader?

        Show
        blackdrag blackdrag added a comment - does loading that class using a normal URLClassLoader work? Does it work with the system class loader?
        Hide
        Marcel Szalbach added a comment -

        I have tested both class loaders. The URLClassLoader works but the system one did not work.

        {{
        URLClassLoader urlLoader = new URLClassLoader( new File("/home/marcel/lib/appserv-rt.jar").toURL() )
        println urlLoader.loadClass( 'com.sun.corba.ee.impl.orb.ORBImpl' ).newInstance()
        }}

        {{
        ClassLoader loader = ClassLoader.getSystemClassLoader()
        println loader.loadClass( 'com.sun.corba.ee.impl.orb.ORBImpl' ).newInstance()

        Caught: java.lang.ClassNotFoundException: com.sun.corba.ee.impl.orb.ORBImpl
        at test.run(test.groovy:2)
        at test.main(test.groovy)
        }}

        Show
        Marcel Szalbach added a comment - I have tested both class loaders. The URLClassLoader works but the system one did not work. {{ URLClassLoader urlLoader = new URLClassLoader( new File("/home/marcel/lib/appserv-rt.jar").toURL() ) println urlLoader.loadClass( 'com.sun.corba.ee.impl.orb.ORBImpl' ).newInstance() }} {{ ClassLoader loader = ClassLoader.getSystemClassLoader() println loader.loadClass( 'com.sun.corba.ee.impl.orb.ORBImpl' ).newInstance() Caught: java.lang.ClassNotFoundException: com.sun.corba.ee.impl.orb.ORBImpl at test.run(test.groovy:2) at test.main(test.groovy) }}
        Hide
        blackdrag blackdrag added a comment -

        hmm... that is not helping as much as I would like to.... maybe you could try running this command and tell give me the trace if there is one:

        groovy -cp appserv-rt.jar -e "this.class.classLoader.loadClass('com.sun.corba.ee.impl.orb.ORBImpl').newInstance()"

        Show
        blackdrag blackdrag added a comment - hmm... that is not helping as much as I would like to.... maybe you could try running this command and tell give me the trace if there is one: groovy -cp appserv-rt.jar -e "this.class.classLoader.loadClass('com.sun.corba.ee.impl.orb.ORBImpl').newInstance()"
        Hide
        Marcel Szalbach added a comment -

        This is the full stack trace of your command:

        this.class.classLoader.loadClass('com.sun.corba.ee.impl.orb.ORBImpl').newInstance()

        Caught: java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBImpl, method: getIOR signature: (Lorg/omg/CORBA/Object;Z)Lcom/sun/corba/ee/spi/ior/IOR;) Incompatible argument to function
        java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBImpl, method: getIOR signature: (Lorg/omg/CORBA/Object;Z)Lcom/sun/corba/ee/spi/ior/IOR;) Incompatible argument to function
                at java.lang.Class.getDeclaredConstructors0(Native Method)
                at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
                at java.lang.Class.getDeclaredConstructors(Class.java:1836)
                at org.codehaus.groovy.reflection.CachedClass$3.run(CachedClass.java:232)
                at java.security.AccessController.doPrivileged(Native Method)
                at org.codehaus.groovy.reflection.CachedClass.getConstructors(CachedClass.java:229)
                at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:115)
                at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createNormalMetaClass(MetaClassRegistry.java:102)
                at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:92)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getGlobalMetaClass(MetaClassRegistryImpl.java:252)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.access$100(MetaClassRegistryImpl.java:45)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getFromGlobal(MetaClassRegistryImpl.java:112)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getMetaClass(MetaClassRegistryImpl.java:88)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$MyThreadLocal.getMetaClass(MetaClassRegistryImpl.java:361)
                at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:265)
                at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:748)
                at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
                at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:198)
                at script_from_command_line.run(script_from_command_line:1)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
                at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
                at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:778)
                at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758)
                at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:401)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
                at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1105)
                at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
                at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
                at script_from_command_line.main(script_from_command_line)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
                at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
                at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1105)
                at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749)
                at groovy.lang.GroovyShell.runMainOrTestOrRunnable(GroovyShell.java:244)
                at groovy.lang.GroovyShell.run(GroovyShell.java:453)
                at groovy.lang.GroovyShell.run(GroovyShell.java:433)
                at groovy.lang.GroovyShell.run(GroovyShell.java:160)
                at groovy.ui.GroovyMain.processOnce(GroovyMain.java:496)
                at groovy.ui.GroovyMain.run(GroovyMain.java:308)
                at groovy.ui.GroovyMain.process(GroovyMain.java:294)
                at groovy.ui.GroovyMain.processArgs(GroovyMain.java:111)
                at groovy.ui.GroovyMain.main(GroovyMain.java:92)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:597)
                at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101)
                at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
        
        Show
        Marcel Szalbach added a comment - This is the full stack trace of your command: this.class.classLoader.loadClass('com.sun.corba.ee.impl.orb.ORBImpl').newInstance() Caught: java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBImpl, method: getIOR signature: (Lorg/omg/CORBA/ Object ;Z)Lcom/sun/corba/ee/spi/ior/IOR;) Incompatible argument to function java.lang.VerifyError: (class: com/sun/corba/ee/impl/orb/ORBImpl, method: getIOR signature: (Lorg/omg/CORBA/ Object ;Z)Lcom/sun/corba/ee/spi/ior/IOR;) Incompatible argument to function at java.lang. Class .getDeclaredConstructors0(Native Method) at java.lang. Class .privateGetDeclaredConstructors( Class .java:2389) at java.lang. Class .getDeclaredConstructors( Class .java:1836) at org.codehaus.groovy.reflection.CachedClass$3.run(CachedClass.java:232) at java.security.AccessController.doPrivileged(Native Method) at org.codehaus.groovy.reflection.CachedClass.getConstructors(CachedClass.java:229) at groovy.lang.MetaClassImpl.<init>(MetaClassImpl.java:115) at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.createNormalMetaClass(MetaClassRegistry.java:102) at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:92) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getGlobalMetaClass(MetaClassRegistryImpl.java:252) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.access$100(MetaClassRegistryImpl.java:45) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getFromGlobal(MetaClassRegistryImpl.java:112) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getMetaClass(MetaClassRegistryImpl.java:88) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$MyThreadLocal.getMetaClass(MetaClassRegistryImpl.java:361) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:265) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:748) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java:198) at script_from_command_line.run(script_from_command_line:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756) at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:778) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:758) at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:401) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1105) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170) at script_from_command_line.main(script_from_command_line) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1105) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:749) at groovy.lang.GroovyShell.runMainOrTestOrRunnable(GroovyShell.java:244) at groovy.lang.GroovyShell.run(GroovyShell.java:453) at groovy.lang.GroovyShell.run(GroovyShell.java:433) at groovy.lang.GroovyShell.run(GroovyShell.java:160) at groovy.ui.GroovyMain.processOnce(GroovyMain.java:496) at groovy.ui.GroovyMain.run(GroovyMain.java:308) at groovy.ui.GroovyMain.process(GroovyMain.java:294) at groovy.ui.GroovyMain.processArgs(GroovyMain.java:111) at groovy.ui.GroovyMain.main(GroovyMain.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:101) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
        Hide
        Osvaldo Josť de Jesus Silva added a comment -

        I have tried to use conect to glassfish using JMS and had the same problem.

        I am using the IDE IntelijIdea, groovy, the JMS API and a glassfish server, on my lib directory I have the jars in my classpath:

        glassfish-v2.1/lib/javaee.jar
        glassfish-v2.1/lib/install/applications/jmsra/imqjmsra.jar
        glassfish-v2.1/lib/appserv-admin.jar
        glassfish-v2.1/lib/appserv-ws.jar
        glassfish-v2.1/lib/appserv-deployment-client.jar
        glassfish-v2.1/lib/appserv-ext.jar
        glassfish-v2.1/lib/appserv-rt.jar

        The what occured is:
        SEVERE: UTIL6009:Unexcpected Exception in createORB.
        org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.sun.corba.ee.impl.orb.ORBImpl vmcid: 0x0 minor code: 0 completed: No
        at org.omg.CORBA.ORB.create_impl(ORB.java:326)

        Show
        Osvaldo Josť de Jesus Silva added a comment - I have tried to use conect to glassfish using JMS and had the same problem. I am using the IDE IntelijIdea, groovy, the JMS API and a glassfish server, on my lib directory I have the jars in my classpath: glassfish-v2.1/lib/javaee.jar glassfish-v2.1/lib/install/applications/jmsra/imqjmsra.jar glassfish-v2.1/lib/appserv-admin.jar glassfish-v2.1/lib/appserv-ws.jar glassfish-v2.1/lib/appserv-deployment-client.jar glassfish-v2.1/lib/appserv-ext.jar glassfish-v2.1/lib/appserv-rt.jar The what occured is: SEVERE: UTIL6009:Unexcpected Exception in createORB. org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.sun.corba.ee.impl.orb.ORBImpl vmcid: 0x0 minor code: 0 completed: No at org.omg.CORBA.ORB.create_impl(ORB.java:326)
        Hide
        Pascal Schumacher added a comment -

        I'm closing this as this is for a very old version of groovy and has not seen any updates for over three years. Also reading this blog entry http://marxsoftware.blogspot.de/2013/03/booting-amx-in-glassfish-3-with-groovy.html it is seems possible to use Groovy to connect to Glassfish (at least with newer versions).

        Please reopen this issue if the error still occurs. Thanks!

        Show
        Pascal Schumacher added a comment - I'm closing this as this is for a very old version of groovy and has not seen any updates for over three years. Also reading this blog entry http://marxsoftware.blogspot.de/2013/03/booting-amx-in-glassfish-3-with-groovy.html it is seems possible to use Groovy to connect to Glassfish (at least with newer versions). Please reopen this issue if the error still occurs. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Marcel Szalbach
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: