The final problem with the latest tomcat-service and the petstore app is
an issue with how the resource refs from the jboss-web.xml file are mapped
into the jboss server JNDI namespace. The problem that JbossWebXmlReader
is performing this mapping from the thread in which the web app is deployed
and it is binding into the java:comp/env context which is a thread local namespace.
When the servlet requests run they are using a different thread and so the
namespace is incorrect.

This is output from the JbossWebXmlReader context interceptor that maps
the jboss-web.xml resources to the existing names. Note that it is running in
Thread = Thread[main,5,main]
[Auto deploy] Binding java:comp/env/jdbc/EstoreDataSource to java:/EstoreDB
[Auto deploy] Thread = Thread[main,5,main]
[Auto deploy] ... jdbc/EstoreDataSource is bound to: 
org.opentools.minerva.jdbc.xa.XAPoolDataSource@5fc40c
[Auto deploy] ... java:/EstoreDB is bound to: 
org.opentools.minerva.jdbc.xa.XAPoolDataSource@5fc40c

Here is debugging output from the data object that is looking up the EstoreDataSource.
Note that it is running in Thread = Thread[Thread-16,5,main] and that instead of
a Cloudscape connection it is receiving a Hypersonic connection. This is due to
a default mapping mechanism. Because the wrong type of connection is obtained,
the resulting query fails.

[TheAccount] Retrieved account DS from: java:comp/env/jdbc/EstoreDataSource, 
ds=org.opentools.minerva.jdbc.xa.XAPoolDataSource@523be
[TheAccount] queryString is: SELECT userid FROM account WHERE userid = 'j2ee'
[DefaultDS] Resource 'org.opentools.minerva.jdbc.xa.wrapper.XAResourceImpl@50f59e' 
enlisted for
'org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@5e256f'.
[DefaultDS] Pool DefaultDS [1/1/10] gave out pooled object: 
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@5e256f
[TheAccount] Thread = Thread[Thread-16,5,main]
[TheAccount] dbConnection = 
org.opentools.minerva.jdbc.xa.wrapper.XAClientConnection@63f09e
[TheAccount] dbConnection metaData = org.hsql.jdbcDatabaseMetaData@4a55e5
[TheAccount] DatabaseProductName = HypersonicSQL
[TheAccount] DatabaseProductVersion = 1.4
[TheAccount] DriverName = HypersonicSQL Driver
[TheAccount] DriverVersion = 1.4
[TheAccount] URL = jdbc:HypersonicSQL:hsql://localhost:1476
[TheAccount] java.sql.SQLException: Table not found: ACCOUNT in statement [SELECT 
userid FROM account WHERE userid = 'j2ee']

It seems to me that this mapping should be done in an jboss.xml file at the ear level
rather than a war jboss-web.xml file as we are dealing with the ejb env, not the
servlets. Was this mapping working in the past?



Reply via email to