Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Do resource links not work with UserTransaction (TC 5.0.16)?

Robert Krüger

2004-01-16



Hi,

either I fail to understand the general concept or there is something
strange with resource links in TC 5.0.16.

Everything works as documented with ResourceLink entries with
DataSources and other global resources I configured. However, when I try
configuring a Resource of type javax.transaction.UserTransaction I have
to configure it for each context/webapp because when I configure it as a
global resource and just put a resource link in the context, the lookup
in the web application fails.

Example1 (simplified): does not work, lookup fails
("javax.naming.NamingException: Cannot create resource instance")

<Server>
 <GlobalNamingResources>
  <Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
  <ResourceParams name="UserTransaction">
    <parameter>
     <name>factory</name>
     <value>com.signal7.tyrex.UserTransactionFactory</value>
    </parameter>
  </ResourceParams>
 </GlobalNamingResources>
 <Service>
  <Engine>
    <Host>
     <Context>
      <ResourceLink name="UserTransaction" global="UserTransaction"
type="javax.transaction.UserTransaction"/>
     </Context>
    </Host>
  </Engine>
 </Service>

</Server>

Example2 (simplified): works

<Server>
 <GlobalNamingResources>
 </GlobalNamingResources>
 <Service>
  <Engine>
    <Host>
     <Context>
      <Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
      <ResourceParams name="UserTransaction">
        <parameter>
         <name>factory</name>
         <value>com.signal7.tyrex.UserTransactionFactory</value>
        </parameter>
      </ResourceParams>
     </Context>
    </Host>
  </Engine>
 </Service>

</Server>

It looks as if UserTransaction is treated in a special way. Is that
intentional and obvious and I'm just missing it? BTW, I tried this with
the JOTM JTA implementation and it behaved exactly the same way.

Thanks in advance,

Robert


--
________________________
Robert Kr�ger
Signal7 GmbH
Br�der Knauss Str. 79
64285 Darmstadt
Germany


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.