Hello all,
i rtfm, stfw but have this problem unsolved.
I configured my <datasource> Tag:
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="oracle.jdbc.driver.OracleDriver" />
<set-property
property="url"
value="jdbc:oracle:thin:@host:1521:datbase" />
<set-property
property="username"
value="me" />
<set-property
property="password"
value="xxxxx" />
<set-property
property="maxActive"
value="10" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="validationQuery"
value="SELECT COUNT(*) FROM t_config" />
</data-source>
</data-sources>
When I start my server, the following error appears on the browser:
[root cause]
java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
...
I don't understand this... am i not using the dbcp?
The commons-dbcp.jar is in my classpath, of course.
Maybe you could give me some hint to solve this.
Thank you!
Chris
BTW: I use Struts 1.1 RC2 and Tomcat 4.1.12
-
Database connection problem (Struts) (5 messages)
- Posted by: Christian Grobmeier
- Posted on: July 02 2003 10:21 EDT
Threaded Messages (5)
- Database connection problem (Struts) by Kalin Komitski on July 02 2003 11:11 EDT
- Database connection problem (Struts) by Chuck Cavaness on July 02 2003 23:38 EDT
- Database connection problem (Struts) by Christian Grobmeier on July 03 2003 08:40 EDT
- Database connection problem (Struts) by Web Master on July 14 2003 09:48 EDT
- Database connection problem (Struts) by Christian Grobmeier on July 03 2003 08:40 EDT
- Problem persistes by Nilanjana Ganguly on February 17 2004 05:40 EST
-
Database connection problem (Struts)[ Go to top ]
- Posted by: Kalin Komitski
- Posted on: July 02 2003 11:11 EDT
- in response to Christian Grobmeier
Place commons-dbcp.jar in the corresponding web app lib directory i.e. C:\jakarta-tomcat\webapps\YOUR_APP\WEB-INF\lib
Kalin -
Database connection problem (Struts)[ Go to top ]
- Posted by: Chuck Cavaness
- Posted on: July 02 2003 23:38 EDT
- in response to Christian Grobmeier
There is a jar file called struts-legacy.jar that contains the GenericDataSource and GenericConnection classes. Not sure how long this jar has been included in the distribution, but I just downloaded the 1.1 release and it's there. You need to get this jar and put it in the WEB-INF\lib directory.
Chuck Cavaness
Author of Programming Jakarta Struts by O'Reilly -
Database connection problem (Struts)[ Go to top ]
- Posted by: Christian Grobmeier
- Posted on: July 03 2003 08:40 EDT
- in response to Chuck Cavaness
Thanks Kalin, but this was not the problem.
Chuck was right, the struts-legacy.jar was not copied in my webapp/lib!
Thank you for this tip!
Regards,
Chris
BTW: Progamming Jakarta Struts is welldone! Congrats on that @chuck -
Database connection problem (Struts)[ Go to top ]
- Posted by: Web Master
- Posted on: July 14 2003 09:48 EDT
- in response to Christian Grobmeier
If you're hosting on 9iAS as well as using Oracle for a db, I've found that iAS is much happier using a JNDI source.
It will look something like:
<data-sources>
<data-source name="bcsatDS"
class="oracle.jdbc.pool.OracleConnectionPoolDataSource"
username="[username]"
password="[password]"
url="jdbc:oracle:thin:@[your db]"
connection-driver="oracle.jdbc.driver.OracleDriver"
location="jdbc/[location]" xa-location="jdbc/xa/[location]"
ejb-location="jdbc/[location]"
connection-retry-interval="5"
max-connect-attempts="3"
inactivity-timeout="120"
max-connections="400"
min-connections="20"
wait-timeout="120"/>
</data-sources>
Hope that helps. -
Problem persistes[ Go to top ]
- Posted by: Nilanjana Ganguly
- Posted on: February 17 2004 05:40 EST
- in response to Christian Grobmeier
Hello all,
>
> i rtfm, stfw but have this problem unsolved.
> I configured my <datasource> Tag:
>
> <data-sources>
> <data-source type="org.apache.commons.dbcp.BasicDataSource">
> <set-property
> property="driverClassName"
> value="oracle.jdbc.driver.OracleDriver" />
> <set-property
> property="url"
> value="jdbc:oracle:thin:@host:1521:datbase" />
> <set-property
> property="username"
> value="me" />
> <set-property
> property="password"
> value="xxxxx" />
> <set-property
> property="maxActive"
> value="10" />
> <set-property
> property="maxWait"
> value="5000" />
> <set-property
> property="defaultAutoCommit"
> value="false" />
> <set-property
> property="defaultReadOnly"
> value="false" />
> <set-property
> property="validationQuery"
> value="SELECT COUNT(*) FROM t_config" />
> </data-source>
> </data-sources>
>
> When I start my server, the following error appears on the browser:
> [root cause]
> java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource
> ...
>
> I don't understand this... am i not using the dbcp?
> The commons-dbcp.jar is in my classpath, of course.
> Maybe you could give me some hint to solve this.
>
> Thank you!
> Chris
>
> BTW: I use Struts 1.1 RC2 and Tomcat 4.1.12