spring-loaded icon indicating copy to clipboard operation
spring-loaded copied to clipboard

Using Spring-Loaded with IBM WAS Liberty

Open fahhamk opened this issue 9 years ago • 0 comments

Hey there,

I'm currently researching the usage of spring-loaded with IBM's WAS Liberty Profile and find it incompatible. When spring-loaded is added as a java agent, Liberty is unable to start properly. Here's a snippet of one of the logs I'm getting.

------Start of DE processing------ = [8/5/15 13:38:19:127 EDT] Exception = java.lang.ClassNotFoundException Source = com.ibm.ws.config.admin.internal.ConfigurationStore probeid = 267 Stack Dump = java.lang.ClassNotFoundException: com.ibm.ws.config.admin.ConfigurationDictionary$CaseInsensitive at java.lang.Class.forName(Class.java:283) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:704) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1696) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1601) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1874) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1433) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2093) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:579) at java.util.TreeMap.readObject(TreeMap.java:2297) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) at java.lang.reflect.Method.invoke(Method.java:620) at java.io.ObjectStreamClass.__sljlrmi(ObjectStreamClass.java) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1099) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1996) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1901) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1433) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2093) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2018) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1901) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1433) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2093) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2018) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1901) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1433) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:429) at com.ibm.ws.config.admin.internal.ConfigurationStore.deserializeConfigurationData(ConfigurationStore.java:251) at com.ibm.ws.config.admin.internal.ConfigurationStore.(ConfigurationStore.java:86) at com.ibm.ws.config.admin.internal.ConfigAdminServiceFactory.(ConfigAdminServiceFactory.java:108) at com.ibm.ws.config.admin.internal.WSConfigAdminActivator.start(WSConfigAdminActivator.java:83) at com.ibm.ws.config.internal.WSConfigActivator.start(WSConfigActivator.java:37) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) at java.security.AccessController.doPrivileged(AccessController.java:341) at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936) at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319) at org.eclipse.osgi.container.Module.doStart(Module.java:571) at org.eclipse.osgi.container.Module.start(Module.java:439) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

My assumption is that the ObjectInputStream of the TreeMap is using the classloader of the Spring org.springsource.loaded.ri.ReflectiveInterceptor class instead of the class it should from Liberty. We haven't even reached as far as any application code, which leads me to believe there might be a bug in spring-loaded, though I'm still investigating.

To reproduce the problem, you can download the sample Liberty project from here https://github.com/WASdev/sample.ferret (note: you'll also need maven and ant to run this project, download and add to your path). Using cygwin also makes things a lot easier. Once you have maven and ant installed, follow these instructions: 1. Enter "export IBM_LIBERTY_LICENSE=" (you can get the license from here https://github.com/WASdev/ci.maven#using-a-repository - just click the "current license" link and find the line with the D/N: ) 2. Enter "mvn clean install" (this will download a copy of the Liberty runtime for you) 3. Enter "mvn liberty:run-server" if this is your first time creating the project, so that the default server is created and run. Go to http://localhost:9080/ferret to see how the project should be running. -> To stop the server, do a 'ctrl+c' and enter "mvn liberty:stop-server" 4. Once the project is installed, place the spring-loaded jar in the 'sample.ferret/target/liberty/wlp/usr/servers/defaultServer/' directory. 5. Create a jvm.options file in 'sample.ferret/target/liberty/wlp/usr/servers/defaultServer/' and add the following two lines in the file. -javaagent:<springloaded.jar> -noverify 6. Go back to the 'sample.ferret' directory and enter "mvn liberty:run-server". You'll see a difference in the output on the console. http://localhost:9080/ferret does not work now either. 7. Lastly, to view the logs, stop the server, and go to the 'sample.ferret/target/liberty/wlp/usr/servers/defaultServer/logs'. For something like the snippet above, look at the files inside the ffdc directory.

Let me know if there is anything else I can provide. Thanks for all of your help.

fahhamk avatar Sep 21 '15 18:09 fahhamk