Topic
  • No replies
SystemAdmin
SystemAdmin
590 Posts

Pinned topic osgi help -- loader constraint violation in interface itable initialization

‏2013-01-11T20:42:37Z |
I'm getting the following exception on startup of our application in Websphere v8.5 liberty profile:

SRVE0283E: Exception caught while initializing context: java.util.ServiceConfigurationError: org.osgi.framework.launch.FrameworkFactory: Provider org.eclipse.osgi.launch.EquinoxFactory could not be instantiated: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.eclipse.osgi.launch.EquinoxFactory.newFramework(Ljava/util/Map;)Lorg/osgi/framework/launch/Framework;" the class loader (instance of com/ibm/ws/classloading/internal/AppClassLoader) of the current class, org/eclipse/osgi/launch/EquinoxFactory, and the class loader (instance of com/ibm/ws/kernel/launch/internal/classloader/BootstrapChildFirstJarClassloader) for interface org/osgi/framework/launch/FrameworkFactory have different Class objects for the type org/osgi/framework/launch/Framework used in the signature
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
at <company>.osgi.bridge.FrameworkLauncher.doStart(FrameworkLauncher.java:60)
at <company>.osgi.bridge.FrameworkLauncher.start(FrameworkLauncher.java:44)
at <company>.osgi.bridge.StartupListener.contextInitialized(StartupListener.java:22)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1991)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:753)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:5779)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:249)
at com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:165)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:167)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:448)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:382)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:282)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:253)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:502)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:550)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:899)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:981)
at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398)
at com.ibm.ws.threading.internal.Worker.run(Worker.java:380)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.eclipse.osgi.launch.EquinoxFactory.newFramework(Ljava/util/Map;)Lorg/osgi/framework/launch/Framework;" the class loader (instance of com/ibm/ws/classloading/internal/AppClassLoader) of the current class, org/eclipse/osgi/launch/EquinoxFactory, and the class loader (instance of com/ibm/ws/kernel/launch/internal/classloader/BootstrapChildFirstJarClassloader) for interface org/osgi/framework/launch/FrameworkFactory have different Class objects for the type org/osgi/framework/launch/Framework used in the signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
... 23 more

We use a later version of osgi (v3.8.0) than what's shipped with websphere. It's deploying an ear and I've tried to configure the application to load the application's classes first (using <classloader delegation="parentLast" />), and that doesn't result in an error like this, but it also doesn't seem to load the rest of the application. That is, I try and access a resource (URI) that I know should exist, but I get a 404. Inspecting the logs is showing that it's not starting up everything it should. Any thoughts?

When I use <classloader delegation="parentFirst" /> the server loads more things but then throws the exception I provided above. I'd like the server to use the bundled osgi and load everything else it needs.

I'll mention that I've successfully loaded the same application in Tomcat 7 and JBoss 6.

I would sure appreciate some help -- tried to hop on IRC but nobody was talking...