I keep getting classloader problems (NoClassDefFound) while using the purequery reader/writer pattern in my applicatiojn.
I am using RAD 8.0.2 and WAS 184.108.40.206( included in the RAD package ) with the feature pack for modern batch installed.
My purequery library jar (pdq.jar) is included in the classpath for the jdbc driver ( for db2 9.7 in windows ) defined in the WAS server.
So, the BDSPureQueryReader(loaded by the WAS bootstrap loader) is trying to get the pureQuery DataFactory class( loaded by the isolated
shared lib loader, that is above the application loader and below the WAS bootstrap loader in the classloader hierarchy chain ).
I have tried to move my pdq.jar to the same WAS lib directory, where the batfepapi.jar( modern batch appi classes ) is. Still the same problem.
But my own version of the pureQuery reader/writer pattern( which i wrote about 2 years ago, since CG did not have the pattern then )
works just fine.
Has this IBM pattern been tested with some pureQuery batch app.? If so, please shed some light on how should I configure to get my application working.
Please feel free to ask for any details that you may need for further investigation.
Any assistance will be greatly appreciated.
Thanks in advance.
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
1 reply Latest Post - 2012-04-17T10:27:43Z by SystemAdmin
Pinned topic Problem getting PureQueryReader pattern to work in Modern Batch
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-04-17T10:27:43Z at 2012-04-17T10:27:43Z by SystemAdmin
SystemAdmin 110000D4XK15 PostsACCEPTED ANSWER
Re: Problem getting PureQueryReader pattern to work in Modern Batch2012-04-17T10:27:43Z in response to SystemAdminHi,
I hit on this problem again recently with RAD 8.0.4 ( which comes with the Modern Batch feature pack and
Compute Grid plugin for WAS 7 ) also.
So, my colleague and I started to investigate what was really causing this issue and this is what we found and fixed it :
The Compute Grid API code resides in both, the com.ibm.ws.batch.runtime.jar ( in C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\feature_packs\BATCH\plugins in my installation ) and in the batfepapi.jar ( in C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\lib in my installation ). However, the classes from com.ibm.ws.batch.runtime.jar are loaded by the default OSGI classloader org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader, which happens to be the parent classloader of WAS extension classloader com.ibm.ws.bootstrap.ExtClassLoader.
The pureQuery api and runtime jar (pdq.jar ) is loaded by ( in our case ) the WAS extension classloader (com.ibm.ws.bootstrap.ExtClassLoader).
So, at runtime, because our application uses the PureQueryReaderPattern, this and its implementation class BDSPureQueryReader are loaded by
the OSGi default classloader. The class BDSPureQueryReader uses com.ibm.pdq.runtime.factory.DataFactory class, which is in the lower child
classloader classpath (WAS extension classloader) and hence the ClassDefNotFoundException.
Temporary Solution :
We just knocked off the pureQuery related pattern interfaces and classes from the com.ibm.ws.batch.runtime.jar.
So, now the classes are found in batfepapi.jar ( loaded by WAS Extension classloader, the same loader that also would load the pureQuery
api/runtime classes from pdq.jar ).
I am writing here so that others would also be benefitted.
Having said this, I would like to say that we are quite disappointed with IBM for not responding to this important issue in this forum.
Especially given the fact that the technology are and related products are being fervently pushed into the market and seems to be vital technology for IBM.
I hope, in the future, IBM would respond much faster.