2014-04-04 2 views
1

현재 JBoss 인스턴스는 config 파일로 standalone-ha.xml과 함께 실행됩니다. JBoss 7.1.1 결승전. ClusterTest라는 .ear 안에 ClusterTestEJB라는 .jar 안에 기본 HelloBean을 배치했습니다.JBoss Cluster EJB Remoting

HelloBean은 다음과

package com.sample; 

import javax.ejb.Remote; 
import javax.ejb.Stateless; 

import org.jboss.ejb3.annotation.Clustered; 

@Stateless 
@Clustered 
@Remote 
public class HelloBean implements HelloBeanItf { 
    int counter = 0; 
    public String doSomething() { 
    return "HelloBean Called"; 
    } 
} 

HelloBeanItf가 될 때 :

package com.sample; 

public interface HelloBeanItf { 

    public String doSomething(); 

} 

가 나는 다음과 같은 한 튜토리얼의 코드를 얻었다.

그래서 나는 모든 것이 겉으로보기에 좋았습니다. 나는 지금 자바 클라이언트를 작성하여 해당 EJB를 호출하려고한다. 여기

import java.util.Properties; 

import javax.naming.Context; 
import javax.naming.InitialContext; 
import javax.naming.NamingException; 

import com.sample.HelloBeanItf; 

public class Client { 
    public static void main(String[] args){ 

    Properties p = new Properties(); 
    p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); 
    p.put("jboss.naming.client.ejb.context", true); 
    p.put(Context.SECURITY_PRINCIPAL, "user"); 
    p.put(Context.SECURITY_CREDENTIALS, "password"); 
    p.put(Context.PROVIDER_URL, "remote://mynode:4447"); 

    InitialContext ctx; 
    try { 
     ctx = new InitialContext(p); 
    } catch (NamingException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
     return; 
    } 

    HelloBeanItf ejb = null; 
    try { 
     ejb = (HelloBeanItf) ctx.lookup("java:ClusterTest/ClusterTestEJB//HelloBean!com.sample.HelloBeanItf"); 
    } catch (NamingException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
     return; 
    } 

    for (int ii=0;ii<10;ii++) { 
     ejb.doSomething(); 
    } 
    System.out.println("Terminated"); 
    } 
} 

클라이언트 측 로그 출력됩니다 :

에서, 원격 보안 영역을 제거 사용자 이름과 암호를 제거 : 나는 다음과 같은 시도

