Hallo zusammen,
ich versuche auf EJB 3.0 umzusteigen. Dabei stehe ich vor einem Problem. Der Versuch die Facade eines Session-Beans des bereits deployerten Moduls anzusprechen schlägt fehl. Entsprechender Abschnitt der externen Application (Client):
Code:
Properties env = new Properties();
env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://" + host +":"+port);
Object objref = initial.lookup("ejb/TestFacade");
Der JNDI-Name des SessionBeans steht auch im Deployment-Deskriptor des Moduls, sollte also korrekt sein.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>TestFacadeBean</ejb-name>
<jndi-name>ejb/TestFacade</jndi-name>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
Beim Holen der Facade wird eine Exception ausgeworfen:
Code:
javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at testconnection.Main.main(Main.java:45)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
... 4 more
Weiß jemand ein Rat ? Danke im Voraus.
Lesezeichen