当前位置: 首页 > 知识库问答 >
问题:

从另一个JBoss AS 7实例调用部署在Wildfly 8实例上的EJB

司空默
2023-03-14

首先对我糟糕的英文写作表示歉意!

我在Wildfly 8上部署了我的EJB bean并在Wildfly 8中调用它没有任何问题。但是当我将客户端服务器从Wildfly 8更改为Jboss AS 7时,我得到“没有ejb接收器错误”。

Wildfly 8服务器端运行输出:

./standalone.sh -b 0.0.0.0 -Djboss.socket.binding.port-offset=100 -Djboss.node.name=nodeA

输出日志:

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/amin/Programs/AS/server/wildfly-8.0.0.Final

  JAVA: /home/amin/Programs/jdk1.7.0_67/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true

=========================================================================

14:51:58,251 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final
14:51:58,645 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Final
14:51:58,754 INFO  [org.jboss.as] (MSC service thread 1-2) JBAS015899: WildFly 8.0.0.Final "WildFly" starting
14:52:00,083 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) JBAS014627: Attribute any-ipv4-address is deprecated, and it might be removed in future version!
14:52:00,168 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found currency-ear.ear in deployment directory. To trigger deployment create a file called currency-ear.ear.dodeploy
14:52:00,197 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
14:52:00,218 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.2.0.Final
14:52:00,232 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.2.0.Final
14:52:00,289 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 33) JBAS010280: Activating Infinispan subsystem.
14:52:00,310 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 28) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
14:52:00,331 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 39) JBAS012615: Activated the following JSF Implementations: [main]
14:52:00,368 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 46) JBAS013171: Activating Security Subsystem
14:52:00,375 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.0.Final
14:52:00,400 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 41) JBAS011800: Activating Naming Subsystem
14:52:00,425 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013170: Current PicketBox version=4.0.20.Final
14:52:00,431 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 50) JBAS015537: Activating WebServices Extension
14:52:00,511 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.3.Final)
14:52:00,561 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2
14:52:00,601 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service
14:52:00,614 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017502: Undertow 1.0.0.Final starting
14:52:00,615 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 49) JBAS017502: Undertow 1.0.0.Final starting
14:52:00,620 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
14:52:00,816 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 49) JBAS017527: Creating file handler for path /home/amin/Programs/AS/server/wildfly-8.0.0.Final/welcome-content
14:52:00,836 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017525: Started server default-server.
14:52:00,840 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017531: Host default-host starting
14:52:01,043 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017519: Undertow HTTP listener default listening on /0.0.0.0:8180
14:52:01,429 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
14:52:01,485 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory /home/amin/Programs/AS/server/wildfly-8.0.0.Final/standalone/deployments
14:52:01,496 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "ojdbc7-12.1.0.1.0.jar" (runtime-name: "ojdbc7-12.1.0.1.0.jar")
14:52:01,497 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "currency-ear.ear" (runtime-name: "currency-ear.ear")
14:52:02,474 INFO  [org.jboss.ws.common.management] (MSC service thread 1-4) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final
14:52:03,704 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 12.1)
14:52:03,797 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010417: Started Driver service with driver-name = ojdbc7-12.1.0.1.0.jar
14:52:03,801 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/currencyDS]
14:52:04,402 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "null" (runtime-name: "currency-ejb.jar")
14:52:04,402 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "null" (runtime-name: "currency-web.war")
14:52:04,605 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for currencyexchange
14:52:04,739 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/currencyDS]
14:52:04,756 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment currency-ear.ear
14:52:04,757 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 52) JBAS011402: Starting Persistence Unit Service 'currency-ear.ear/currency-ejb.jar#currencyexchange'
14:52:04,903 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.0.3.Final
14:52:05,151 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment currency-web.war
14:52:05,391 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.385--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The access type for the persistent class [class ir.jnf.currency.model.currencylog.CurrencyLog] is set to [FIELD].
14:52:05,428 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.427--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The target entity (reference) class for the many to one mapping element [field currency] is being defaulted to: class ir.jnf.currency.model.currency.Currency.
14:52:05,429 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.429--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The access type for the persistent class [class ir.jnf.currency.model.currency.Currency] is set to [FIELD].
14:52:05,442 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.442--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The target entity (reference) class for the one to many mapping element [field currencyLogs] is being defaulted to: class ir.jnf.currency.model.currencylog.CurrencyLog.
14:52:05,444 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.444--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The alias name for the entity class [class ir.jnf.currency.model.currencylog.CurrencyLog] is being defaulted to: CurrencyLog.
14:52:05,468 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.468--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [price] is being defaulted to: PRICE.
14:52:05,469 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.469--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [curlogid] is being defaulted to: CURLOGID.
14:52:05,470 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.469--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [curlogdate] is being defaulted to: CURLOGDATE.
14:52:05,471 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.47--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The alias name for the entity class [class ir.jnf.currency.model.currency.Currency] is being defaulted to: Currency.
14:52:05,471 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.471--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The table name for entity [class ir.jnf.currency.model.currency.Currency] is being defaulted to: CURRENCY.
14:52:05,472 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.472--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [cursymbol] is being defaulted to: CURSYMBOL.
14:52:05,472 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.472--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [price] is being defaulted to: PRICE.
14:52:05,473 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.473--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The column name for element [curiso] is being defaulted to: CURISO.
14:52:05,491 INFO  [stdout] (ServerService Thread Pool -- 52) [EL Config]: 2014-10-29 14:52:05.49--ServerSession(612909935)--Thread(Thread[ServerService Thread Pool -- 52,5,ServerService ThreadGroup])--The primary key column name for the mapping element [field currency] is being defaulted to: CURISO.
14:52:05,662 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment currency-ejb.jar
14:52:05,665 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CurrencyDAO in deployment unit subdeployment "currency-ejb.jar" of deployment "currency-ear.ear" are as follows:

    java:global/currency-ear/currency-ejb/CurrencyDAO!ir.jnf.currency.dao.currency.CurrencyDAOLocal
    java:app/currency-ejb/CurrencyDAO!ir.jnf.currency.dao.currency.CurrencyDAOLocal
    java:module/CurrencyDAO!ir.jnf.currency.dao.currency.CurrencyDAOLocal
    java:global/currency-ear/currency-ejb/CurrencyDAO
    java:app/currency-ejb/CurrencyDAO
    java:module/CurrencyDAO

