您的位置:首页 > 其它

Weblogic8.1配置Servlet中出现的错误及解决办法

2010-05-25 10:46 706 查看
把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*
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: