Eclipse错误。阀门元素类型“jboss-web”的内容必须匹配... jboss-web.xml
问题描述:
我使用eclipse mars.2 我试图导入现有的ecplipse项目,并且出现错误:Eclipse错误。阀门元素类型“jboss-web”的内容必须匹配... jboss-web.xml
The content of element type "jboss-web" must match "(class-loading?,security-domain?,context-root?,virtual-host*,use-session-cookies?,replication-config?,resource-env-ref*,resource-ref*,security-role*,ejb-ref*,ejb-local-ref*,message-destination-ref*,message-destination*,webservice-description*,service-ref*,depends*,servlet*,authenticators*)".
的jboss-web.xml文件
<!DOCTYPE jboss-web PUBLIC
"-//JBoss//DTD Web Application 2.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
<jboss-web>
<security-domain>java:/jaas/SPNEGO</security-domain>
<valve>
<class-name>org.jboss.security.negotiation.NegotiationAuthenticator</class-name>
</valve>
</jboss-web>
我不明白为什么的jboss-web_4_0.dtd不含vavlve。 当我删除阀 - 错误消失。但我需要它。 请帮帮我。
答
艾伦,
你应该使用,因为这件被首次引入到JBoss对于JBoss-web.xml中不同的XML声明AS 7.您的文件使用DTD文件的JBoss AS 4.0.x的;)
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/schema/jbossas
http://www.jboss.org/schema/jbossas/jboss-web_7_0.xsd">
...
</jboss-web>