【问题标题】:JBOSS Migration AS6 to EAP 7 404 ErrorJBOSS 迁移 AS6 到 EAP 7 404 错误
【发布时间】:2017-04-03 14:49:44
【问题描述】:

此问题未回答。(标记为假定已回答) 安迪·高迪 新手 安迪·高迪 2017 年 3 月 31 日 06:56 嗨

在 EAP 7 中部署 ear 文件后,我无法引用它。我没有部署错误,但是当我尝试通过 URL 访问 ear /beans 时,出现 404 错误。在现已弃用的 JBOSS.xml 中,URI 的配置如图所示。任何帮助将非常感激。非常感谢安迪

<jboss>
  <enterprise-beans>
  <session>
  <ejb-name>HousingFacadeEJB</ejb-name>
  <jndi-name>HousingFacadeEJB</jndi-name>
  <local-jndi-name>LocalHousingFacadeEJB</local-jndi-name>
  <call-by-value>false</call-by-value>
  <!-- <configuration-name>Facade</configuration-name> -->
  <clustered>false</clustered>
            <port-component>
                <port-component-name>HousingFacade</port-component-name>
                <port-component-uri>HousingFacade/HousingFacadeEJB
                </port-component-uri>
            </port-component>
  </session>
  </enterprise-beans>
  <container-configurations>
  <container-configuration extends="Standard Stateless SessionBean">
      <container-name>HousingFacade</container-name>
  <container-pool-conf>
      <MinimumSize>50</MinimumSize>
  <MaximumSize>150</MaximumSize>
      </container-pool-conf>
  </container-configuration>
  </container-configurations>
</jboss>

----------------------------------------------------------

I have replaced this with a JBOSS-EJB3.xml

<enterprise-beans>
  <session>
   <ejb-name>HousingFacadeEJB2_Live</ejb-name>

   <home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
   <remote>com.comino.cxm.housingfacade.HousingFacade</remote>
   <local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
   <local>com.comino.cxm.housingfacade.LocalHousingFacade</local>

   <ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>

   <session-type>Stateless</session-type>
   <transaction-type>Container</transaction-type>
   <env-entry>
                <env-entry-name>UHDSJNDINAME</env-entry-name>
                  <env-entry-type>java.lang.String</env-entry-type>
                  <env-entry-value>java:/UHTLIVE_2</env-entry-value>
    </env-entry>

  </session>
  </enterprise-beans>

<assembly-descriptor>
  <container-transaction>
           <method>
             <ejb-name>HousingFacadeEJB2_Live</ejb-name>
  <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
        </container-transaction>
</assembly-descriptor>

我的 ejb-jar.xml

<jboss:ejb-jar>

  <enterprise-beans>
   <session>
   <ejb-name>HousingFacadeEJB2_Live</ejb-name>

   <home>com.comino.cxm.housingfacade.HousingFacadeHome</home>
   <remote>com.comino.cxm.housingfacade.HousingFacade</remote>
   <local-home>com.comino.cxm.housingfacade.LocalHousingFacadeHome</local-home>
   <local>com.comino.cxm.housingfacade.LocalHousingFacade</local>

   <ejb-class>com.comino.cxm.housingfacade.HousingFacadeBean</ejb-class>

   <session-type>Stateless</session-type>
   <transaction-type>Container</transaction-type>
   <env-entry>
              <env-entry-name>UHDSJNDINAME</env-entry-name>
              <env-entry-type>java.lang.String</env-entry-type>
              <env-entry-value>java:/UHTLIVE_2</env-entry-value>
    </env-entry>

  </session>
  </enterprise-beans>

  <assembly-descriptor>
  <container-transaction>
           <method>
             <ejb-name>HousingFacadeEJB2_Live</ejb-name>
  <method-name>*</method-name>
           </method>
           <trans-attribute>Required</trans-attribute>
        </container-transaction>
  </assembly-descriptor>

</jboss:ejb-jar>

JBOSS 服务器日志提取.. 我已经编辑了连接地址。

--------------请求------ ---------

URI=/HousingFacade2_Live/HousingFacadeEJB2_Live
characterEncoding=null
     contentLength=1304
       contentType=[text/xml; charset=utf-8]
            header=Connection=Keep-Alive
            header=SOAPAction=""
            header=Cache-Control=no-cache
            header=Content-Type=text/xml; charset=utf-8
            header=Content-Length=1304
            header=User-Agent=W2
            header=Host=**************
            locale=[]
            method=POST
          protocol=HTTP/1.1
       queryString=
        remoteAddr=*************
        remoteHost=************
            scheme=http
              host=*******************
        serverPort=8080
--------------------------RESPONSE--------------------------
     contentLength=74
       contentType=text/html
            header=Connection=keep-alive
            header=X-Powered-By=Undertow/1
            header=Server=JBoss-EAP/7
            header=Content-Length=74
            header=Content-Type=text/html
            header=Date=Fri, 31 Mar 2017 10:31:43 GMT
            status=404
==============================================================

【问题讨论】:

    标签: jboss wildfly


    【解决方案1】:

    【讨论】:

    • 感谢 Anup - 我已经检查了文件并查看了耳朵设置和代码,如图所示进行了轻微调整,但仍然出现 404 错误。我没有使用 maven,也没有 pom 文件。最终哈希表 jndiProperties = new Hashtable(); jndiProperties.put(InitialContext.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");初始上下文 = 新初始上下文(jndiProperties); // initialContext = new InitialContext();缓存 = Collections.synchronizedMap(new HashMap());
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-10
    • 2018-01-31
    • 2021-02-22
    • 2018-09-16
    • 2021-08-26
    • 2017-06-24
    • 1970-01-01
    相关资源
    最近更新 更多