ejb@glassfish.java.net

Problem connecting to GFv3 with standalone Eclipse RCP client

From: Andreas Kozma <andreas.kozma_at_ansis.com>
Date: Thu, 20 May 2010 08:57:46 +0200

Dear All,

we are currently running on GFv2.1.1 with an Eclipse RCP and would like to move to GFv3, which we like a lot.

However, we hit a strange exception when trying to lookup remote interfaces for more than one stateless session bean.

The first stateless bean is looked up perfectly and we are able to call methods on it. The second throws the following exception. If we change the two lookups, then the other (now in first position) loads properly and the former (now in second place) throws the same exception:


javax.naming.NamingException: Lookup failed for 'com.ansis.timetracker.server.session.remote.DashboardFacadeBeanRemote' in SerialContext targetHost=localhost,targetPort=30037,orb'sInitialHost=localhost,orb'sInitialPort=3700 [Root exception is javax.naming.NamingException: ejb ref resolution error for remote business interfacecom.ansis.timetracker.server.session.remote.DashboardFacadeBeanRemote [Root exception is java.lang.RuntimeException: Could not invoke defineClass!]]
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.ansis.timetracker.client.ClientActivator.getDashboardFacadeBean(ClientActivator.java:940)
        ... 3 more
Caused by: javax.naming.NamingException: ejb ref resolution error for remote business interfacecom.ansis.timetracker.server.session.remote.DashboardFacadeBeanRemote [Root exception is java.lang.RuntimeException: Could not invoke defineClass!]
        at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:430)
        at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:70)
        at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:472)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:437)
        ... 5 more
Caused by: java.lang.RuntimeException: Could not invoke defineClass!
        at com.sun.corba.ee.impl.orbutil.codegen.CodeGeneratorUtil.makeClass(CodeGeneratorUtil.java:98)
        at com.sun.corba.ee.spi.orbutil.codegen.Wrapper._generate(Wrapper.java:1102)
        at com.sun.corba.ee.spi.orbutil.codegen.Wrapper._generate(Wrapper.java:1086)
        at com.sun.ejb.EJBUtils.generateAndLoad(EJBUtils.java:586)
        at com.sun.ejb.EJBUtils.loadGeneratedGenericEJBHomeClass(EJBUtils.java:538)
        at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:399)
        ... 9 more
Caused by: java.lang.reflect.InvocationTargetException
        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 com.sun.corba.ee.impl.orbutil.codegen.CodeGeneratorUtil.makeClass(CodeGeneratorUtil.java:95)
        ... 14 more
Caused by: java.lang.LinkageError: loader (instance of org/eclipse/core/runtime/internal/adaptor/ContextFinder): attempted duplicate class definition for name: "com/sun/ejb/codegen/GenericEJBHome_Generated"
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
        ... 19 more

What is this exception and how can we solve this problem?

We followed all instructions from the EJB FAQ and included all JAR files from the GF modules directory in our Eclipse plugin and put them all on the classpath.

We've tried for the last two weeks to find a solution to no avail. Any help or pointer is highly appreciated.



Kind regards,

- Andreas Kozma
www.ansis.com