Entity Bean 需要实现 Serializable 否则 。。

服务端异常
23:53:29,131 ERROR [org.jboss.as.ejb3] (Remoting “wslhkpc” task-7) JBAS014248: 消息 Channel ID 3367520a (inbound) of Remoting connection 34916e44 to /127.0.0.1:62015 里的频道 org.jboss.remoting3.remote.InboundMessage$3@345c347c 上的异常: java.io.IOException: Stream is closed
at org.xnio.streams.BufferPipeOutputStream.closed(BufferPipeOutputStream.java:62) [xnio-api-3.0.10.GA-redhat-1.jar:3.0.10.GA-redhat-1]
at org.xnio.streams.BufferPipeOutputStream.checkClosed(BufferPipeOutputStream.java:68) [xnio-api-3.0.10.GA-redhat-1.jar:3.0.10.GA-redhat-1]
at org.xnio.streams.BufferPipeOutputStream.write(BufferPipeOutputStream.java:94) [xnio-api-3.0.10.GA-redhat-1.jar:3.0.10.GA-redhat-1]
at org.jboss.remoting3.remote.OutboundMessage.write(OutboundMessage.java:270) [jboss-remoting-3.3.1.Final-redhat-1.jar:3.3.1.Final-redhat-1]
at java.io.DataOutputStream.write(DataOutputStream.java:107) [rt.jar:1.8.0_11]
at org.jboss.as.ejb3.remote.protocol.AbstractMessageHandler$1.write(AbstractMessageHandler.java:217)
at org.jboss.marshalling.OutputStreamByteOutput.write(OutputStreamByteOutput.java:52) [jboss-marshalling-1.4.6.Final-redhat-1.jar:1.4.6.Final-redhat-1]
at org.jboss.marshalling.SimpleDataOutput.shallowFlush(SimpleDataOutput.java:353) [jboss-marshalling-1.4.6.Final-redhat-1.jar:1.4.6.Final-redhat-1]
at org.jboss.marshalling.river.RiverMarshaller.writeString(RiverMarshaller.java:1509)
at org.jboss.marshalling.river.RiverMarshaller.writeNewSerializableClass(RiverMarshaller.java:1415)
at org.jboss.marshalling.river.RiverMarshaller.writeNewClass(RiverMarshaller.java:1345)
at org.jboss.marshalling.river.RiverMarshaller.writeClass(RiverMarshaller.java:1199)
at org.jboss.marshalling.river.RiverMarshaller.writeNewSerializableClass(RiverMarshaller.java:1438)
at org.jboss.marshalling.river.RiverMarshaller.writeSerializableClass(RiverMarshaller.java:1398)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) [jboss-marshalling-1.4.6.Final-redhat-1.jar:1.4.6.Final-redhat-1]
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) [jboss-marshalling-1.4.6.Final-redhat-1.jar:1.4.6.Final-redhat-1]
at org.jboss.as.ejb3.remote.protocol.AbstractMessageHandler.writeException(AbstractMessageHandler.java:112)
at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.processMessage(MethodInvocationMessageHandler.java:166)
at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.handleMessage(VersionOneProtocolChannelReceiver.java:160)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:452) [jboss-remoting-3.3.1.Final-redhat-1.jar:3.3.1.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
Caused by: an exception which occurred:
in object java.io.EOFException@5a234c92

客户端异常
Exception in thread “main” java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:, moduleName:TestEJB, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@69a3d1d
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:735)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)
at org.jboss.ejb.client.EJBClientInvocationContext.retryRequest(EJBClientInvocationContext.java:208)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:256)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:265)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
at com.sun.proxy.$Proxy3.createCabin(Unknown Source)
at client.ClientTest.date(ClientTest.java:155)
at client.ClientTest.main(ClientTest.java:28)

————-
出现原因:Entity Bean 必须实现 Serializable

发表评论