Bad level value for property: java.util.logging.ConsoleHandler.level 
Apr 03, 2014 10:49:30 PM org.jboss.logging.LoggerProviders find 
DEBUG: Logging Provider: org.jboss.logging.JDKLoggerProvider 
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory findClientProperties 
DEBUG: Looking for jboss-naming-client.properties using classloader [email protected] 
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties 
DEBUG: jboss.naming.client.endpoint.create.options. has the following options {} 
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties 
DEBUG: jboss.naming.client.remote.connectionprovider.create.options. has the following options {} 
Apr 03, 2014 10:49:30 PM org.xnio.Xnio <clinit> 
INFO: XNIO Version 3.0.3.GA 
Apr 03, 2014 10:49:30 PM org.xnio.nio.NioXnio <clinit> 
INFO: XNIO NIO Implementation Version 3.0.3.GA 
Apr 03, 2014 10:49:30 PM org.jboss.remoting3.EndpointImpl <clinit> 
INFO: JBoss Remoting version 3.2.3.GA 
Apr 03, 2014 10:49:30 PM org.xnio.nio.WorkerThread run 
DEBUG: Started channel thread 'Remoting "config-based-naming-client-endpoint" read-1', selector [email protected] 
Apr 03, 2014 10:49:30 PM org.xnio.nio.WorkerThread run 
DEBUG: Started channel thread 'Remoting "config-based-naming-client-endpoint" write-1', selector [email protected] 
Apr 03, 2014 10:49:30 PM org.jboss.naming.remote.client.InitialContextFactory getOptionMapFromProperties 
DEBUG: jboss.naming.client.connect.options. has the following options {} 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.EJBClientPropertiesLoader loadEJBClientProperties 
DEBUG: Looking for jboss-ejb-client.properties using classloader [email protected] 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector <init> 
DEBUG: EJB client context [email protected] will have no EJB receivers associated with it since there was no EJB client configuration available to create the receivers 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver$1 handleDone 
DEBUG: Channel Channel ID 828f699b (outbound) of Remoting connection 0d818ff0 to node1-w7.wv-lab.mentorg.com/139.181.88.6:4447 opened for context EJBReceiverContext{[email protected], receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} Waiting for version handshake message from server 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage 
INFO: Received server version 1 and marshalling strategies [river] 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate 
INFO: Successful version handshake completed for receiver context EJBReceiverContext{[email protected], receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} on channel Channel ID 828f699b (outbound) of Remoting connection 0d818ff0 to node1-w7.wv-lab.mentorg.com/139.181.88.6:4447 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable 
DEBUG: Received module availability report for 3 modules 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable 
DEBUG: Registering module EJBModuleIdentifier{appName='', moduleName='ClusterWebApp', distinctName=''} availability for receiver context EJBReceiverContext{[email protected], receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable 
DEBUG: Registering module EJBModuleIdentifier{appName='ClusterTest', moduleName='ClusterTest', distinctName=''} availability for receiver context EJBReceiverContext{[email protected], receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver modulesAvailable 
DEBUG: Registering module EJBModuleIdentifier{appName='ClusterTest', moduleName='ClusterTestEJB', distinctName=''} availability for receiver context EJBReceiverContext{[email protected], receiver=Remoting connection EJB receiver [connection=Remoting connection <6981170d>,channel=jboss.ejb,nodename=node1]} 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterNode resolveDestination 
DEBUG: Checking for a match of client address /fe80:0:0:0:0:5efe:ac1e:5010%14 with client mapping ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447} 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterNode resolveDestination 
DEBUG: Client mapping ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447} matches client address /fe80:0:0:0:0:5efe:ac1e:5010%14 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.remoting.ClusterTopologyMessageHandler processMessage 
DEBUG: Received a cluster node(s) addition message, for cluster named ejb with 1 nodes [ClusterNode{clusterName='ejb', nodeName='node1', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447}], resolvedDestination=[Destination address=139.181.88.6, destination port=4447]}] 
Apr 03, 2014 10:49:32 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.remoting3.remote.ClientConnectionOpenListener$Authentication$1 run 
DEBUG: Client authentication failed for mechanism DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Cannot perform callback to acquire realm, authentication ID or password [Caused by javax.security.auth.callback.UnsupportedCallbackException] 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.remoting3.remote.RemoteConnection handleException 
ERROR: JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager getEJBReceiver 
INFO: Could not create a connection for cluster node ClusterNode{clusterName='ejb', nodeName='node1', clientMappings=[ClientMapping{sourceNetworkAddress=/0:0:0:0:0:0:0:0, sourceNetworkMaskBits=0, destinationAddress='139.181.88.6', destinationPort=4447}], resolvedDestination=[Destination address=139.181.88.6, destination port=4447]} in cluster ejb 
java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed 
    at org.jboss.ejb.client.remoting.IoFutureHelper.get(IoFutureHelper.java:91) 
    at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:117) 
    at org.jboss.ejb.client.ClusterContext$EJBReceiverAssociationTask.run(ClusterContext.java:333) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
    at java.util.concurrent.FutureTask.run(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed 
    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:365) 
    at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214) 
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) 
    at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189) 
    at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103) 
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72) 
    at org.xnio.nio.NioHandle.run(NioHandle.java:90) 
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:184) 
    at ...asynchronous invocation...(Unknown Source) 
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270) 
    at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251) 
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349) 
    at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333) 
    at org.jboss.ejb.client.remoting.RemotingConnectionClusterNodeManager.getEJBReceiver(RemotingConnectionClusterNodeManager.java:115) 
    ... 6 more 

Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:33 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Apr 03, 2014 10:49:34 PM org.jboss.ejb.client.EJBClientContext getEJBReceiver 
DEBUG: [email protected] deployment node selector selected node1 node for appname=ClusterTest,modulename=ClusterTestEJB,distinctname= 
Terminated 

여기에 코드입니다. 이 시점에서 무엇을 시도해야할지 모르겠습니다.

첫 번째로 포스터이므로 자세한 내용이 필요하거나 궁금한 점이 있으면 알려주십시오.

도움 주셔서 감사합니다.

답변

1

레코드의 경우 7.1.1에서 업그레이드하여 EJB를 실행할 수 없음이 수정되었습니다. 7.1.3. 업그레이드 후에도 SASL 예외가 계속 발생했지만 EJB가 성공적으로 실행되었습니다.

원격 명명 라이브러리 대신 ejb-client를 사용하고 클러스터링 등록 정보를 추가하여 SASL 예외가 해결되었습니다. 원격 이름 지정은로드 균형 조정을 수행하지 않으므로 스위치가 필자에게 필요했습니다.