ClassNotFound / ClassCast when trying to use JCA Connector deployed in rar in JBoss EAP 6

Solution Verified - Updated -

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 the ConnectionFactory. With the ConnectionFactory 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 following ClassNotFoundException:
 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content