As a test, I've been trying to develop an MDB that writes data received in a message to an XS grid, all wrapped in a transaction. According to the Infocenter and other sources, there are two options - (1) install the resource adapter (wxsra.rar) in WAS and configure a connection factory for it to enable it to be accessed from the code or (2) package the RAR into the enterprise application at development time.
However, I found that if you only install into WAS, the code fails to compile because the classes XSConnectionFactory and XSConnection can't be resolved. As these classes seem to exist only in a jar file that is packaged in the wxsra.rar, the only solution seems to be to package the RAR into the application anyway, so you end up with it configured in WAS and also included in the EAR. This is not my understanding of how it's supposed to work.
On the other hand, if I package the RAR into the application and don't configure it in WAS, there's no obvious place to define a JNDI name for the connection factory, so there's no way for the code to look it up.
An IBM friend and former colleague showed me a sample application that uses this resource adapter and in this he noticed a mysterious properties file ibm-jcajndi.props in the META-INF directory within the ear file. This file defines a connection factory and sure enough when I did the same in my app, it worked with the rar embedded in my application and nothing else configured in WAS.
My immediate problem is solved but I'm left with a few questions and would really welcome thoughts or help with them:
- Where is the need for an ibm-jcajndi.props file documented? There's nothing I can find in either the WAS or WXS infocenters and even a google search only throws up a few hits, mostly to the infocenters for old version of RSA. I'm puzzled how anyone is supposed to know that this file is needed or what it should or can contain.
- Even if you know it's needed, is there any tooling (e.g. in the WAS developer tools for eclipse) to help one create or edit it?
- Is there any way to use the RAR file configured in WAS, without also including it in your EAR?
I'm using WAS 8.5.5 and WXS 220.127.116.11 with all the latest fixes on both.