2017-01-26 1 views
1

모두,JBOSS 7.0 - http-remoting 프로토콜을 사용하여 서버에 연결할 수 없음

원격 독립 실행 형 프로그램에서 EJB를 호출하려고합니다. EJB가 JBOSS 7.0에 올바르게 배포되었습니다. 조회를 수행하기 위해 아래 코드를 사용하고 있습니다.

Properties jndiProps = new Properties(); 
     jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); 
     jndiProps.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); 
     jndiProps.put(Context.PROVIDER_URL, "http-remoting://localhost:8080"); 
     jndiProps.put(Context.SECURITY_PRINCIPAL, "user1"); 
     jndiProps.put(Context.SECURITY_CREDENTIALS, "[email protected]?"); 
     jndiProps.put("jboss.naming.client.ejb.context", true); 

     try { 
     Context ctx = new InitialContext(jndiProps); 
     HelloWorld d= (HelloWorld) ctx.lookup("HelloWorldSessionBean/HelloWorldBean!com.ibytecode.business.HelloWorld"); 
//    String s=d.sayHello(); 
//    System.out.println(s); 

     } 
     catch(Exception ne) { 
         ne.printStackTrace(); 
     } 

그러나 아래 예외가 발생하여 더 이상 진행할 수 없습니다. 사람이 제가 놓친 거지 알려 수 :

Failed to connect to any server. Servers tried: [http-remoting://localhost:8080] 
javax.naming.NamingException: Failed to connect to any server. Servers tried: [http-remoting://localhost:8080] 

내 서버가와 내가 독립-full.xml 파일

답변

1

을 사용하고 실행 내가 http-remoting: 프로토콜의 버전에서 사용할 수 없습니다 생각입니다 JBoss (AS 7).

는 또한

jndiProps.put(Context.PROVIDER_URL, "remote://localhost:4447");

jndiProps.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");

에서 제공 URL을 변경하면 클라이언트의 클래스 경로에 필요한 모든 JBoss의 EJB 원격 프로젝트 라이브러리가 있는지 확인

.

+0

감사합니다. remote : //를 사용해 보았는데 – VarunKrissh

+0

@ VarKrissh가 도움이 될 수있어서 기뻤습니다. 내 대답을 올바른 사용자로 표시하여 향후 사용자에게 도움이 될 수 있습니까? – VHS

관련 문제