2016-08-17 88 views
2

我在我的java程序中收到此异常。是否有人有想法? MarshalException: Failed to communicate due to unread block dataMarshalException:由于未读块数据导致通信失败

java.rmi.MarshalException: Failed to communicate. 
    Problem during marshalling/unmarshalling; nested exception is: 
       java.lang.IllegalStateException: unread block data 
com.naresh.product.common.exception.ApplicationException: 
    java.rmi.MarshalException: Failed to communicate. 
    Problem during marshalling/unmarshalling; nested exception is: 
       java.lang.IllegalStateException: unread block data 

    at com.naresh.product.client.library.util.ServerDelegate.search(Unknown Source) 
    at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.refreshDashboard(Unknown Source) 
    at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.access$3(Unknown Source) 
    at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView$7.run(Unknown Source) 
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) 
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) 
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) 
    at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView.refreshDashboard(Unknown Source) 
    at com.naresh.product.client.Product.workflow.form4.ProductForm4DashboardView$5.widgetSelected(Unknown Source) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) 
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) 
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) 
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) 
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) 
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) 
    at com.naresh.product.client.app.Application.start(Unknown Source) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 
    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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408) 

Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is: 
    java.lang.IllegalStateException: unread block data 

    at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:122) 
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:646) 
    at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:122) 
    at org.jboss.remoting.Client.invoke(Client.java:1634) 
    at org.jboss.remoting.Client.invoke(Client.java:548) 
    at org.jboss.invocation.unified.interfaces.UnifiedInvokerProxy.invoke(UnifiedInvokerProxy.java:183) 
    at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365) 
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197) 
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61) 
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70) 
    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112) 
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100) 
    at $Proxy1.search(Unknown Source) 

    ... 34 more 

Caused by: java.lang.IllegalStateException: unread block data 

    at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2376) 
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1360) 
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946) 
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870) 
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752) 
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) 
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) 
    at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:239) 
    at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:133) 
    at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:120) 
    at org.jboss.invocation.unified.marshall.InvocationUnMarshaller.read(InvocationUnMarshaller.java:59) 
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:957) 
    at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:586) 

    ... 45 more 

为什么这个异常正在添加。你们有什么想法解决它吗?

+0

有一个自定义的readObject'()'方法,在它的错误。 – EJP

回答

1

java.io.ObjectInputStream.BlockDataInputStream的Javadoc:

布尔java.io.ObjectInputStream.BlockDataInputStream.setBlockDataMode(布尔newmode)抛出IOException异常

集块数据模式为给定模式(真实==, false == off)和 返回先前的模式值。如果新模式与旧模式 相同,则不采取任何操作。如果块 数据模式正在从打开切换到关闭,而未使用的块数据 仍存在于流中,则抛出IllegalStateException。

但是在你的堆栈跟踪中,问题的起源来自org.jboss.remoting.transport.socket.MicroSocketClientInvoker,它处理一些对象的反序列化。

所以,你可以想象,很难用堆栈跟踪来猜测这个错误的原因。 有一点点运气,你可以有一个确切的答案。 但如果情况并非如此,我建议你一些曲目:

  • 更新或降级JBoss的lib如果可能的版本。也许,这是一个错误。
  • 使用断点运行服务器以发现问题的根源。
  • 问你的问题到JBoss支持
不管你在接收
+0

我试过但遗憾的告知这并不能解决我的问题。我不认为jboss支持团队无法提供任何解决方案。 –

+0

在运行时带有断点,您应该能够输入触发异常的代码。如果jboss支持,lib的拥有者不能帮助你,不要急于在这里得到确切的答案。 – davidxxx

相关问题