Hi,
My apologies. That blog is outdated and I owe the community an updated
one. You no longer have to write a new bundle to embed glassfish in an
OSGi environment. We already provide such a bundle (it's glassfish.jar
in glassfish/modules) as part of every GlassFish distribution. As I
mentioned in an earlier reply [1] in this forum, here is what you can do:
cd /tmp/equinox
/tmp/equionox $ java -jar org.eclipse.osgi_3.6.1.R36x_v20100806.jar -console
/tmp/equionox $ osgi> install file:<full path to glassfish.jar in your
existing glassfish installation>
/tmp/equionox $ osgi> start 1
That's it. You can refer to [1] for some more information. Pl. feel free
to ask here.
Thanks,
Sahoo
[1]
http://markmail.org/message/db5cm72cn5paemao
On Monday 02 May 2011 10:07 PM, Azubuko Obele wrote:
> Hey all,
>
> I'm attempting to host Glassfish in Equinox using the
> start-glassfish-activator method outlined here at
> http://weblogs.java.net/blog/ss141213/archive/2010/02/14/how-embed-glassfish-existing-osgi-runtime
> . For the most part it seems to work but I'm getting the following error:
>
>
> [#|2011-05-02T12:29:55.150-0400|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=12;_ThreadName=Start
> Level Event Dispatcher;|Unable to start v3. Closing all ports
> org.jvnet.hk2.component.ComponentException: injection failed on
> com.sun.enterprise.v3.admin.AdminAdapter.listener with class
> com.sun.enterprise.v3.admin.listener.GenericJavaConfigListener
> at
> org.jvnet.hk2.component.InjectionManager.error_injectionException(InjectionManager.java:277)
> at
> org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:163)
> at
> org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:91)
> at
> com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:126)
> at
> com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
> at
> com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
> at
> com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
> at
> com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
> at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
> at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
> at java.util.AbstractList$Itr.next(AbstractList.java:345)
> at
> com.sun.enterprise.v3.services.impl.GrizzlyService.registerNetworkProxy(GrizzlyService.java:499)
> at
> com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:397)
> at
> com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
> at
> com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
> at
> com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
> at
> com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
> at
> com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
> at
> com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
> at
> com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
> at
> com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
> at
> com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
> at
> com.sun.enterprise.glassfish.bootstrap.GlassFishMainActivator.start(GlassFishMainActivator.java:77)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
> at com.bet.glassfisheval.Activator.startBundles(Activator.java:129)
> at com.bet.glassfisheval.Activator.start(Activator.java:47)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
> at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
> at
> org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
> at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
> at
> org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
> at
> org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
> at
> org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
> Caused by: java.lang.IllegalArgumentException: Can not set
> com.sun.enterprise.v3.admin.listener.GenericJavaConfigListener field
> com.sun.enterprise.v3.admin.AdminAdapter.listener to
> com.sun.enterprise.v3.admin.listener.GenericJavaConfigListener
> at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
> at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
> at
> sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
> at java.lang.reflect.Field.set(Field.java:657)
> at
> org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:144)
> ... 43 more
>
> Any ideas?
>
> Thanks