Download
Abstract
Package objects not available from archive class loaders
Download Description
PI98177 resolves the following problem:
ERROR DESCRIPTION:
The classloader for the resource adapter is not working correctly and is returning null for any Class.getPackage().
When a resource adapter is installed on WebSphere Application Server, and inside this resource adapter classes (loaded using resource adapter classloader), if you have a code SomeClass.class.getPackage().getName(), it will crash in NullPointerException because getPackage() will return null.
LOCAL FIX:
None
PROBLEM SUMMARY
When installing a resource adapter, a NullPointerException will occur if resource adapter code attempts to use a package object for a resource adapter or resource adapter related class.
For example:
Caused by: java.lang.NullPointerException
at org.jboss.logging.LoggerProviders.logProvider(LoggerProviders.ja va:156)
at org.jboss.logging.LoggerProviders.tryJDK(LoggerProviders.java:11 2)
at org.jboss.logging.LoggerProviders.findProvider(LoggerProviders.j ava:107)
at org.jboss.logging.LoggerProviders.find(LoggerProviders.java:34)
at org.jboss.logging.LoggerProviders. (LoggerProviders.java: 31)
at java.lang.J9VMInternals.ensureError(J9VMInternals.java:141)
at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternal s.java:130)
at org.jboss.logging.Logger.getLogger(Logger.java:2465)
at org.jboss.logging.Logger.getLogger(Logger.java:2490)
at org.apache.activemq.artemis.ra.ActiveMQResourceAdapter. ( ActiveMQResourceAdapter.java:71)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCons tructorAccessorImpl.java:88)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delega tingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at com.ibm.ws.management.application.J2CAppUtils$1.run(J2CAppUtils. java:416)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessCon troller.java:118)
at com.ibm.ws.management.application.J2CAppUtils.getDefinedProperti es(J2CAppUtils.java:413)
at com.ibm.ws.management.application.J2CAppUtils.getDefinedProperti es(J2CAppUtils.java:543)
at com.ibm.ws.management.component.InstallRAHelper.loadBeanProperty WithType(InstallRAHelper.java:253)
at com.ibm.ws.management.component.InstallRAHelper.loadBeanProperty (InstallRAHelper.java:242)
at com.ibm.ws.management.component.AdminOperationsMBean.createJ2CPo st10ResourceAdapter(AdminOperationsMBean.java:1413)
at com.ibm.ws.management.component.AdminOperationsMBean.createJ2CPo st10ResourceAdapter(AdminOperationsMBean.java:1234)
at com.ibm.ws.management.component.AdminOperationsMBean._getResourc eAdapterFromRAR(AdminOperationsMBean.java:1086)
at com.ibm.ws.management.component.AdminOperationsMBean.getResource AdapterFromRAR(AdminOperationsMBean.java:967)
This specific case occured from JBOSS logging code. The JBOSS code is attempting to retrieve a fully qualified package name for a class loaded in relationship to a resource adapter class.
In this specific case, the preferred alternative solution is to modify the JBOSS logging code to obtain the fully qualified package name directly from the fully qualified class name. Use of a package object is unnecessary for obtaining the package name of a loaded class.
USERS AFFECTED:
All users of IBM WebSphere Application Server
PROBLEM DESCRIPTION:
NullPointerException when installing resource adapter.
RECOMMENDATION:
None
A code update was made, including a new enablement custom property. The code update, when enabled, causes package objects to be created when loading application classes. This ensures that a non-null package is available for any loaded class.
Prerequisites
None
Installation Instructions
Please review the readme.txt for detailed installation instructions.
URL | SIZE(Bytes) |
---|---|
V85 Readme | 6846 |
Download Package
DOWNLOAD | RELEASE DATE | SIZE(Bytes) |
DOWNLOAD Options |
---|---|---|---|
8.5.5.13-WS-WASProd-IFPI98177 | 09-26-2018 | 349308 | FC |
Problems Solved
PI98177
Technical Support
Contact IBM Support using SR (http://www.ibm.com/software/support/probsub.html), visit the support web site, or contact 1-800-IBM-SERV (U.S. only).
Problems (APARS) fixed
Was this topic helpful?
Document Information
Modified date:
02 October 2018
UID
ibm10731211