Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts Datasource

843838Dec 7 2006
Hi

I have a struts application with mysql. I have struts 1.2.9 and when I try to connect to the database using the struts datasource, I get some exceptions.

When I put the following code in my struts-config.xml, I get a page saying : Servlet action is not available
<data-sources>
<!-- configuration for commons BasicDataSource -->
        <data-source type="org.apache.tomcat.dbcp.BasicDataSource">
            <set-property property="driverClassName" value="com.mysql.jdbc.Driver" />
            <set-property property="url" value="jdbc:mysql://localhost/aaashuttle?autoReconnect=true" />
            <set-property property="username" value="root" />
            <set-property property="password" value="01194761" />
            <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 cities" />
        </data-source>
</data-sources>
When I remove only <data-sources></data-sources> tags and keep the datasource tag, the getDataSource(request) method returns a null.

Please help fix this problem, or help me connect to my database.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 4 2007
Added on Dec 7 2006
0 comments
162 views