Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The JarFileClassLoader throws an IllegalArgumentException when defining package com.ibm.websphere.ras.annotation #11445

Closed
dazavala opened this issue Mar 24, 2020 · 0 comments
Assignees
Labels
in:Kernel/Bootstrap release bug This bug is present in a released version of Open Liberty release:20004 team:OSGi Infrastructure

Comments

@dazavala
Copy link
Contributor

dazavala commented Mar 24, 2020

The JarFileClassLoader unexpectedly throws an IllegalStateException when a server thread attempts to define package com.ibm.websphere.ras.annotation:

Caused by: java.lang.IllegalArgumentException: Package com.ibm.websphere.ras.annotation already defined.
at java.lang.ClassLoader.definePackage(ClassLoader.java:1255)
at com.ibm.ws.kernel.internal.classloader.JarFileClassLoader.definePackage(JarFileClassLoader.java:210)
at com.ibm.ws.kernel.internal.classloader.JarFileClassLoader.findClass(JarFileClassLoader.java:159)
at com.ibm.ws.kernel.internal.classloader.BootstrapChildFirstJarClassloader.loadClass(BootstrapChildFirstJarClassloader.java:84)
at java.lang.ClassLoader.loadClass(ClassLoader.java:853)

The exception is thrown whenever multiple server threads compete to load a class in the same package using the JarFileClassLoader, where one thread defines the package before another, and another thread attempts to redefine the package. The IllegalStateException will appear as the causal exception of an error reported by the server. For example:

[2/15/20 5:07:34:256 GMT] 0000001a id=00000000 LogService-24-com.ibm.ws.zos.core                            E CWWKE0701E: bundle com.ibm.ws.zos.core:1.0.38.cl200320200214-0300 (24)[com.ibm.ws.zos.core.internal.CoreBundleActivator(19)] : The activate method has thrown an exception java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.ensureError(J9VMInternals.java:146)
at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:135)
at com.ibm.ws.zos.jni.internal.NativeMethodManagerImpl.start(NativeMethodManagerImpl.java:90)
at com.ibm.ws.zos.core.internal.CoreBundleActivator.activate(CoreBundleActivator.java:127)
...
Caused by: java.lang.IllegalArgumentException: Package com.ibm.websphere.ras.annotation already defined.
...

Thus far the problem has been detected for package com.ibm.websphere.ras.annotation, but the problem is general and may occur for other packages internal to the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Kernel/Bootstrap release bug This bug is present in a released version of Open Liberty release:20004 team:OSGi Infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants