ClassNotFound / ClassCast when trying to use JCA Connector deployed in rar in JBoss EAP 6
Issue
- We have been using a JCA Resource Adapter (the
example.rar
). The adapter can be configured correctly in JBoss 6.0 EAP (if we disable JCA validation). A Lookup JNDI returns theConnectionFactory
. With theConnectionFactory
I can get a Connection, and with the Connection I can get an Interaction. The problem lies when trying to initialise an ExampleSpec which is the object used as a parameter in the execute() method. I get the followingClassNotFoundException
:
java.lang.ClassNotFoundException: com.jboss.examples.resource.adapter.ExampleSpec
-
This Class is in a JAR, in the RAR, at the same level as the other Classes used. I auto deployed the RAR by putting it in the deployments directory, but the problem persists even if I deploy it manually or try declaring the JARs as a module and adding dependencies.
-
We are getting a class cast exception when our war application tries to access our resource adapter that is deployed in a rar
java.lang.ClassCastException: com.jboss.examples.resource.adapater.HelloWorldInteractionSpecImpl cannot be cast to com.jboss.examples.resource.adapater.HelloWorldInteractionSpecImpl
...
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.