亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JBoss 6.1.0 AS 過濾器在 web.xml 中的位置

JBoss 6.1.0 AS 過濾器在 web.xml 中的位置

波斯汪 2023-03-02 14:55:42
嘗試在 JBoss 6.1.0 中部署 WAR 時顯示以下錯誤DEPLOYMENTS IN ERROR:  Deployment"vfs:///D:/workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1555321418499/deploy/MyProject.war" is in error due to the following reason(s):  org.jboss.xb.binding.JBossXBRuntimeException: filter cannot appear in this position. Expected content of web-app is unordered_sequence: error-page* welcome-file-list? servlet-mapping* login-config? mime-mapping* distributable? session-config? security-role* taglib* security-constraint* context-param* servlet* {all descriptionGroup}? {unordered_sequence jndiEnvironmentRefsGroup}?以下是web.xml文件<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">  <context-param>    <param-name>resteasy.scan</param-name>    <param-value>false</param-value>  </context-param> <filter>    <filter-name>AuthenticationFilter</filter-name>    <filter-class>mypackage.restauthentication.RestAuthenticationFilter</filter-class> </filter> <filter-mapping>    <filter-name>AuthenticationFilter</filter-name>    <url-pattern>/services/*</url-pattern> </filter-mapping> <servlet>    <servlet-name>REST Service</servlet-name>        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>     <init-param>      <param-name>jersey.config.server.provider.packages</param-name>      <param-value>mypackage.restauthentication</param-value>     </init-param>根據錯誤信息, 被<filter>錯誤地放置在web.xml. web-app 的預期內容是 unordered_sequence: error-page* welcome-file-list? servlet 映射 * 登錄配置?mime 映射 * 可分發?會話配置?安全角色* taglib* 安全約束* 上下文參數* servlet* {所有描述組}?{unordered_sequence jndiEnvironmentRefsGroup}?放置相同物品的正確順序是什么?這是一個 Web 存檔,它使用基本身份驗證部署 Jersey REST Web 服務。
查看完整描述

1 回答

?
茅侃侃

TA貢獻1842條經驗 獲得超21個贊

嘗試這個 ..


<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <context-param>

    <param-name>resteasy.scan</param-name>

    <param-value>false</param-value>

  </context-param>

  <servlet>

    <servlet-name>REST Service</servlet-name>

        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>

     <init-param>

      <param-name>jersey.config.server.provider.packages</param-name>

      <param-value>mypackage.restauthentication</param-value>

     </init-param>

   <load-on-startup>1</load-on-startup>

 </servlet>

 <servlet-mapping>

   <servlet-name>REST Service</servlet-name>

   <url-pattern>/service/*</url-pattern>

 </servlet-mapping>

 <filter>

    <filter-name>AuthenticationFilter</filter-name>

    <filter-class>mypackage.restauthentication.RestAuthenticationFilter</filter-class>

 </filter>

 <filter-mapping>

    <filter-name>AuthenticationFilter</filter-name>

    <url-pattern>/services/*</url-pattern>

 </filter-mapping>

</web-app>


查看完整回答
反對 回復 2023-03-02
  • 1 回答
  • 0 關注
  • 123 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號