Good Day Folks
I'm busy migrating an application from
JBoss 4.2.3 to Wildfly 8.1, and I'm stuck on a resource adapter issue. The system that I'm working on talks to another system, via a provided resource adapter. I've configured my resource-adapter in my standalone-full.xml file, and I've taken the provided .rar archive (the same one that we used for JBoss 4.2.3) and put it in my deployments directory.
When my server starts up, I can see that Wildfly is trying to deploy the resource adapter, but halfway through, it depends blows up in the
ManagedConnectionFactory implementation that is packaged in my .rar. Since the .rar has been provided to us, I don't actually have the original source code for it - I only have a decompiled view in my
IDE that I can use to debug. Based on what I can see, Wildfly uses a class called
org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService to deploy the resource adapter. In doing so, it instantiates the
javax.resource.spi.ResourceAdapter implementation in the .rar, and then ends up calling
createConnectionFactory(ConnectionManager paramConnectionManager) on our
ManagedConnectionFactory implementation, via
createObjectsAndInjectValue(URL url, String deploymentName, File root, ClassLoader cl, Connector cmd, IronJacamar ijmd, org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter raxml) on
AbstractResourceAdapterDeploymentService (all of this is done by Wildfly while trying to deploy). However, the implementation assumes that a
javax.resource.spi.BootstrapContext would already have been set on the resource adapter when this method is invoked. The code sets the bootstrap context from the
start(BootstrapContext ctx) method on the resource adapter implementation class.
Based on logging output, JBoss 4.2.3 creates the
ResourceAdapter implementation instance, and immediately thereafter calls its
start(BootstrapContext ctx) method. Wildfly, on the other hand, instantiates the
ResourceAdapter, but it doesn't call the
start(...) method - which means that the bootstrap context isn't initialized by the time that the
createConnectionFactory(...) method tries to use it - and ultimately, it results in a NullPointerException.
I realise that his is quite an involved problem, and it probably won't be easy to come up with an answer, but I've been struggling for a couple of days already, so I was hoping that someone might have an answer. How can I get Wildfly to start the resource adapter immediately after creating it?
Thanks,
Riaan
(Apologies if my formatting looks bad - I tried to highlight the classes that relate to my issue)