问题描述
严重: Allocate exception for servlet dwr-invokerorg.xml.sax.SAXParseException: Element type "create" must be followed by either attribute specifications, ">" or "/>".at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)at org.directwebremoting.impl.DwrXmlConfigurator.setInputStream(DwrXmlConfigurator.java:132)at org.directwebremoting.impl.DwrXmlConfigurator.setServletResourceName(DwrXmlConfigurator.java:87)at org.directwebremoting.impl.ContainerUtil.configureFromDefaultDwrXml(ContainerUtil.java:261)at org.directwebremoting.impl.ContainerUtil.configureContainerFully(ContainerUtil.java:419)at org.directwebremoting.servlet.DwrServlet.init(DwrServlet.java:79)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)at java.lang.Thread.run(Unknown Source) dwr.xml:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" "http://www.getahead.ltd.uk/dwr/dwr10.dtd"><dwr> <allow> <convert match="com.leruan.aasimp.entity.*" converter="bean"> </convert> <create javascript="forumUserService" creator="bean"> <param name="class" value="com.leruan.aasimp.service.impl.ForumUserServiceImpl"/> </create> <create javascript="SendMail" creator="new"> <param name="class" value="com.leruan.aasimp.util.SendMail"/> </create> </allow></dwr> web.xml:<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext.xml</param-value></context-param><listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <servlet><servlet-name>dwr-invoker</servlet-name><servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class><init-param><param-name>debug</param-name><param-value>true</param-value></init-param></servlet><servlet-mapping><servlet-name>dwr-invoker</servlet-name><url-pattern>/dwr/*</url-pattern></servlet-mapping> <filter><filter-name>aasimp</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>aasimp</filter-name><url-pattern>/*</url-pattern></filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app> 报的错是没有关闭标签,可是我检查了下正确的啊,纠结了。上次是没有编译的问题,不知道这次是不是了。。。
解决方案
上次是没有编译的问题,不知道这次是不是了。。。 很有可能 你选择Project--->clean 重新编译下看看
解决方案二:
去class路径下找下dwr.xml看下create节点是不是未关闭,上次未编译,如果这次还是未编译的话,建议你把workspace中的其他无关项目都清理掉,把tomcat下部署的其他项目都清理掉,重新编译该项目,如果还不行,建议你重装eclipse吧
解决方案三:
直接项目发出来算了,反正是毕业设计,不存在知识产权问题