strut-config.xml中的data-sources配置
<data-sources>
<data-source type="org. key="dataSources">
<set-property
property="driverClassName" value="org.gjt.mm.mysql.Driver"
/>
<set-property
property="url" value="jdbc:mysql://192.168.137.130:3306/db_bbs"
/>
<set-property
value="20" property="maxCount"/>
<set-property
value="1" property="minCount"/>
<set-property
property="username" value="root"/>
<set-property
property="password" value="root"/>
</data-source>
</data-sources>
tomcat日志:
2011-04-27 00:13:37 StandardContext[/jsp-examples]ContextListener: contextInitialized()
2011-04-27 00:13:37 StandardContext[/jsp-examples]SessionListener: contextInitialized()
2011-04-27 00:13:37 StandardContext[/servlets-examples]ContextListener: contextInitialized()
2011-04-27 00:13:37 StandardContext[/servlets-examples]SessionListener: contextInitialized()
2011-04-27 00:13:46 ApplicationDispatcher[/BBS]: Servlet action is currently unavailable
2011-04-27 00:14:39 ApplicationDispatcher[/BBS]: Servlet action is currently unavailable
2011-04-27 00:14:55 StandardWrapperValve[action]: Servlet action is currently unavailable
2011-04-27 00:19:20 StandardContext[/BBS]Marking servlet action as unavailable
2011-04-27 00:19:20 StandardContext[/BBS]Servlet /BBS threw load() exception
javax.servlet.UnavailableException: Initializing application data source dataSources
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:812)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:335)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3043)
at org.apache.catalina.startup.HostConfig.restartContext(HostConfig.java:873)
at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:759)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1085)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:619)
2011-04-27 00:20:55 ApplicationDispatcher[/BBS]: Servlet action is currently unavailable