請教一個struts+tomcat 資料來源配置的問題
初學struts,很多不懂,望高手指教!!
我用的是myeclipse + tomcat + mysql資料庫,
下面是在struts專案中 struts-comfig.xml中資料來源的配置
<data-sources>
<data-source key="oracleDB1" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName"
value="org.gjt.mm.mysql.Driver" />
<set-property property="url"
value="jdbc:mysql://localhost/test" />
<set-property property="maxActive"
value="5"/>
<set-property property="username"
value="root"/>
<set-property property="password"
value="admin"/>
<set-property property="autoCommit"
value="true"/>
</data-source>
我在eclipse中啟動tomcat時報下面的錯誤,
嚴重: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:803)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2006-6-2 14:53:24 org.apache.catalina.core.ApplicationContext log
資訊: Marking servlet actionServlet as unavailable
2006-6-2 14:53:24 org.apache.catalina.core.StandardContext loadOnStartup
嚴重: Servlet /Z_Begin threw load() exception
javax.servlet.UnavailableException: org/apache/commons/pool/impl/GenericObjectPool
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2006-6-2 14:53:24 org.apache.coyote.http11.Http11BaseProtocol start
說少了一個包,不知道少了哪個包,大家指點一下。謝謝了。
我用的是myeclipse + tomcat + mysql資料庫,
下面是在struts專案中 struts-comfig.xml中資料來源的配置
<data-sources>
<data-source key="oracleDB1" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="driverClassName"
value="org.gjt.mm.mysql.Driver" />
<set-property property="url"
value="jdbc:mysql://localhost/test" />
<set-property property="maxActive"
value="5"/>
<set-property property="username"
value="root"/>
<set-property property="password"
value="admin"/>
<set-property property="autoCommit"
value="true"/>
</data-source>
我在eclipse中啟動tomcat時報下面的錯誤,
嚴重: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.struts.util.RequestUtils.applicationInstance(RequestUtils.java:143)
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:803)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2006-6-2 14:53:24 org.apache.catalina.core.ApplicationContext log
資訊: Marking servlet actionServlet as unavailable
2006-6-2 14:53:24 org.apache.catalina.core.StandardContext loadOnStartup
嚴重: Servlet /Z_Begin threw load() exception
javax.servlet.UnavailableException: org/apache/commons/pool/impl/GenericObjectPool
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:366)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
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:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2006-6-2 14:53:24 org.apache.coyote.http11.Http11BaseProtocol start
說少了一個包,不知道少了哪個包,大家指點一下。謝謝了。
相關文章
- 請教weblogic資料來源使用問題Web
- 請教一個關於多資料來源的分散式事務問題?分散式
- 請教一個已有系統資料移置帶來的中文問題
- 請教一個資料表關係的問題
- 一個資料庫連線問題!請教高手資料庫
- 請教一個cookies的問題Cookie
- 請教一個executeBatch()的問題BAT
- 請教一個JVM問題JVM
- 請教高手一個問題!
- 請教資料的返回問題
- 請教一個struct tag的問題Struct
- 請教一個ADAPTER的問題APT
- 請教大家一個JAVA的問題Java
- 請教一個WEB START的問題!Web
- 多個資料來源的問題
- 請教各位高手一個問題
- JBoss下配置資料來源問題
- 請教一個go切片引用的問題Go
- 請教一個物件設計的問題物件
- 請教Jive資料庫問題資料庫
- 請教:OpenSessionInViewFilter配置使用問題SessionViewFilter
- 請教一個演算法問題演算法
- 請教一個observer設計問題。Server
- sbt配置——資料來源問題解決
- 請教:一個關於行級資料許可權模型的問題模型
- 請教一個多執行緒的問題執行緒
- 請教Banq一個Ruby架構的問題架構
- 請教各位大俠一個JavaBean的問題JavaBean
- 請教一個DAO設計模式的問題設計模式
- 請教一個檔案上傳的問題
- 請教一個timeout的實現問題
- Webspere配置Oracle RAC 資料來源的問題 (ZT)WebOracle
- Hibernate 資料同步問題請教
- 請教一個切片遞迴賦值的問題遞迴賦值
- 請教一個 python 包安裝的問題Python
- 請教banq老師一個repository的問題
- 請教一個關於執行緒的問題執行緒
- 初學,一個關於RMI的問題請教!!!