Topic
  • 4 replies
  • Latest Post - ‏2013-10-30T18:27:43Z by lisaw
Alan Chambers
Alan Chambers
3 Posts

Pinned topic Using wxsra.rar for JTA in WAS

‏2013-10-15T15:22:35Z |

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:

  1. 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.
  2. 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?
  3. 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 8.6.0.3 with all the latest fixes on both.

Thanks

  • lisaw
    lisaw
    101 Posts
    ACCEPTED ANSWER

    Re: Using wxsra.rar for JTA in WAS

    ‏2013-10-29T14:18:44Z  

    There is a sample that shows you how to configure wxsra.rar located on our community with both embedding wxsra.rar into your application EAR and scoping the resource adapter to your application server node after you installed WXS into WAS.  The WebSphere Application Server specific files such as using ibm-web-bnd.xml to bind your jndi resource, and your ibm-jcajndi.props to define your jndi name for the wxsra.rar file are located in the sample to show how to configure this feat.

    WebSphere eXtreme Scale JTA Sample - Using the WXS Resource Adapter

    This sample is provided as a modifiable example so that you indeed don't need RAD tooling.  I hope that helps!

  • Alan Chambers
    Alan Chambers
    3 Posts

    Re: Using wxsra.rar for JTA in WAS

    ‏2013-10-16T08:22:50Z  

    Although there doesn't seem to be any tooling in the WAS Developer Tools for Eclipse, I've just installed RAD 9.0 and found that in there there is tooling. 

    On the Enteprise Application Project, select Java EE Tools -> Open WebSphere Application Server Deployment and you get a panel that includes several sections.  One of these is call Embedded J2C Options and provides a GUI to define a connection factory for the embedded resource adapter.  Although it doesn't tell you which files it's creating/modifying, it is as expected the mysterious ibm-jcajndi.props file.

    So, there is tooling if you have the full RAD product but not if you're using Eclipse, even with the WAS development tools added.  This would be OK if the existence and contents of ibm-jcajndi.props were documented somewhere so that you could create one manually.  As it is, unless you have RAD, there's nothing to tell you how to do this.

    So, my questions 1 and 3 still stand - I'd be really interested in getting to the bottom of all this if anyone can help?

  • lisaw
    lisaw
    101 Posts

    Re: Using wxsra.rar for JTA in WAS

    ‏2013-10-29T14:18:44Z  

    There is a sample that shows you how to configure wxsra.rar located on our community with both embedding wxsra.rar into your application EAR and scoping the resource adapter to your application server node after you installed WXS into WAS.  The WebSphere Application Server specific files such as using ibm-web-bnd.xml to bind your jndi resource, and your ibm-jcajndi.props to define your jndi name for the wxsra.rar file are located in the sample to show how to configure this feat.

    WebSphere eXtreme Scale JTA Sample - Using the WXS Resource Adapter

    This sample is provided as a modifiable example so that you indeed don't need RAD tooling.  I hope that helps!

  • Alan Chambers
    Alan Chambers
    3 Posts

    Re: Using wxsra.rar for JTA in WAS

    ‏2013-10-29T15:09:17Z  
    • lisaw
    • ‏2013-10-29T14:18:44Z

    There is a sample that shows you how to configure wxsra.rar located on our community with both embedding wxsra.rar into your application EAR and scoping the resource adapter to your application server node after you installed WXS into WAS.  The WebSphere Application Server specific files such as using ibm-web-bnd.xml to bind your jndi resource, and your ibm-jcajndi.props to define your jndi name for the wxsra.rar file are located in the sample to show how to configure this feat.

    WebSphere eXtreme Scale JTA Sample - Using the WXS Resource Adapter

    This sample is provided as a modifiable example so that you indeed don't need RAD tooling.  I hope that helps!

    Yes - many thanks for that.  This is the sample in which we found the answer - and I've just for the first time read the readme that's provided, which explains the purpose of the ibm-jcajndi.props file, which would have saved me a lot of time if I'd found it earlier.

    I do think it would be worth including this information in the formal documentation too.  That is surely where essential information like this should be - not just in a sample on a the community site.

    Thanks again.

    Alan

  • lisaw
    lisaw
    101 Posts

    Re: Using wxsra.rar for JTA in WAS

    ‏2013-10-30T18:27:43Z  

    Yes - many thanks for that.  This is the sample in which we found the answer - and I've just for the first time read the readme that's provided, which explains the purpose of the ibm-jcajndi.props file, which would have saved me a lot of time if I'd found it earlier.

    I do think it would be worth including this information in the formal documentation too.  That is surely where essential information like this should be - not just in a sample on a the community site.

    Thanks again.

    Alan

    You are absolutely right, I'll filter this info to our Infocenter team and hopefully get that information out there how to configure the JTA as embedded. If you install the resource adapter to the node, I think you wouldn't need the ibm-jcajndi.props file.  Considering we suggest you use it as embedded, the information should be there.