[英]NameNotFoundException when calling a EJB in Weblogic 10.3
[英]ClassNotFoundException when calling EJB running on weblogic 10.3 from app running on weblogic 10.0
我有一個在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實例)沒有任何意義。
知道導致異常的原因是什么?
更新:如果將wlclient.jar從weblogic 10.3復制到在weblogic 10.0上運行的域的庫,則調用可以正常工作,但這不是一個好的解決方案,並且我不理解為什么它依賴於weblogic類。
顯然,這是一個罐子問題。 請驗證類路徑引用的所有位置,並確保兩次都不存在任何jar文件,並確保在類路徑中包含weblogic.ejb.spi.BusinessObjec的jar文件。
希望這可以幫助 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.