javax.servlet.ServletException: Unable to load configuration

前阵子,写了个Servlet,启动时报:
javax.servlet.ServletException: Unable to load configuration. - [unknown location]
at com.caucho.server.dispatch.FilterManager.createFilter(FilterManager.java:164)
at com.caucho.server.dispatch.FilterManager.init(FilterManager.java:87)
at com.caucho.server.webapp.Application.start(Application.java:1655)
at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:509)
at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:153)
at com.caucho.server.webapp.ApplicationContainer.start(ApplicationContainer.java:670)
at com.caucho.server.host.Host.start(Host.java:420)
at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:509)
at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:153)
at com.caucho.server.host.HostContainer.start(HostContainer.java:504)
at com.caucho.server.resin.ServletServer.start(ServletServer.java:971)
at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
at com.caucho.server.deploy.AbstractDeployControllerStrategy.start(AbstractDeployControllerStrategy.java:56)
at com.caucho.server.deploy.DeployController.start(DeployController.java:517)
at com.caucho.server.resin.ResinServer.start(ResinServer.java:551)
at com.caucho.server.resin.Resin.init(Resin.java)
at com.caucho.server.resin.Resin.main(Resin.java:625)
Caused by: Unable to load configuration. - [unknown location]
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
at com.caucho.server.dispatch.FilterManager.createFilter(FilterManager.java:134)
... 20 more

后来才发现,原来是web.xml配置文件有错误,如下:
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>ReportServlet</servlet-name>
    <servlet-class>com.eweb.jasperReport.ReportServlet</servlet-class>
  </servlet>
其中,description和display-name标签单词之间多了些空格,去掉这两个标签或空格,启动OK。不过也奇怪,我在我本地是好的,为什么到服务器会报上面的错误的,知道的朋友请指点一下!

你可能感兴趣的:(java,apache,Web,servlet,360)