on 07-15-2010 11:19 AM
Hi Gurus,
I am using NW CE 7.1.
I have developed a Java Resource Adapter and deployed it successfully. I am able to see the jndi name in the JNDI Browser.
To test this adapter I have developed a simple Web Application having a Servlet. The servlet does jndi lookup and invokes an operation on the adapter.
The web application WAR file bundles the adapter classes into a jar in the WEB-INF/lib folder.
When I run the web app, during jndi lookup, I get ClassCastException for the ConnectionFactory class of the adapter. I understand that the class is getting loaded by two different class loaders but not able to resolve this issue.
The stack trace is
Details: java.lang.ClassCastException: class com.sap.engine.services.jndi.implclient.ClientContext:service:naming @
com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ f5331a @ alive
incompatible with class
test.ConnectionFactoryTest:JavaEE/AdapterClient1@
com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 1a27fce @ alive
I tried following alternatives.
Alternative 1:
Removed the common jars from WAR and redeployed it.
With this I got ClassNotFoundException for the ConnectionFactory class.
Alternative 2:
Packaging WAR and RAR into an EAR. Here I took out the common jars from both WAR and RAR and added them directly in EAR.
With this I got ClassCastException for the ConnectionFactory class.
Thanks in advance.
JK
Got resolved.
I was using wrong/imcomplete jndi name. Used complete jndi name "deployedAdapters/myra/shareable/myra".
Then I got another ClassCastException as
Details: java.lang.ClassCastException: class test.ConnectionFactoryTest:JavaEE/myra @
com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ f5331a @ alive
incompatible with class
test.ConnectionFactoryTest:JavaEE/AdapterClient1@
com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 1a27fce @ alive
Then I did following steps:
1. bundled the WAR and RAR into an EAR.
2. took out the common jars from both WAR and RAR and added them directly in EAR.
Thanks.
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.