2016-08-03 83 views
0

我使用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。 當我刪除閥 - 錯誤消失。但我需要它。 請幫幫我。

回答

0

艾倫,

你應該使用,因爲這件被首次引入到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> 
相關問題