把weblogic部署到myeclipse下面,启动weblogic时就会报错:Deployment descriptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'.
这是web.xml的配置出错了,不能用以前这个:
Weblogic配置Servlet中出现的错误
<?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">
</web-app> 这种格式,需要换成:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
然后会出现以下错误
web.xml
The content of element type "servlet" must match "(icon?,servlet-name,display-name?,description?,
(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*)".
解决办法:
按照match后进行排序
servlet-name,display-name?,description?,
(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*