1
我想在服務器啓動時調用以下類。服務器啓動時沒有初始化類
AlertsData是com.mongo.service:
public class AlertsData extends HttpServlet{
public void init(ServletConfig config) throws ServletException{
super.init(config);
alertingPoolsData();
}
}
的web.xml:
<servlet-mapping>
<servlet-name>AlertsData</servlet-name>
<display-name>AlertsData</display-name>
<servlet-class>com.mongo.service.AlertsData</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet-mapping>
越來越folloiwng錯誤:
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/lbmongo]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
與此服務器沒有啓動起來,得到follwoing錯誤..有人請幫忙:( 我想調用一個AlertsData類時服務器啓動。
alteringPoolsData()實際上做了什麼? – 2013-06-25 20:20:25
這不是完整的錯誤消息。將會有更多解釋爲什麼Context無法啓動。 –
全錯誤消息:alertingPoolsData調用MongoDB的每5秒: – user2325703