struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wolfgang Woger <jwwo...@chello.at>
Subject Re: New <data-source> element causes 503 error
Date Mon, 17 Nov 2003 21:23:43 GMT
Hi,
I think you mix up the configuration for datasource access via JNDI and 
directly via Struts-config.xml.
In particular the web.xml configuration and <data-sources > of 
struts-config.xml will disturb each other.
Decide to use JNDI with server.xml and web.xml  xor  <data-sources> in 
struts-config.xml

Wolfgang

todd thorner wrote:

>Hi,
>
>I just tried to add a <data-source> element to my Struts-based webapp.  I put the
proper syntax into my struts-config.xml file, my web.xml file, my %TOMCAT_HOME%/conf/server.xml
file and I put mysql-connector-java-3.0.9-stable-bin.jar into %TOMCAT_HOME%/common/lib (nowhere
else).
>
>Now when I restart Tomcat (4.1.x), my webapp disappears altogether ("503 - Servlet action
is currently unavailable ").
>
>What's up with that?  I didn't change anything, just added some new lines for the new
DataSource.
>
>Thanks for any suggestions or guesses.  The pertinent code is posted below.
>
>-----------------------------------------------
>
>New addition to server.xml:
>
><Resource auth="Container" name="jdbc/mydomainDB" scope="Shareable" type="javax.sql.DataSource"/>
>  <ResourceParams name="jdbc/porturla">
>
                                               name="jdbc/mydomainDB"   
not porturla

>    <parameter><name>factory</name>
>    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>  </parameter>
>  <parameter>
>    <name>url</name>
>    <value>jdbc:mysql://mysql:3306/mydomain?autoReconnect=true</value>
>  </parameter>
>  <parameter>
>    <name>driverClassName</name>
>    <value>org.gjt.mm.mysql.Driver</value>
>  </parameter>
>  <parameter>
>    <name>username</name>
>    <value>mydomain</value>
>  </parameter>
>  <parameter>
>    <name>password</name>
>    <value>********</value>
>  </parameter>
>  <parameter>
>    <name>removeAbandoned</name>
>    <value>true</value>
>  </parameter>
>  <parameter>
>    <name>removeAbandonedTimeout</name> <!-- in seconds -->
>    <value>90</value>
>  </parameter>
>  <parameter>
>    <name>logAbandoned</name>
>    <value>true</value>
>  </parameter>
></ResourceParams>
>
>
>New addition to WEB-INF/web.xml:
>
><resource-ref>
>  <res-ref-name>
>    jdbc/mydomainDB
>  </res-ref-name>
>  <res-type>
>    javax.sql.DataSource
>  </res-type>
>  <res-auth>
>    Container
>  </res-auth>
></resource-ref>
>
>
>New addition to struts-config.xml:
>
><data-sources>
>  <data-source type="javax.sql.DataSource">
>    <set-property property="autoCommit" value="true"/>
>    <set-property property="driverClass" value="org.gjt.mm.mysql.Driver"/>
>    <set-property property="minCount" value="2"/>
>    <set-property property="maxCount" value="10"/>
>    <set-property property="username" value="mydomain"/>
>    <set-property property="password" value="*******"/>
>    <set-property property="url" value="jdbc:mysql://mysql:3306/mydomain?autoReconnect=true"/>
>  </data-source>
></data-sources>
>
>-----------------------------------------------
>
>Also, I do not see anything extraordinary within the "localhost" log (what setting do
I change to make this log print more verbose info?).  My Tomcat startup log says:
>
>...
>Nov 15, 2003 6:06:56 AM org.apache.struts.action.ActionServlet initModuleDataSources
>SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
>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:231)
>	at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1081)
>	at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
>	at javax.servlet.GenericServlet.init(GenericServlet.java:256)
>	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
>	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
>	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421)
>	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3609)
>	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>	at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>	at org.apache.catalina.core.StandardService.start(StandardService.java:497)
>	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
>	at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>	at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>	at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>	at java.lang.reflect.Method.invoke(Method.java:324)
>	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>	at java.lang.reflect.Method.invoke(Method.java:324)
>	at ngasi.CustomAppserverLoader.main(Unknown Source)
>Nov 15, 2003 6:06:57 AM org.apache.jk.common.ChannelSocket init
>INFO: JK2: ajp13 listening on /0.0.0.0:4601
>Nov 15, 2003 6:06:57 AM org.apache.jk.server.JkMain start
>INFO: Jk running ID=0 time=0/48  config=/usr/ngasi/contexts/porturla/appservers/jakarta-tomcat-4.1.27/conf/jk2.properties
>
>-----------------------------------------------
>
>Thanks again.
>
>
>____________________________________________________________
>Enter now for a chance to win a 42" Plasma Television!
>http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda1.com/1/c/563632/113422/313631/313631
>AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda1.com/1/c/563632/113422/313631/313631
>This offer applies to U.S. Residents Only
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


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


Mime
View raw message