Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
[MULE-4245] java.io.NotSerializableException: java.io.FileInputStream with <queue-profile persistent="true"/> Created: 09/Mar/09 Updated: 18/Jun/09 Resolved: 18/Jun/09 Status: Project: Component/s: Affects Version/s: Fix Version/s: Closed Mule Transport: File 2.2 Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Environment: Bug Puneet Gupta Fixed None Not Specified Attachments: Issue Links: 2.1.4 (EE only), 3.0.0-M1, 2.2.2 (EE only) Priority: Assignee: Votes: Critical Dirk Olmes 0 Not Specified Not Specified Standalone FileContentsMessageAdapter.java file-functional-config.xml Related relates to MULE-3534 Review serialization of objects that ... Closed High User impact: Similar Issues: Fix Release Date: 2/Jun/09 Description If you use the file transport and have streaming=false, synchronous= false and <queue-profile persistent="true"/> inbound endpoint throw the below error: The problem is with FileContentsMessageAdapter (line 59) which creates a new fileInputStream to convert the f byte[] but does not clear the reference to fileInputStream after closing the stream. As a result when FileContentsMessageAdapter is serailsed the reference to fileInputStream throws NotSerializableException exce The modified working code is attached. ******************************************************************************** Exception stack is: 1. java.io.FileInputStream (java.io.NotSerializableException) java.io.ObjectOutputStream:1081 (http://java.sun.com/j2se/1.5.0/docs/api/java/io/NotSerializableException.htm 2. java.io.NotSerializableException: java.io.FileInputStream (java.lang.RuntimeException) org.mule.util.queue.TransactionalQueueSession$QueueImpl:91 (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/RuntimeException.html) 3. Interrupted while queue event for "ReceiveHL7". Component that caused exception is: ReceiveHL7. Message type: byte[] (org.mule.FailedToQueueEventException) org.mule.model.seda.SedaService:207 (http://www.mulesource.org/docs/site/current2/apidocs/org/mule/FailedToQueueEventException.html) ******************************************************************************** Root Exception stack trace: java.io.NotSerializableException: java.io.FileInputStream at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:416) at org.mule.DefaultMuleEvent.writeObject(DefaultMuleEvent.java:590) 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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) at org.mule.util.queue.FilePersistenceStrategy.store(FilePersistenceStrategy.java:75) at org.mule.util.queue.TransactionalQueueManager.doStore(TransactionalQueueManager.java:237) at org.mule.util.queue.TransactionalQueueSession$QueueImpl.offer(TransactionalQueueSession.java:70) at org.mule.util.queue.TransactionalQueueSession$QueueImpl.put(TransactionalQueueSession.java:56) at org.mule.model.seda.SedaService.enqueue(SedaService.java:419) at org.mule.model.seda.SedaService.doDispatch(SedaService.java:224) at org.mule.service.AbstractService.dispatchEvent(AbstractService.java:475) at org.mule.DefaultMuleSession.dispatchEvent(DefaultMuleSession.java:274) at org.mule.routing.inbound.DefaultInboundRouterCollection.dispatch(DefaultInboundRouterCollection.java:22 at org.mule.routing.inbound.DefaultInboundRouterCollection.route(DefaultInboundRouterCollection.java:192) at org.mule.transport.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageRec at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:252) at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:175) at org.mule.transport.file.FileMessageReceiver.moveAndDelete(FileMessageReceiver.java:281) at org.mule.transport.file.FileMessageReceiver.processFile(FileMessageReceiver.java:238) at org.mule.transport.file.FileMessageReceiver.poll(FileMessageReceiver.java:144) at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:47) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:10 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:5 at java.lang.Thread.run(Thread.java:619) ******************************************************************************** Comments Comment by Puneet Gupta [ 09/Mar/09 ] The modified code is attached. Comment by Dirk Olmes [ 05/May/09 ] 2.2.x: http://fisheye.codehaus.org/changelog/mule/?cs=14603 3.x: http://fisheye.codehaus.org/changelog/mule/?cs=14604 Comment by Dirk Olmes [ 18/Jun/09 ] backported the fix to 2.1.x: http://fisheye.codehaus.org/changelog/mule/?cs=15014 Generated at Thu May 04 22:46:30 CDT 2017 using JIRA 7.2.4#72006sha1:91606a849e49df24789f9d9a6614de45c98c37a8.