在tomcat上运行应用程序时获取异常java.lang.reflect.InvocationTargetException

时间:2014-09-16 11:20:21

标签: java spring tomcat7

我正在尝试在tomcat上启动spring应用程序, 在tomcat V7.0上启动它时获得以下异常:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:804)
at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:104)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057)
...............
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
at org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:637)
at org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:574)
at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:842)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:335)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
.......
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at org.apache.catalina.deploy.NamingResources.addResource(NamingResources.java:353)
... 45 more
Sep 16, 2014 3:21:20 PM org.apache.catalina.startup.ContextConfig processContextConfig
SEVERE: Parse error in context.xml

我在context.xml中添加了JDBC资源,之后我收到了这个异常。

1 个答案:

答案 0 :(得分:1)

问题是通过eclipse安装的Tomcat版本。 从apache站点下载其他tomcat版本,现在它正常工作。