14:52:05,665 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CurrencyLogDAO in deployment unit subdeployment "currency-ejb.jar" of deployment "currency-ear.ear" are as follows:

    java:global/currency-ear/currency-ejb/CurrencyLogDAO!ir.jnf.currency.dao.currencylog.CurrencyLogDAOLocal
    java:app/currency-ejb/CurrencyLogDAO!ir.jnf.currency.dao.currencylog.CurrencyLogDAOLocal
    java:module/CurrencyLogDAO!ir.jnf.currency.dao.currencylog.CurrencyLogDAOLocal
    java:global/currency-ear/currency-ejb/CurrencyLogDAO
    java:app/currency-ejb/CurrencyLogDAO
    java:module/CurrencyLogDAO

14:52:05,666 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CurrencyLogService in deployment unit subdeployment "currency-ejb.jar" of deployment "currency-ear.ear" are as follows:

    java:global/currency-ear/currency-ejb/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceLocal
    java:app/currency-ejb/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceLocal
    java:module/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceLocal
    java:global/currency-ear/currency-ejb/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceRemote
    java:app/currency-ejb/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceRemote
    java:module/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceRemote
    java:jboss/exported/currency-ear/currency-ejb/CurrencyLogService!ir.jnf.currency.service.currencylog.CurrencyLogServiceRemote

14:52:05,667 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CurrencyService in deployment unit subdeployment "currency-ejb.jar" of deployment "currency-ear.ear" are as follows:

    java:global/currency-ear/currency-ejb/CurrencyService!ir.jnf.currency.service.currency.CurrencyServiceLocal
    java:app/currency-ejb/CurrencyService!ir.jnf.currency.service.currency.CurrencyServiceLocal
    java:module/CurrencyService!ir.jnf.currency.service.currency.CurrencyServiceLocal
    java:global/currency-ear/currency-ejb/CurrencyService
    java:app/currency-ejb/CurrencyService
    java:module/CurrencyService

