weblogic 上下文查找错误:java.rmi.UnmarshalException:错误解组参数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1361615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 16:15:48  来源:igfitidea点击:

weblogic context lookup error : java.rmi.UnmarshalException: error unmarshalling arguments

javaconnectionweblogicejbunmarshalling

提问by

We are facing an issue in our production env. We have searched the net high and low and we were not able to come up with any answers. This error(stacktrace below) occurs when an ejb lookup is made from managed server 1 to manager server 2. Virtual ip is used for the lookup. It occurs intermittently and at random intervals. We are not able to identify any pattern and If the ejb call is attempted two or three times, it gets through successfully.

我们在生产环境中面临一个问题。我们已经搜索了网络的高低,我们无法想出任何答案。当从托管服务器 1 到管理服务器 2 进行 ejb 查找时会发生此错误(下面的堆栈跟踪)。虚拟 ip 用于查找。它间歇性地和随机地发生。我们无法识别任何模式,如果尝试两次或三次 ejb 调用,它就会成功通过。

Env details : server : weblogic 10.0 MP1 running on java 1.5 os : solaris

环境详细信息:服务器:在 java 1.5 操作系统上运行的 weblogic 10.0 MP1:solaris

Pls revert if any other details are required.

如果需要任何其他详细信息,请回复。

Source used for lookup :

用于查找的源:

private TreControlRemote getController() throws Exception {
    Context context = null;
    Properties p = new Properties();
    TreControlHome treHome = null;
    TreControlRemote remote = null;
    ConfigurationLoader lAppLoader = null;
    try {
        mLog.debug("Entering");
        lAppLoader = PropertiesFileLoader.getInstance("context.properties");
        p.put(Context.INITIAL_CONTEXT_FACTORY, lAppLoader.getValue("INITIAL_CONTEXT_FACTORY"));
        p.put(Context.PROVIDER_URL, lAppLoader.getValue("PROVIDER_URL"));
        context = new InitialContext(p);
        mLog.debug("context : " + context.getEnvironment());
        remote = null;
        treHome = (TreControlHome) context.lookup("CONTROL");
        mLog.debug("Object --->>>>" + treHome);
        remote = (TreControlRemote) treHome.create();
        mLog.debug("Leaving");
    } catch (Exception ex) {
        mLog.fatal("Exception while getting remote", ex);
        ex.printStackTrace();
        throw ex;
    } finally {
        lAppLoader = null;
    }
    return remote;
}

The url is a virtual ip pointing to managed server 2 and it contains a ejb with jndi "CONTROL". The problem is that it successful on certain occassions and fails randomly with the error:

该 url 是一个指向托管服务器 2 的虚拟 ip,它包含一个带有 jndi“CONTROL”的 ejb。问题是它在某些情况下成功并随机失败并出现错误:

stack trace of the error :

错误的堆栈跟踪:

*javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException]
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)
```````````````````````````````````````````````````````````````````
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:221)
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)
... 33 more
Caused by: java.io.StreamCorruptedException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1332)
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)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef.run(BasicServerRef.java:479)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
at weblogic.rmi.internal.BasicServerRef.access0(BasicServerRef.java:59)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
... 2 more*

Obtained the below mentioned stacktrace from the weblogic log. Could this error be related to our problem mentioned above?

从 weblogic 日志中获得了下面提到的堆栈跟踪。这个错误可能与我们上面提到的问题有关吗?

*####<Aug 25, 2009 2:11:04 AM BST> <Info> <RJVM> <pkssv049> <M1AP4> <ACTIVE ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1251162664181> <BEA-000513> <Failure in heartbeat trigger for RJVM: 5433424963141690658S:169.93.73.0:10040,10040,-1,-1,-1,-1,-1:pkssv049.***.net:10240,pkssv049.***.net:10241,pkssv050.***.net:10240,pkssv050.***.net:10241:LIQP1_LMSDomain:M1AP3
java.io.IOException: The connection manager to ConnectionManager for: 'weblogic.rjvm.RJVMImpl@189ed0e - id: '5433424963141690658S:169.93.73.0:10040,10040,-1,-1,-1,-1,-1:pkssv049.***.net:10240,pkssv049.***.net:10241,pkssv050.***.net:10240,pkssv050.***.net:10241:LIQP1_LMSDomain:M1AP3' connect time: 'Mon Aug 24 20:24:02 BST 2009'' has already been shut down.
java.io.IOException: The connection manager to ConnectionManager for: 'weblogic.rjvm.RJVMImpl@189ed0e - id: '5433424963141690658S:169.93.73.0:10040,10040,-1,-1,-1,-1,-1:pkssv049.***.net:10240,pkssv049.***.net:10241,pkssv050.***.net:10240,pkssv050.***.net:10241:LIQP1_LMSDomain:M1AP3' connect time: 'Mon Aug 24 20:24:02 BST 2009'' has already been shut down
at weblogic.rjvm.ConnectionManager.getOutputStream(ConnectionManager.java:1686)
at weblogic.rjvm.ConnectionManager.createHeartbeatMsg(ConnectionManager.java:1629)
at weblogic.rjvm.ConnectionManager.sendHeartbeatMsg(ConnectionManager.java:607)
at weblogic.rjvm.RJVMImpl$HeartbeatChecker.timerExpired(RJVMImpl.java:1540)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)*

Any help would be greatly appreciated.

任何帮助将不胜感激。

Here is some additional info..

这是一些额外的信息..

Is the problem intermittent, or does reproduce every single time? If the problem is intermittent, do you know what conditions it occurs under? It occurs intermittently and we are not able to observe any pattern.

问题是间歇性的,还是每次都会重现?如果问题是间歇性的,你知道它是在什么条件下发生的吗? 它间歇性地发生,我们无法观察到任何模式。

Are there any other errors/warnings logged either on the local server or on the remote server? We see a lot of connection refused errors in the weblogic log

本地服务器或远程服务器上是否记录了任何其他错误/警告? 我们在weblogic日志中看到很多connection denied错误

Are both the managed servers in the same domain? Yes

两个托管服务器是否在同一个域中? 是的

回答by sagar

when you pass an instance of com.myclientcompany.server.eai.interactionspecimpl as argument to your ejb. the weblogic needs to deserialize(unmarshal) the object under the ejb context, and its needs the required class for unmarshalling. so if you include the interactionspecimpl class in your ejb-jar file, then you do not need to include those classes in your servers classpath

当您将 com.myclientcompany.server.eai.interactionspecimpl 的实例作为参数传递给您的 ejb 时。weblogic 需要在 ejb 上下文下反序列化(解组)对象,并且它需要解组所需的类。所以如果你在你的 ejb-jar 文件中包含了interactionspecimpl 类,那么你不需要在你的服务器类路径中包含这些类

回答by Shivam

This issue can occur if you have either a Duplicate entry for or due to a blank space in between.

如果您有重复条目或由于其间有空格,则可能会发生此问题。

You need to check all the configuration files including the JDBC , JMS and the config.xml file to find such and entry.

您需要检查所有配置文件,包括 JDBC 、JMS 和 config.xml 文件以找到此类和条目。

Check if you have left a blank space while entering the JNDI name from the console as well.

检查是否在从控制台输入 JNDI 名称时也留下了空格。

Removing the blank space or removing the duplicate entry resolves this issue.

删除空格或删除重复条目可解决此问题。