我有一个在weblogic 10.3(Java 6)上运行的无状态EJB(3.0)。
我能够使用独立客户端调用EJB而没有任何问题(使用weblogic jar)。我正在使用正确的jndi名称。
当我尝试从运行在weblogic 10.0(Java 5)上的应用程序调用EJB时。我得到以下根异常:
Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:426)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:382)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:367)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.lookup(AbstractRemoteSlsbInvokerInterceptor.java:98)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.getHome(AbstractSlsbInvokerInterceptor.java:159)
at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.create(AbstractSlsbInvokerInterceptor.java:214)
at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.newSessionBeanInstance(AbstractRemoteSlsbInvokerInterceptor.java:221)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.getSessionBeanInstance(SimpleRemoteSlsbInvokerInterceptor.java:141)
at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:97)
... 75 more
Caused by: java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object; nested exception is:
java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:231)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_1001_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:379)
... 89 more
Caused by: java.lang.ClassNotFoundException: weblogic.ejb.spi.BusinessObject: This error could indicate that a component was deployed on a cluster member but not other members of that cluster. Make sure that any component deployed on a server that is part of a cluster is also deployed on all other members of that cluster
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:218)
at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:71)
at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:40)
at weblogic.rjvm.MsgAbbrevInputStream.resolveProxyClass(MsgAbbrevInputStream.java:427)
at weblogic.rjvm.MsgAbbrevInputStream$NestedObjectInputStream.resolveProxyClass(MsgAbbrevInputStream.java:668)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
此错误可能表示组件已部署在集群成员上,但未部署在该集群的其他成员上。确保部署在群集服务器上的任何组件也部署在该群集的所有其他成员上
没有任何涉及的集群(在我的本地计算机上运行两个单独的weblogic实例)没有意义。
知道异常的原因可能是什么?
更新:如果我将weblogic 10.3中的wlclient.jar复制到weblogic 10.0上运行的域的lib,则调用有效,但这不是一个很好的解决方案,我不明白为什么它依赖于weblogic课程。
答案 0 :(得分:0)
显然这是一个jar问题。请验证类路径引用的所有位置,并确保没有两个jar文件存在两次,并确保包含weblogic.ejb.spi.BusinessObjec的jar文件存在于类路径中。
希望这有帮助。