The docs say that the factory parameter is only needed for entries that Tomcat is not "aware" of. Since you had a special factory(in your old 5.0 context) and not the standard one used by Tomcat you will need to have the factory element in place.

See:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/globalresources.html

Under Resource Definitions it says:
"You MUST also define any other needed parameters using attributes on the Resource element, to configure the object factory to be used (if not known to Tomcat already), and the properties used to configure that object factory."


And since Oracle does not use the standard factories that are built into Tomcat you will need the parameter for factory.

And I could be full of manure and sprouting daisies. But every now and then I get one right.


Doug



----- Original Message ----- From: "Sean M. Duncan" <[EMAIL PROTECTED]>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, January 17, 2005 8:45 PM
Subject: Re: Help: Context.xml Resource difference between 5.0.x and 5.5.x?



On Mon, 2005-01-17 at 16:57 -0800, TomK wrote:
I'm having trouble moving my webapp from Tomcat 5.0 to 5.5. The dataSource in Context.xml seems to be the issue.

According to the 'JNDI how-to' documentation for 5.0 and 5.5, it looks like the '<ResourceParams>' tag has been removed from the Context.xml and instead you can now supply arbitrary attributes to the <Resource> tag itself.

In 5.0, my Context.xml looked like this and it worked fine:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="true" docBase="myapp" path="/myapp">
  <Resource name="jdbc/db1" auth="Container"
  type="oracle.jdbc.pool.OracleDataSource" />
  <ResourceParams name="jdbc/db1">
    <parameter>
      <name>factory</name>
      <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:oracle:thin:@xx:xx:xx</value>
    </parameter>
    <parameter>
      <name>user</name>
      <value>xx</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>xx</value>
    </parameter>
  </ResourceParams>
</Context>

...note that oracle's factory requires "user", not "username".


Moving to 5.5, I changed it to:

<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="true" docBase="myapp" path="/myapp">
  <Resource auth="Container"
  driverClassName="oracle.jdbc.driver.OracleDriver"
  factory="oracle.jdbc.pool.OracleDataSourceFactory"
  name="jdbc/db1"
  password="xxx"
  type="oracle.jdbc.pool.OracleDataSource"
  url="jdbc:oracle:thin:@xx:xx:xx"
  user="xx"/>
</Context>

...this new Context.xml doesn't work. I get the following:
javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:132)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at org.apache.naming.NamingContext.lookup(NamingContext.java:792)


....any ideas? Almost seems as if the "factory" attribute of <Resource> is not being used.

thanks
tk_


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to