Hi All,
   I am attempting to use MySQL as a datasouce for struts to make use of the 
Connection Pool.  I have in my struts-config.xml file the floowing for the datasource 

   <data-sources>
    <data-source>
      <set-property property="autoCommit"
                       value="false"/>
      <set-property property="description"
                       value="Example Data Source Configuration"/>
      <set-property property="driverClass"
                       value="org.gjt.mm.mysql.Driver"/>
      <set-property property="maxCount"
                       value="4"/>
      <set-property property="minCount"
                       value="2"/>
      <set-property property="password"
                       value="some_pass"/>
      <set-property property="url"
                       value="jdbc:mysql://localhost:3306/myjsp"/>
      <set-property property="user"
                       value="monty"/>
    </data-source>
  </data-sources>


I have placed the Jars jdbc2_0-stdext.jar, struts.jar and the reuired MySQL driver jar 
(mysql_comp.jar) in the WEB-INF/lib directory for my application.

Within the web.xml file for my application the servlet action is defined as follows :

<servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>org.apache.struts.webapp.example.ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>detail</param-name>
      <param-value>2</param-value>
    </init-param>
    <init-param>
      <param-name>validate</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>


The problem is that whenever I have the datasource my application will not run because 
the action servlet fails on initialisation with the following error :

cannot load servlet name: action: Exception initializing application data source
 org.apache.struts.action.DATA_SOURCE

Has anybody got any ideas on this. I have tested within my IDE that the database can 
be connected with the above url and user/password connections. Do I need any more 
configurations in web.xml or struts-config.xml ? 

            any answers would be much appreciated,
                         thanks in advance 
                               Marcus




Reply via email to