final ServiceRegistry registry = context.getServiceRegistry(true);
final ServiceName wmServiceName = ConnectorServices.WORKMANAGER_SERVICE.append(name);
final ServiceController<?> wmController = registry.getService(wmServiceName);
final WorkManager wm = (WorkManager) wmController.getValue();
WorkManagerConnectionFactory wcf = (WorkManagerConnectionFactory) ctx.lookup("java:/eis/WorkManagerConnectionFactory");
If I set a breakpoint on that line and right click/inspect just the context lookup (without the cast), I can see the fully populated WorkManagerConnectionFactoryImpl object. However, when I add the cast to the lookup, the following error occurs: could not resolve type: com.[ourcompanyname].resourceadapter.workmanager.WorkManagerConnectionFactory, and, of course, when stepping to the next line an exception occurs. To recap, we are deploing the .rar file along with our EAR.
So, next I decided to try implementing the resource adapter as a JBoss custom module. I started from scratch and used the IronJacamar code generator, which is great. After adding the requisite work manager code, I added the workmanager resource adapter elements to the resource adapter subsystem in standalone-full.xml, and created the custom module with the just the workmanager.jar, the IronJacamar.xml, the ra,xml and the new module.xml file. The strange thing is we ended getting the exact same error as mentioned above. I should note that we have other custom modules, like security and our Oracle data source that are working well.
So then I decided to make the resource adapter a global module (just adding a line in the global modules subsystem) and moving the workmanager module folders to the root folder. And now it works!
So,we are going with the JBoss module approach. We would rather run it as a custom module, but we can live with the global module approach.
Thanks again for all your help.
Bob