求助:Parse error in application web.xml file at jndi:/localhost/ssh/WEB-INF/web.xml
2017-07-05 18:14
639 查看
在配置spring的时候出现错误如下:
调试了许久,依然显示这个错误,我的web.xml文件代码如下:
spring配置如下:
不知道是哪里出错了,希望大家能帮忙指出错误,谢谢!
严重: Parse error in application web.xml file at jndi:/localhost/ssh/WEB-INF/web.xml org.xml.sax.SAXParseException; systemId: jndi:/localhost/ssh/WEB-INF/web.xml; lineNumber: 47; columnNumber: 20; Error at (47, 20: Invalid <url-pattern> /*.action in filter mapping at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2726) at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2752) at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1061) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562) at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:369) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1062) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4236) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> /*.action in filter mapping at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:2169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:899) at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:193) at org.apache.tomcat.util.digester.Rule.end(Rule.java:229) at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058) ... 25 more
调试了许久,依然显示这个错误,我的web.xml文件代码如下:
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name></display-name> <!-- spring配置文件的位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml </param-value> </context-param> <!-- 对Spring 容器进行实例化 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <!-- ssh 中文过滤 --> <filter> <filter-name>characterEncoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterEncoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- 定义Struts 2 的核心控制器 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*.action</url-pattern> </filter-mapping> <listener> <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app>
spring配置如下:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd "> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> </bean> <!-- 配置事务管理器 --> <bean id="hibernateTemplete" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory"> <ref bean="sessionFactory"/> </property> </bean> <bean id="userDao" class="com.ssh.dao.impl.UserDaoImpl"> <property name="sessionFactory"> <ref bean="sessionFactry"/> </property> </bean> <bean id="userService" class="com.ssh.service.impl.UserServiceImpl"> <property name="userDao" ref="userDao"></property> </bean> <bean id="LoginAction" class="com.ssh.action.LoginAction" scope="prototype"> <property name="userService"> <ref bean="userService"/> </property> </bean> </beans>
不知道是哪里出错了,希望大家能帮忙指出错误,谢谢!
相关文章推荐
- 严重: Parse error in application web.xml file at jndi:/localhost/ipws/WEB-INF/web.xml java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml
- Parse error in application web.xml file at jndi:/localhost/ipws/WEB-INF/web.xml
- 严重: Parse error in application web.xml file at jndi:/localhost/userLS/WEB-INF/web.xml
- Parse error in application web.xml file at jndi:/localhost/sdyth/WEB-INF/web.xml org.xml.sax.SAXPar
- java.lang.IllegalArgument,Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml
- Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml org.xml.sax.SAXParseExcep
- 严重:Parse error in application web.xml file at jndi:/localhost/day_29/WEB-INF/web.xml解决办法
- java.lang.IllegalArgument,Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xm
- 在myeclipse中出现Parse error in application web.xml file 问题
- tomcat Parse error in application web.xml can't convert argument:null
- Error creating bean with name 'dataSource' defined in file [WEB_INF\classes\spring\applicationContex
- Parse error in application web.xml
- java.io.FileNotFoundException: URL [jndi:/localhost/myBlogSys/WEB-INF/classes/] cannot be resolved t
- Cannot load excludes configuration file "/WEB-INF/decorators.xml" as specified in "sitemesh.xml" or "sitemesh-default.xml"(已解决)
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
- Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
- Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF
- 严重: Parse Fatal Error at line 2 column 243: 已经为元素 "web-app" 指定属性 "xmlns"。 org.xml.sax.SAXParseExcept
- SSH架构易出现的问题之Error creating bean with name '*' defined in file [*.xml]
- SSH三大框架整合问题--Could not open ServletContext resource [/WEB-INF/applicationContext.xml]