当我将应用程序作为EJB服务部署在JBOSS中时,下面的代码片段可以正常工作。
当我在eclipse中调用与独立程序相同的代码时出现异常。是不是可以在一个简单的java项目上调用它?
AuthenticationServices.getInstance().createSession("abcd");
Caused by: javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled)] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:845) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686) at javax.naming.InitialContext.lookup(InitialContext.java:392) at com.ejb.EjbHomeLoader.getRemoteHome(EjbHomeLoader.java:68) at com.ejb.EjbHomeLoader.getRemoteHome(EjbHomeLoader.java:45) at com.ejb.EjbManager.getEjbHome(EjbManager.java:238) at com.ejb.EjbManager.getEjbObject(EjbManager.java:184) at com.services.BaseServices.executeLocalEjbMethod(BaseServices.java:294) ... 2 more Caused by: java.lang.ClassNotFoundException: org.jboss.ejb.plugins.local.LocalHomeProxy (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:375)
答案 0 :(得分:0)
该课程在JBOSS.jar中,请在课程路径中添加。