14:52:05,703 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 12.1)
14:52:05,704 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: currency-ear.ear
14:52:05,737 INFO  [org.jboss.weld.Version] (MSC service thread 1-4) WELD-000900: 2.1.2 (Final)
14:52:05,782 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = currency-ear.ear_oracle.jdbc.OracleDriver_12_1
14:52:05,783 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment currency-ear.ear
14:52:07,320 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.2.5-jbossorg-3 20140128-1641 for context '/currency-web'
14:52:08,935 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /currency-web
14:52:09,046 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "ojdbc7-12.1.0.1.0.jar" (runtime-name : "ojdbc7-12.1.0.1.0.jar")
14:52:09,047 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "currency-ear.ear" (runtime-name : "currency-ear.ear")
14:52:09,175 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:10090/management
14:52:09,175 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:10090
14:52:09,176 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Final "WildFly" started in 11254ms - Started 524 of 595 services (115 services are lazy, passive or on-demand)

Jboss客户端配置:我在Wildfly 8服务器端创建一个应用程序用户,并将密码转换为base 64并将其放在jboss客户端standalone.xml:

    <security-realms>
        <security-realm name="ejb-security-realm">
            <server-identities>
                <secret value="YWRtaW4y"/>
            </server-identities>
        </security-realm>

我添加了出站连接:

    <subsystem xmlns="urn:jboss:domain:remoting:1.1">
        <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
        <outbound-connections>
            <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="admin" security-realm="ejb-security-realm">
                <properties>
                    <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
                    <property name="SSL_ENABLED" value="false"/>
                </properties>
            </remote-outbound-connection>
        </outbound-connections>

和出站套接字绑定:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
    <socket-binding name="ajp" port="8009"/>
    <socket-binding name="http" port="8080"/>
    <socket-binding name="https" port="8443"/>
    <socket-binding name="osgi-http" interface="management" port="8090"/>
    <socket-binding name="remoting" port="4447"/>
    <socket-binding name="txn-recovery-environment" port="4712"/>
    <socket-binding name="txn-status-manager" port="4713"/>
    <outbound-socket-binding name="mail-smtp">
        <remote-destination host="localhost" port="25"/>
    </outbound-socket-binding>
    <outbound-socket-binding name="remote-ejb">
        <remote-destination host="localhost" port="8180"/>
    </outbound-socket-binding>
</socket-binding-group>

我创建了JBossEJB客户端。xml并将其放在客户端JSP项目META-INF上:

<jboss-ejb-client xmlns="urn:jboss:ejb-client:1.0">
    <client-context>
        <ejb-receivers>
            <remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection"/>
        </ejb-receivers>
    </client-context>
</jboss-ejb-client>

将客户端Jboss作为7运行:

./standalone.sh-Djboss.node.name=nodeB =========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /home/amin/Programs/AS/client/jboss-as-7.1.1.Final

  JAVA: /home/amin/Programs/jdk1.7.0_67/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

