Okay, so with a horrible kludge, I forced jBoss to load the
correct container configuration for my session bean. That configuration
includes a resource reference:
<resource-ref>
<description>Database</description>
<res-ref-name>OracleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
The jboss.xml includes the resource manager for this resource
reference:
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>OracleDB</res-name>
<res-jndi-name>xa.TestDB</res-jndi-name>
</resource-manager>
The JNDI name for the resource manager points to an instance of
the connection pool I'm working on. I know that the resource is loaded,
since I put in some debug code and got:
[Container factory] Found a resource: OracleDB
[Container factory] Found resource manager: OracleDB
[Container factory] Found Data source. Bound to OracleDB, xa.TestDB
So there is a valid resource object, and a valid resource manager
object. If I read the code right, there should be a JDBCResource object
bound to the JNDI name "OracleDB" which is a bean-specific reference to
the global pool bound at "xa.TestDB". So I thought that the global
bindings were not visible to the beans, only the bean-specific bindings
for the resource references. If that is not the case, what is the purpose
of the resource reference?
In any case, there is no object found when I try to lookup
"OracleDB", and when I list the bound JNDI names, I get:
[Default] Found Root Object: SQLTest: $Proxy0
[Default] Found Root Object: jmx: org.jboss.jmx.server.JMXAdaptorImpl
[Default] Found Root Object: xa.TestDB: org.minerva.datasource.XAPoolDataSource
[Default] Found Root Object: TransactionManager: org.jboss.tm.TxManager
It looks like the resource reference is never bound to anything.
There was no NamingException which I would expect if it tried to bind to
"xa.TestDB", and "xa.TestDB" is still bound to the original pool, as you
can see. The only names I gave it were "OracleDB" and "xa.TestDB", and
it's not bound to either! So how do you use it? Also, the original pool
is bound as specified to "xa.TestDB", so I don't even need the resource
reference. Now I'm *really* confused! What am I missing?
Thanks,
Aaron
P.S. Can we change the EJX GUI so it gives a drop-down for "Resource
Type"? It wasn't immediately clear that the only valid values are
"javax.sql.DataSource" or "java.net.URL".
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]