blah-service.xml deployment questions
donlind Nov 8, 2002 3:05 PMI have three questions at the end of this... But first, the background information:
I have created a JCA adapter, myJCA.rar, that is really for an EIS (as opposed to a wrapper for a JDBC driver). It supports XA transactions.
I did my initial development under the Sun reference implementation J2EE App Server where, via their "deploytool", I gave my adapter the JNDI Name of "myEIS". My JCA adapter's ra.xml file includes the basic connection configuration like serverName and portNumber.
Things generally worked ok under the reference implementation.
This same RAR deploys under JBoss 3.0.4 (on Windows 2000), but isn't accessible because JBoss never registers a JNDI Name for the adapter (I know... 'cause I hadn't yet told it the JNDI name to use).
After having deployed my myJCA.rar into JBoss, the jmx console shows me this:
MBean View
MBean Name: Domain Name: jboss.jca
service: RARDeployment
name: My JCA Adapter
MBean Java Class: org.jboss.resource.RARDeployment
MBean description:
Description of a deployed Resource Adapter
List of MBean Attributes:
DisplayName = My JCA Adapter
ManagedConnectionFactoryClass =
filenet.vw.jca.myManagedConnectionFactory
TransactionSupport = 2
AuthMechType = BasicPassword
ReauthenticationSupport = false
ServerName = Don
Password = asecret
PortNumber = 1099
UserName = SysAdmin
ConnectionURL = vwrouter
No operations are listed for the RAR mbean.
The above MBean attributes come directly from the ra.xml file that is part of the RAR deployment information for myJCA.rar.
After some reading, I decided that I needed to create a myJCA-service.xml file to supply the JNDI Name (for my adapter) to JBoss so that it would register the name for me.
After *lots* of reading and trial and error, I finally got things to pretty much work with the following myJCA-service.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
myEIS
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=My JCA Adapter
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
0
5
5000
15
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
I basically plagarized the above file from other *-service.xml files. I have not found much information on the *semantics* of the contents of this xml file, so there is probably some unnecessary stuff in there. I made many attempts with simpler versions of this file, leaving out stuff that didn't look important to me or didn't seem pertinent to my JCA adapter. Ha. :-) That always resulted in significant flames and other explosions. But the above file seems to work.
I kind of expected that my myJCA-service.xml file would somehow just hook a JNDI name onto my resource adapter. Silly me. :-)
Putting the above xml file into the deploy directory causes JBoss to create another MBean that, in the jmx console, looks like this:
MBean View
MBean Name: Domain Name: jboss.jca
service: XATxDS
name: My JCA Adapter
MBean Java Class: org.jboss.resource.connectionmanager.RARDeployment
MBean description:
Management Bean.
List of MBean attributes:
JndiName = myEIS
DisplayName = My JCA Adapter
ManagedConnectionFactoryClass =
filenet.vw.jca.myManagedConnectionFactory
OldRarDeployment =
jboss.jca:service=RARDeployment,name=My JCA Adapter
List of MBean operations:
startManagedConnectionFactory...
stopManagedConnectionFactory...
setManagedConnectionFactoryAttribute...
This MBean has the JndiName that my bean looks up to find my adapter.
The OldRarDeployment seems to be pointing to the "real" RAR that "is" my JCA Adapter.
All other MBean attributes for this guy are null.
At this point, my bean can successfully look up and use my myJCA adapter... things basically seem to work.
My questions:
1. Am I staggering down a reasonably correct path for JBoss deployment? Is it expected that I'd have two MBeans for my adapter?
2. In my myJCA-service.xml file, the embedded bean is specified with name="jboss.jca:service=XATxDS,name=My JCA Adapter". Is XATxDS the right thing for my adapter? I'm not wrapping a JDBC Driver. And the XATxDS name might be implying a "DataSource" of some sort (pure guessing on my part). Am I ok with XATxDS? It seems to work, at least so far...
3. Why doesn't JBoss call my resource adapter's setServerName and setPortNumber methods and tell me about the server name and port number values specified in the ra.xml file? Sun's reference implementation calls my adapter with that info. JBoss obviously sees the attributes (they're visible the RAR's "deployment MBean"). Do I need to "re-specify" them as attributes within my myJCA-service.xml file? Or is there some way to configure the adapter's "Management Bean" get the info from the adapter's "Deployment Bean"? I just hate to specify that kind of information in two separate places...
Thanks!
Don