Download
Abstract
ClassNotFoundExceptions occur where nested libraries are in use
Download Description
PI23168 resolves the following problem:
ERROR DESCRIPTION:
After upgrading to WebSphere Application Server Liberty Edition 8.5.5.2, datasources may throw an exception like the following:
Could not find datasource: jdbc/eIntake
javax.naming.NamingException: CWWKN0008E: An object could not be
obtained for name jdbc/datasource.
at
com.ibm.ws.jndi.internal.WSContext.resolveObject(WSContext.java:125)
at
com.ibm.ws.jndi.internal.WSContext.lookup(WSContext.java:306)
at
com.ibm.ws.jndi.internal.WSContext.lookup(WSContext.java:301)
at
org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
Caused by: java.lang.ClassNotFoundException:
oracle.jdbc.pool.OracleConnectionPoolDataSource
at
com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonL
ibraryClassLoaders(AppClassLoader.java:403)
at
com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppCla
ss Loader.java:232)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppCla
ssLoader.java:378)
at
com.ibm.ws.jdbc.internal.JDBCDriverService$1.run(JDBCDriverServi
ce.java:226)
This is due to a defect in which an ID generated for nested library elements is the same across different <dataSource/> elements causing only one of them to be loaded.
LOCAL FIX:
Set an ID on the nested <library/> element. As this will produce a warning from the WebSphere Developer Tools also move the <library/> elements to the top level and using a libraryRef inside the <jdbcDriver/> element to reference them.
PROBLEM SUMMARY
USERS AFFECTED:
All users of IBM WebSphere Application Server Liberty Profile 8.5.5.3 using nested libraries
PROBLEM DESCRIPTION:
ClassNotFoundExceptions occur where nested libraries are in use
RECOMMENDATION:
None
Internal IDs generated for nested library elements in server.xml are the same across different elements causing only one of them to be loaded. This therefore leads to ClassNotFoundExceptions.
For example when using configuration such as:
<dataSource id="derbyWithNestedList"
jndiName="jdbc/derbyWithNestedList">
<jdbcDriver>
<library>
<fileset dir="${server.config.dir}/derby"/>
</library>
</jdbcDriver>
<properties.derby.embedded createDatabase="create" />
</dataSource>
<dataSource id="db2WithNestedList"
jndiName="jdbc/db2WithNestedList">
<jdbcDriver>
<library>
<fileset dir="${server.config.dir}/db2"/>
</library>
</jdbcDriver>
<properties.db2.jcc />
</dataSource>
the two nested libraries end up with the same internal ID which leads to problems when class loading.
PROBLEM CONCLUSION:
The Liberty profile server has been changed so that unique IDs are generated for each nested library element in the server configuration.
The fix for this APAR is currently targeted for inclusion in fix pack 8.5.5.4. Please refer to the Recommended Updates page for delivery information:
http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Prerequisites
None
Installation Instructions
Please review the readme.txt for detailed installation instructions.
Technical Support
Contact IBM Support using SR (http://www.ibm.com/software/support/probsub.html), visit the WebSphere Application Server support web site (http://www.ibm.com/software/webservers/appserv/was/support/), or contact 1-800-IBM-SERV (U.S. only).
Problems (APARS) fixed
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg24038522