모두,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 파일
감사합니다. remote : //를 사용해 보았는데 – VarunKrissh
@ VarKrissh가 도움이 될 수있어서 기뻤습니다. 내 대답을 올바른 사용자로 표시하여 향후 사용자에게 도움이 될 수 있습니까? – VHS