You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Carl T. Dreher" <fo...@arn.net> on 2004/07/30 16:38:13 UTC

GenericDataSource error?

I've been trying to follow the examples in a variety of books about
using the Struts <data-source> configuration.

<data-sources>
	<data-source type = "org.apache.commons.dbcp.BasicDataSource">
		<set-property property = "driverClassName" value =
"com.mysql.jdbc.Driver" />
		<set-property property = "url" value =
"jdbc:mysql://localhost:3306/MYDATABASE" />
		<set-property property = "username" value = "MYNAME" />
		<set-property property = "password" value = "MYPASSWORD" />
	</data-source>
</data-sources>

Whenever I try access any page in any application that has this in the
struts-config.xml, even if the app does not do a single deb operation,
TomCat throws an exception saying there is no definition for class for
GenericDataSource.  I did a search in the docs and found lots of
identical notes that GenericDataSource has been deprecated, but nothing
giving even the slightest hint about what to do about it.  I finally got
things to work (or at least, not throw the exception!) by dropping the
struts-legacy.jar file in the /lib directory.  None of the books or
examples mentions that.  ( I'm using Tomcat 5.027, Struts 1.1 (dated
6-29-03) Java 1.41 and Jakarta commons DBCP-1.2.1.)

OK, what's going on?  Is there some magic combination of libs for Struts
and Tomcat and DBCP?  Adding anything called "legacy" tells me this
isn't the latest way to go.

Another question is, how do I use the SEARCH facility of this achieve? 
No matter what I try, it reports "Text search not available for this
list."  I tried looking through the archives for an answer to the above
but after taking 20 minutes to go through the first 500 of 125 THOUSAND
posts it became obvious that wasn't going to cut it.

- Carl Dreher


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org