ClassNotFoundException:找不到ClassLoaders

时间:2011-01-05 22:42:57

标签: java ejb classloader rmi

我遇到以下异常:

2011-01-05 13:47:51,604 ERROR [STDERR] javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: No ClassLoaders found for: com.client.itemmanager.ItemSessionHome (no security manager: RMI class loader disabled)]
2011-01-05 13:47:51,604 ERROR [STDERR]  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:730)
2011-01-05 13:47:51,604 ERROR [STDERR]  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
2011-01-05 13:47:51,604 ERROR [STDERR]  at javax.naming.InitialContext.lookup(InitialContext.java:351)
2011-01-05 13:47:51,604 ERROR [STDERR]  at com.client.itemmanager.SessionLookupCounter.valueUnbound(SessionLookupCounter.java:45)
2011-01-05 13:47:51,604 ERROR [STDERR]  at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1649)
2011-01-05 13:47:51,604 ERROR [STDERR]  at org.apache.catalina.session.StandardSession.expire(StandardSession.java:756)
2011-01-05 13:47:51,604 ERROR [STDERR]  at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.catalina.connector.Request.isRequestedSessionIdValid(Request.java:2134)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:518)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:443)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:381)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
2011-01-05 13:47:51,605 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:595)
2011-01-05 13:47:51,605 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.client.itemmanager.ItemSessionHome (no security manager: RMI class loader disabled)
2011-01-05 13:47:51,605 ERROR [STDERR]  at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:531)
2011-01-05 13:47:51,605 ERROR [STDERR]  at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
2011-01-05 13:47:51,605 ERROR [STDERR]  at org.jboss.system.JBossRMIClassLoader.loadProxyClass(JBossRMIClassLoader.java:82)
2011-01-05 13:47:51,605 ERROR [STDERR]  at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
2011-01-05 13:47:51,605 ERROR [STDERR]  at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
2011-01-05 13:47:51,605 ERROR [STDERR]  at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
2011-01-05 13:47:51,605 ERROR [STDERR]  at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
2011-01-05 13:47:51,606 ERROR [STDERR]  at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
2011-01-05 13:47:51,606 ERROR [STDERR]  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
2011-01-05 13:47:51,606 ERROR [STDERR]  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
2011-01-05 13:47:51,606 ERROR [STDERR]  at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
2011-01-05 13:47:51,606 ERROR [STDERR]  at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
2011-01-05 13:47:51,606 ERROR [STDERR]  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:654)
2011-01-05 13:47:51,606 ERROR [STDERR]  ... 14 more

我做了一些研究,指出安装这样的RMI安全管理器:

if(System.getSecurityManager() == null) {
     System.setSecurityManager(new RMISecurityManager());
  }

我确实验证了getSecurityManager()返回null,但是如果EJB在远程计算机上,那么不应该只需要它吗? EJB存在于本地。有关可能设置错误的任何建议吗?

0 个答案:

没有答案