当我尝试使用 apache tomcat6.0.35 服务器运行我的项目时,我收到以下错误
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:959)
at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2739)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2719)
... 54 more
这里它在 web.xml 文件中显示错误java.lang.reflect.InvocationTargetException
和错误
/localhost/knowledgecenter/WEB-INF/web.xml; lineNumber: 11; columnNumber: 23; Error at (11, 23: Servlet mapping specifies an unknown servlet name validfiles1
在我运行项目的时候
Sep 04, 2012 4:40:34 AM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/knowledgecenter/WEB-INF/web.xml
org.xml.sax.SAXParseException; systemId: jndi:/localhost/knowledgecenter/WEB-INF/web.xml; lineNumber: 11; columnNumber: 23; Error at (11, 23: Servlet mapping specifies an unknown servlet name validfiles1
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2806)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2832)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1741)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1076)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4612)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:559)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:791)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name validfiles1
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2739)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2719)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:959)
at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:789)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
... 47 more
相同的项目在 glassfish 下运行良好,但在使用 netbeans 7.1 的 tomcat.iam 中失败。我在清理和构建过程中收到此警告
init:
undeploy-clean:
deps-clean:
do-clean:
Deleting directory /home/adapco/NetBeansProjects/knowledgecenter/build
Deleting directory /home/adapco/NetBeansProjects/knowledgecenter/dist
check-clean:
clean:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Created dir: /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/classes
Created dir: /home/adapco/NetBeansProjects/knowledgecenter/build/web/META-INF
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/META-INF
Copying 53 files to /home/adapco/NetBeansProjects/knowledgecenter/build/web
library-inclusion-in-archive:
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
Copying 1 file to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/lib
library-inclusion-in-manifest:
Created dir: /home/adapco/NetBeansProjects/knowledgecenter/build/empty
Compiling 15 source files to /home/adapco/NetBeansProjects/knowledgecenter/build/web/WEB-INF/classes
warning: [options] bootstrap class path not set in conjunction with -source 1.5
1 warning
compile:
compile-jsps:
Created dir: /home/adapco/NetBeansProjects/knowledgecenter/dist
Building jar: /home/adapco/NetBeansProjects/knowledgecenter/dist/knowledgecenter.war
do-dist:
dist:
BUILD SUCCESSFUL (total time: 0 seconds)