1

我有一个在 weblogic 10.3 (Java 6) 上运行的无状态 EJB (3.0)。

我可以毫无问题地使用独立客户端调用 EJB(使用 weblogic jars)。我正在使用正确的 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 实例)。

知道异常的原因可能是什么吗?

更新:如果我将 wlclient.jar 从 weblogic 10.3 复制到在 weblogic 10.0 上运行的域的 lib 中,则调用有效,但这不是一个好的解决方案,我不明白为什么它依赖于 weblogic 类。

4

1 回答 1

0

显然这是一个 jar 问题。请验证类路径引用的所有位置,并确保没有 jar 文件出现两次,并确保包含 weblogic.ejb.spi.BusinessObjec 的 jar 文件存在于类路径中。

希望这可以帮助 。

于 2013-07-25T23:36:28.920 回答