启动服务器时,报错如下:
严重: End event threw exception
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:975)
at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:522)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:228)严重: Parse error in application web.xml file at jndi:/localhost/FirstStruts/WEB-INF/web.xml
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2725)
严重: Occurred at line 31 column 11
2008-5-3 19:22:46 org.apache.catalina.startup.ContextConfig start
严重: Marking this application unavailable due to previous error(s)
2008-5-3 19:22:46 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2008-5-3 19:22:46 org.apache.catalina.core.StandardContext start
严重: Context [/FirstStruts] startup failed due to previous errors
我的代码:struts-config.xml部分代码:
<global-forwards>
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward
name="welcome"
path="/Welcome.do"/>
</global-forwards>
<!-- =========================================== Action Mapping Definitions --> <action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/Welcome"
forward="/pages/Welcome.jsp"/>
index.jsp部分代码:
b uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<logic:redirect forward="welcome"/>
web.jsp的部分代码;
<taglib>
<taglib-url>strutx-html</taglib-url>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-bean</taglib-url>
<taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-logic</taglib-url>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-nested</taglib-url>
<taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-tiles</taglib-url>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>
严重: End event threw exception
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:975)
at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:522)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:228)严重: Parse error in application web.xml file at jndi:/localhost/FirstStruts/WEB-INF/web.xml
java.lang.IllegalArgumentException: Can't convert argument: null
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2725)
严重: Occurred at line 31 column 11
2008-5-3 19:22:46 org.apache.catalina.startup.ContextConfig start
严重: Marking this application unavailable due to previous error(s)
2008-5-3 19:22:46 org.apache.catalina.core.StandardContext start
严重: Error getConfigured
2008-5-3 19:22:46 org.apache.catalina.core.StandardContext start
严重: Context [/FirstStruts] startup failed due to previous errors
我的代码:struts-config.xml部分代码:
<global-forwards>
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward
name="welcome"
path="/Welcome.do"/>
</global-forwards>
<!-- =========================================== Action Mapping Definitions --> <action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/Welcome"
forward="/pages/Welcome.jsp"/>
index.jsp部分代码:
b uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<logic:redirect forward="welcome"/>
web.jsp的部分代码;
<taglib>
<taglib-url>strutx-html</taglib-url>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-bean</taglib-url>
<taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-logic</taglib-url>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-nested</taglib-url>
<taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-url>strutx-tiles</taglib-url>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>
严重: Parse error in application web.xml file at jndi:/localhost/FirstStruts/WEB-INF/web.xml
去掉就可以了
<taglib-url>strutx-html </taglib-url>
<taglib-location>/WEB-INF/tld/struts-html.tld </taglib-location>
</taglib>
这里面的有拼写错误strutx-html
大家以后复制粘贴的时候也要小心一点,这种很难检查出来的
struts-config.xml 文件,还是这样啊。
但是是因为启动tomcat的时候加载了别的程序,说明在删除项目的时候,tomcat里面还有一些东西没删干净。
直接把其他的项目先移除Tomcat就好了