I am using Struts 1.1 and Tomcat 4.1.18 and MySQL 4.0.17. 
In \Tomcat\common\lib I have jdbc2_0-stdext.jar and as connector I use
mysql-connector-java-3.0.9-stable-bin.jar which is located in
JAVA_HOME\jre\lib\ext

The user <username> is granted all rights to a test-database and mysql test
- u username -p connects to this database without problems.
Struts-config.xml contains the following lines:
  <data-sources>
    <data-source key="test"
                 type="javax.sql.DataSource">
      <set-property property="autoCommit"
                    value="true"/>
      <set-property property="driverClass"
                    value="com.mysql.jdbc.Driver"/>
      <set-property property="maxCount"
                    value="6"/>
      <set-property property="minCount "
                    value="2"/>
      <set-property property="user"
                    value="username"/>
      <set-property property="password"
                    value="pasword"/>
      <set-property property="url"
                    value="jdbc:mysql://localhost:3306/test"/>
    </data-source>
  </data-sources>

At the end of web.xml, I have added the following lines:
  <resource-ref>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

When I reload the application, tomcat\logs\stderr.log contains the following
lines:
java.lang.InstantiationException: javax.sql.DataSource
        at java.lang.Class.newInstance0(Class.java:293)
        at java.lang.Class.newInstance(Class.java:261)
        at
org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:23
1) 
        ......

and when I try to run the application, the browser displays this message:
The requested service (Servlet action is currently unavailable) is not
currently available. 

When I remove the datasource, there are no problems.

How can I check why instantiating of the DataSource fails and where do I
make a mistake?

Ben

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

Reply via email to