Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Open Transaction Manager and Tomcat

Reply
Thread Tools

Java Open Transaction Manager and Tomcat

 
 
Anders Steinlein
Guest
Posts: n/a
 
      12-08-2003
I can't seem to get JOTM (Java Open Transaction Manager) to work in my
web application. I tried the example at
http://www.onjava.com/pub/a/onjava/2...nsactions.html
successfully, but I get a NamingException when looking up the data source
in my application (it worked fine without JOTM). The root cause:

Caused by: javax.naming.NamingException: Could not create resource
factory instance, null
at org.apache.naming.factory.ResourceFactory.getObjec tInstance
(ResourceFactory.java:146)
at javax.naming.spi.NamingManager.getObjectInstance
(NamingManager.java:301)

From my web.xml:

<resource-env-ref>
<description>Database connection</description>
<resource-env-ref-name>jdbc/3c_db</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>

The context in server.xml:

<Context path="/conquerian" docBase="conquerian" debug="6"
reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="conquerian_log." suffix=".txt" timestamp="true"/>

<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.postgresql.Driver"
connectionURL="jdbcostgresql:conquerian"
connectionName="user_3c" connectionPassword="2db4user"
userTable="players" userNameCol="user_name"
userCredCol="password" userRoleTable="players_roles"
roleNameCol="role_name" debug="50"/>

<Resource name="jdbc/3c_db" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/3c_db">
<parameter>
<name>factory</name>
<value>org.objectweb.jndi.DataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.postgresql.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbcostgresql://127.0.0.1/conquerian</value>
</parameter>
<parameter>
<name>username</name>
<value>mydbuser</value>
</parameter>
<parameter>
<name>password</name>
<value>mydbpass</value>
</parameter>
</ResourceParams>

<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory </value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>
</Context>

Just for reference, I have put the JOTM jar files in common/lib.

My setup consists of JOTM 1.4.3, Tomcat 4.1.27, PostgreSQL 7.4.3,
pg73jdbc3 driver.

This problem is driving me nuts, so any and all help will be extremely
appreciated.

Thanks!

Regards,
\Anders
 
Reply With Quote
 
 
 
 
kNate
Guest
Posts: n/a
 
      12-30-2003
Anders,

I'm running into the same problem... j2sdk1.4.2, Tomcat/4.1.27, JOTM
1.4.3, using Merant JDBC Drivers...

Any one have a resolution?


Anders Steinlein <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>.. .
> I can't seem to get JOTM (Java Open Transaction Manager) to work in my
> web application. I tried the example at
> http://www.onjava.com/pub/a/onjava/2...nsactions.html
> successfully, but I get a NamingException when looking up the data source
> in my application (it worked fine without JOTM). The root cause:
>
> Caused by: javax.naming.NamingException: Could not create resource
> factory instance, null
> at org.apache.naming.factory.ResourceFactory.getObjec tInstance
> (ResourceFactory.java:146)
> at javax.naming.spi.NamingManager.getObjectInstance
> (NamingManager.java:301)
>
> From my web.xml:
>
> <resource-env-ref>
> <description>Database connection</description>
> <resource-env-ref-name>jdbc/3c_db</resource-env-ref-name>
> <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
> </resource-env-ref>
>
> The context in server.xml:
>
> <Context path="/conquerian" docBase="conquerian" debug="6"
> reloadable="true">
> <Logger className="org.apache.catalina.logger.FileLogger"
> prefix="conquerian_log." suffix=".txt" timestamp="true"/>
>
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> driverName="org.postgresql.Driver"
> connectionURL="jdbcostgresql:conquerian"
> connectionName="user_3c" connectionPassword="2db4user"
> userTable="players" userNameCol="user_name"
> userCredCol="password" userRoleTable="players_roles"
> roleNameCol="role_name" debug="50"/>
>
> <Resource name="jdbc/3c_db" auth="Container"
> type="javax.sql.DataSource"/>
> <ResourceParams name="jdbc/3c_db">
> <parameter>
> <name>factory</name>
> <value>org.objectweb.jndi.DataSourceFactory</value>
> </parameter>
> <parameter>
> <name>driverClassName</name>
> <value>org.postgresql.Driver</value>
> </parameter>
> <parameter>
> <name>url</name>
> <value>jdbcostgresql://127.0.0.1/conquerian</value>
> </parameter>
> <parameter>
> <name>username</name>
> <value>mydbuser</value>
> </parameter>
> <parameter>
> <name>password</name>
> <value>mydbpass</value>
> </parameter>
> </ResourceParams>
>
> <Resource name="UserTransaction" auth="Container"
> type="javax.transaction.UserTransaction"/>
> <ResourceParams name="UserTransaction">
> <parameter>
> <name>factory</name>
> <value>org.objectweb.jotm.UserTransactionFactory </value>
> </parameter>
> <parameter>
> <name>jotm.timeout</name>
> <value>60</value>
> </parameter>
> </ResourceParams>
> </Context>
>
> Just for reference, I have put the JOTM jar files in common/lib.
>
> My setup consists of JOTM 1.4.3, Tomcat 4.1.27, PostgreSQL 7.4.3,
> pg73jdbc3 driver.
>
> This problem is driving me nuts, so any and all help will be extremely
> appreciated.
>
> Thanks!
>
> Regards,
> \Anders

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Win2003 SP1 error: "New transaction cannot enlist in the specified transaction coordinator" Vencz Istv?n ASP General 2 05-02-2005 05:53 AM
Tomcat Web application manager - Virtual host Tomcat 4.30 + Apache2 + JK2 connector with multi IPs Joe Java 0 07-12-2004 03:06 PM



Advertisments