0
jboss-5.0.1 GA를 사용하고 있습니다. JNDI를 사용하여 로컬 EJB에서 원격 JBoss 서버에 배포 된 EJB를 호출하려고합니다.로컬 EJB에서 원격 JNDI 호출을 수행 할 수 없습니다.
로컬 EJB 프로젝트의 클래스 경로에 원격 인터페이스 jar 파일을 포함 시켰습니다. jnp-client.jar, jboss-ejb3-client.jar를 클래스 경로에 추가했습니다.
원격 연결을 허용하는지 확인하기 위해 -b 0.0.0.0 플래그가있는 원격 시스템에서 JBoss를 시작했습니다.
다음은 코드입니다.
SatheBeanRemote sbr = null; //Is the remote interface for the remote bean
Properties p = new Properties();
p.put(Context.PROVIDER_URL, "jnp://10.73.17.76:1099"); //remote Jboss IP
p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
Context context;
try {
context = new InitialContext(p);
sbr = (SatheBeanRemote) context.lookup("RemoteEAR/SatheBean/remote");
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
다음과 같은 예외가 발생합니다.
javax.ejb.EJBException: Unexpected Error
java.lang.NoClassDefFoundError: com/netapp/beans/SatheBeanRemote
at com.netapp.balaji.greeting.GreetingBean.sayGreeting(GreetingBean.java:78)
누구든지 문제를 지적 할 수 있습니까?
이 보이는 문제를 해결할 수 있습니다. 배포를 위해 사용중인 .ear 파일의 구조를 보는 것이 유용 할 것입니다. –