15:08:26,841 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
15:08:27,006 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
15:08:27,056 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
15:08:27,892 INFO  [org.xnio] XNIO Version 3.0.3.GA
15:08:27,899 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
15:08:27,906 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
15:08:27,926 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
15:08:27,985 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
15:08:28,002 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
15:08:28,049 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
15:08:28,111 INFO  [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
15:08:28,120 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
15:08:28,128 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
15:08:28,135 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
15:08:28,142 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
15:08:28,177 INFO  [org.jboss.as.security] (MSC service thread 1-4) JBAS013100: Current PicketBox version=4.0.7.Final
15:08:28,212 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
15:08:28,263 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service
15:08:28,265 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
15:08:28,464 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.2.GA
15:08:28,561 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
15:08:28,842 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447
15:08:28,843 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /127.0.0.1:9999
15:08:28,883 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory /home/amin/Programs/AS/client/jboss-as-7.1.1.Final/standalone/deployments
15:08:28,888 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found currencyJspClient.war in deployment directory. To trigger deployment create a file called currencyJspClient.war.dodeploy
15:08:28,954 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
15:08:28,994 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "currencyJspClient.war"
15:08:35,796 INFO  [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /currencyJspClient
15:08:35,813 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015951: Admin console listening on http://127.0.0.1:9990
15:08:35,813 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 9189ms - Started 174 of 254 services (79 services are passive or on-demand)
15:08:35,925 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "currencyJspClient.war"

当我转到以下链接时:

http://localhost:8080/currencyJspClient/

我有这个错误:

15:10:37,868 INFO  [org.jboss.ejb.client] (http--127.0.0.1-8080-1) JBoss EJB Client version 1.0.5.Final
15:10:42,877 ERROR [stderr] (http--127.0.0.1-8080-1) java.lang.IllegalStateException: No EJB receiver available for handling [appName:currency-ear,modulename:currency-ejb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@36ae4b6f
15:10:42,878 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
15:10:42,880 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
15:10:42,881 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
15:10:42,882 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
15:10:42,883 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
15:10:42,884 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
15:10:42,885 ERROR [stderr] (http--127.0.0.1-8080-1)    at com.sun.proxy.$Proxy10.currencyLogFindAllRemote(Unknown Source)
15:10:42,886 ERROR [stderr] (http--127.0.0.1-8080-1)    at currencyJspClient.Farakhani.farakh(Farakhani.java:25)
15:10:42,886 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.jsp.index_jsp._jspService(index_jsp.java:67)
15:10:42,887 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
15:10:42,888 ERROR [stderr] (http--127.0.0.1-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
15:10:42,889 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
15:10:42,890 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
15:10:42,890 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
15:10:42,891 ERROR [stderr] (http--127.0.0.1-8080-1)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
15:10:42,892 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
15:10:42,892 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
15:10:42,893 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
15:10:42,893 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
15:10:42,894 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
15:10:42,894 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
15:10:42,896 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
15:10:42,897 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
15:10:42,897 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
15:10:42,904 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
15:10:42,904 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
15:10:42,904 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
15:10:42,905 ERROR [stderr] (http--127.0.0.1-8080-1)    at java.lang.Thread.run(Thread.java:745)

我还将Wildfly 8客户端库添加到lib文件夹

这是我的jsp客户端应用程序部署的war文件树:

├── index.jsp
├── META-INF
│   ├── jboss-ejb-client.xml
│   └── MANIFEST.MF
└── WEB-INF
    ├── classes
    │   ├── currencyJspClient
    │   │   └── Farakhani.class
    │   ├── ir
    │   │   └── jnf
    │   │       └── currency
    │   │           ├── model
    │   │           │   ├── currency
    │   │           │   │   └── Currency.class
    │   │           │   └── currencylog
    │   │           │       └── CurrencyLog.class
    │   │           └── service
    │   │               └── currencylog
    │   │                   └── CurrencyLogServiceRemote.class
    │   └── main
    │       └── Main.class
    └── lib
        ├── eclipselink-2.5.0.jar
        ├── javax.persistence-2.1.0.jar
        ├── jboss-client.jar
        └── jboss-ejb-api_3.1_spec-1.0.2.Final.jar

感谢在adnvance。

共有2个答案

屠锐
2023-03-14

当然,您可以调用部署在JBoss EAP 6中的远程ejb。x/AS 7,即使您的客户端部署在Wildfly实例中。

由于JBoss AS 7/EAP 6. x使用Remote作为其远程协议,因此您可以在Wildfly实例远程出站连接属性中添加协议="远程"属性。

<remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="admin" security-realm="ejb-security-realm" protocol="remote">
    <properties>
        <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
        <property name="SSL_ENABLED" value="false"/>
    </properties>
</remote-outbound-connection>
张俊茂
2023-03-14

在war部署中,jboss-ejb-client.xml应该放在. war/WEB-INF/文件夹中。

另请参阅来自远程服务器实例的EJB调用

编辑:

经过几次测试,我得出了这些结果。

背景:

  • 在JBoss 7.1.1中运行的Ejb应用程序
  • 在Wildfly 8.1中运行的Ejb Client(Web应用程序)

您是对的,JBossEJB客户端。xml必须放在WEB应用程序的WEB-INF/META-INF文件夹中(文档不正确)。

不可能在启用远程身份验证的情况下调用,远程处理实现之间存在不兼容。这会在身份验证期间产生以下错误:

在客户端服务器中:

Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed

在Ejb服务器中:

TRACE [org.jboss.sasl.digest.server] (Remoting "test-ejb" task-2) Username: ejb
TRACE [org.jboss.sasl.digest.server] (Remoting "test-ejb" task-2) Client negotiated realm: ApplicationRealm
TRACE [org.jboss.sasl.digest.server] (Remoting "test-ejb" task-2) Client negotiated qop: auth
TRACE [org.jboss.sasl.digest.server] (Remoting "test-ejb" task-2) DIGEST87:digest URI: remoting/localhost
TRACE [org.jboss.remoting.remote.server] (Remoting "test-ejb" task-2) Server sending authentication rejected (javax.security.sasl.SaslException: DIGEST-MD5: digest response format violation. Mismatched URI: remoting/localhost; expecting: remote/localhost)

此外:远程EAP 6.3不接受密码,JBoss EAP 6.3客户端无法使用用户名和密码(Digest auth)对旧EAP 6版本进行身份验证。

此问题的解决方法是禁用远程身份验证,您可以这样做,从远程出站连接中删除security-Real="Application ationRealm"属性和username="ejb"andsecurity-Real="ejb-security-Real"属性。

例如:。

服务器:

<subsystem xmlns="urn:jboss:domain:remoting:1.1">
    <connector name="remoting-connector" socket-binding="remoting"/>
</subsystem>

客户端(服务器):

<remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" protocol="remote">
    <properties>
        <property name="SASL_POLICY_NOANONYMOUS" value="false"/>
        <property name="SSL_ENABLED" value="false"/>
    </properties>
</remote-outbound-connection>

或者在两台服务器上使用相同版本的JBoss。如果在JBoss 7.1.1中运行Ejb客户端,则会出现相同的问题

示例应用:https://github.com/fedesierr/remote-ejb-wildfly-jboss7

 类似资料:
  • SRS可以在SRS上作为服务器运行,播放器可以从arm设备上取流播放;arm也可以作为客户端推流到外部srs服务器,使用srs-librtmp库。 编译和搭建ARM环境,详细信息可以参考:SrsLinuxArm,本文举例说明部署的实例步骤。 假设编译为Ubuntu12的IP是:192.168.1.170 假设ARM虚拟设备:1935映射到Ubuntu12的19350端口,22映射到2200端口。即

  • 我正在将Vue与一个名为AEM的CMS进行集成,该CMS基本上可以像Vue一样作为组件基础系统工作。而不是有一个网页和进口的。vue文件,此CMS上的每个组件都是一个新的vue实例(新的vue({…}))。因此,在我的页面上,有许多Veu实例使用同一个存储(vuex)彼此通信。 这实际上工作得很好,但我有一个场景,当我需要一个CMS组件在另一个组件中时。由于这两个组件都是唯一的vue实例,并且父级

  • 我有一个java应用程序,计划在每天晚上的某个时间运行一次。如果满足条件,应用程序将发送电子邮件。所有的调度代码都是用Java编写的,我没有使用亚马逊的任何功能来调度它。此应用程序已部署在EC2实例上,它位于弹性负载平衡器后面。根据负载,可以添加其他节点。我的java应用程序也被复制到其他节点,夜间作业在所有实例上执行。 有没有一种方法可以让单个节点执行这项工作? 谢谢你。

  • RTMP部署的步骤。 假设服务器的IP是:192.168.1.170 第一步,获取SRS。详细参考GIT获取代码 git clone https://github.com/ossrs/srs cd srs/trunk 或者使用git更新已有代码: git pull 第二步,编译SRS。详细参考Build ./configure && make 第三步,编写SRS配置文件。详细参考RT

  • SRS支持HLS的详细步骤。 假设服务器的IP是:192.168.1.170 第一步,获取SRS。详细参考GIT获取代码 git clone https://github.com/ossrs/srs cd srs/trunk 或者使用git更新已有代码: git pull 第二步,编译SRS。详细参考Build ./configure && make 第三步,编写SRS配置文件。详细

  • SRS支持DASH的详细步骤。 假设服务器的IP是:192.168.1.170 第一步,获取SRS。详细参考GIT获取代码 git clone https://github.com/ossrs/srs cd srs/trunk 或者使用git更新已有代码: git pull 第二步,编译SRS。详细参考Build ./configure && make 第三步,编写SRS配置文件。详