Tim
I followed your instructions. In point 3) I just added the gf-client.jar to the plugin classpath, so the MANIFEST.MF part read:
Bundle-ClassPath: lib/aef-util.jar, lib/timetracker.jar, modules/gf-client.jar
However, I immediately got a ClassDefNotFound exception for some class in one of the Jars. This leads me to believe that I need to list all Jars in the bundle-classpath, it is not enough if they are referenced through the MANIFEST.MF of the gf-client.jar, presumably because gf-client.jar is not an OSGI bundle.
When I added all Jars in ${clientInstallRoot}/appclient/glassfish/modules to the bundle-classpath, I got the following exception:
java.lang.LinkageError: Failed to inject class com.sun.enterprise.v3.server.ServerContextImpl from org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader_at_8824ae2
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:163)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:170)
at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84)
at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
at org.jvnet.hk2.component.Habitat.getByContract(Habitat.java:594)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:243)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:253)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.createInitialContext(SerialInitContextFactory.java:121)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:116)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:65)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at com.ansis.timetracker.server.util.ConnectionDetails.getInitialContext(ConnectionDetails.java:164)
at com.ansis.timetracker.client.ClientActivator.getActivityTrackerBean(ClientActivator.java:921)
at com.ansis.timetracker.client.ClientActivator.lookup(ClientActivator.java:902)
at com.ansis.timetracker.client.ClientActivator.access$12(ClientActivator.java:896)
at com.ansis.timetracker.client.ClientActivator$6.executeServerCommand(ClientActivator.java:767)
at com.ansis.timetracker.client.core.Operation.run(Operation.java:59)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.NoClassDefFoundError: org/jvnet/hk2/config/ConfigBeanProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:183)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:576)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:546)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:477)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:465)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:445)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:381)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:457)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:111)
... 25 more
Caused by: java.lang.ClassNotFoundException: org.jvnet.hk2.config.ConfigBeanProxy
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 45 more
When I added back all the Jars from the GF/modules dir, my first lookup was successful, but on the second and all subsequent lookups, I received the java.lang.LinkageError listed in my earlier post.
What could be the problem here? This blocker is keeping us from adapting GFv3.
It would save a LOT of time, if the GF team could publish concrete guidelines for Eclipse, NetBeans-based RCP clients.
Many thanks,
- Andreas
[Message sent by forum member 'ansis']
http://forums.java.net/jive/thread.jspa?messageID=470766