简体   繁体   English

调用ejb方法时出现“ javax.ejb.EJBException:错误解组参数java.io.EOFException”

[英]Got “javax.ejb.EJBException: error unmarshalling arguments java.io.EOFException” when calling an ejb method

I am running an ejb method belongs to a EJB located in weblogic 10.3.6 server. 我正在运行一个ejb方法,该方法属于位于weblogic 10.3.6服务器中的EJB。 This server is located in a Solaris-10 64bit machine. 该服务器位于Solaris-10 64位计算机上。 EJB client is located in Windows XP 32bit machine. EJB客户端位于Windows XP 32位计算机上。

When I am executing this ejb method (inside a junit test case), I get this strange exception. 当我执行这个ejb方法时(在一个junit测试用例中),我得到了这个奇怪的异常。 I googled several times thinking about different reasons, but I am still unable to find a solution for this. 我在Google上搜索了好几次,以考虑不同的原因,但仍然找不到解决方案。

I checked the source code of java.io.DataInputStream and this java.io.DataInputStream.readInt() method throws this exception if this input stream reaches the end before reading four bytes. 我检查了java.io.DataInputStream的源代码,并且如果此输入流在读取四个字节之前到达末尾,则此java.io.DataInputStream.readInt()方法将引发此异常。

Does any of you have an idea about this issue? 你们中有人对这个问题有想法吗? thanks in advance. 提前致谢。

javax.ejb.EJBException: error unmarshalling arguments; nested exception is: 
    java.io.EOFException; nested exception is: java.io.EOFException
java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:375)
    at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2775)
    at java.io.ObjectInputStream.readInt(ObjectInputStream.java:949)
    at com.company.product.ClassDomain.readExternal(ClassDomain.java:356)
    at com.company.product.ClassDomainChild.readExternal(ClassDomainChild.java:129)
    at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
    at com.company.product.ProductFacadeSessionBeanWithAffinity_c8b15i_ProductFacadeSessionRemoteWithAffinityImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
javax.ejb.EJBException: error unmarshalling arguments; nested exception is: 
    java.io.EOFException; nested exception is: java.io.EOFException
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:121)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:96)
    at $Proxy7.createApplicationInstance(Unknown Source)
    at tools.actions.InitTest_CreateDomain.performInit(InitTest_CreateDomain.java:94)
    at com.company.tools.TestUtils.registerInitAction(TestUtils.java:114)
    at com.company.tools.TestUtils.createDomain(TestUtils.java:607)
    at com.company.product.test.Provisioner.provisionProfiles(Provisioner.java:388)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
    at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
    at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
    at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:375)
    at java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:2775)
    at java.io.ObjectInputStream.readInt(ObjectInputStream.java:949)
    at com.company.product.ClassDomain.readExternal(ClassDomain.java:356)
    at com.company.product.ClassDomainChild.readExternal(ClassDomainChild.java:129)
    at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
    at com.company.product.ProductFacadeSessionBeanWithAffinity_c8b15i_ProductFacadeSessionRemoteWithAffinityImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:

221) 221)

The reason for this problem was, my Eclipse IDE was using an old version of the api.jar file from its cache. 出现此问题的原因是,我的Eclipse IDE正在使用其缓存中的api.jar文件的旧版本。 :/ :/

Since the problem occur in a readExternal method, you have probably a matching writeExternal method. 由于问题发生在readExternal方法中,因此您可能具有匹配的writeExternal方法。

You should check the writeExternal to see if you are writing the same amount of stuff than you are trying to read. 您应该检查writeExternal以查看您编写的内容是否与尝试读取的内容相同。 It may lack a writeInt() call. 它可能缺少writeInt()调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM