Is it prossible to use eclipse java class to call embedded EJB3 into Tomcat?
I knew it's easy for Jboss ejb3 to make it work. But for embedded ejb3 it maybe
can not work.
I try the codes as Jboss EJB3
| final Hashtable<String,String> properties = new Hashtable<String,String>();
|
properties.put("java.naming.factory.initial","org.jnp.interfaces.LocalOnlyContextFactory");
|
properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
| InitialContext ctx = new InitialContext(properties);
| RemoteIntf remote = (RemoteIntf) ctx.lookup(RemoteIntf.class.getName());
| remote.runMethod();
|
It will throw exception when run on InitialContext ctx = new
InitialContext(properties);
The exception is:
| javax.naming.NamingException: Local server is not initialized
| at
org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
| at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
| at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:197)
| at test.Test.main(Test.java:34)
|
Did the error message means not find service? I think every step I do is
correct, but...
Thanks for any reply
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992698#3992698
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992698
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user