Announcement Announcement Module
Collapse
No announcement yet.
org.springframework.integration.MessagingException : failed to transform File Message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.integration.MessagingException : failed to transform File Message

    I am new to spring integration and have build a small application which will poll for files from a file_share location and do processing. Files are copied from different locations to this file_share location.
    It ran perfectly file when a small size(1KB) file is copied to the file_share location.But unfortunately, when i ran the application and copied a big file(2.3 MB). It gives me the following exception:

    2011-12-16 03:18:50,143 [task-scheduler-3] ERROR org.springframework.integration.handler.LoggingHan dler - org.springframework.integration.transformer.Messag eTransformationException: org.springframework.integration.MessagingException : failed to transform File Message
    at org.springframework.integration.transformer.Messag eTransformingHandler.handleRequestMessage(MessageT ransformingHandler.java:73)
    at org.springframework.integration.handler.AbstractRe plyProducingMessageHandler.handleMessageInternal(A bstractReplyProducingMessageHandler.java:98)
    at org.springframework.integration.handler.AbstractMe ssageHandler.handleMessage(AbstractMessageHandler. java:78)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:61)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:128)
    at org.springframework.integration.core.MessagingTemp late.doSend(MessagingTemplate.java:288)
    at org.springframework.integration.core.MessagingTemp late.send(MessagingTemplate.java:149)
    at org.springframework.integration.endpoint.SourcePol lingChannelAdapter.doPoll(SourcePollingChannelAdap ter.java:94)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :146)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call(AbstractPollingEndpoint.java :144)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$1.run(AbstractPollingEndpoin t.java:207)
    at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 52)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
    at org.springframework.integration.util.ErrorHandling TaskExecutor.execute(ErrorHandlingTaskExecutor.jav a:49)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:202)
    at org.springframework.scheduling.support.DelegatingE rrorHandlingRunnable.run(DelegatingErrorHandlingRu nnable.java:51)
    at org.springframework.scheduling.concurrent.Reschedu lingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unkn own Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.integration.MessagingException : failed to transform File Message
    at org.springframework.integration.file.transformer.A bstractFilePayloadTransformer.transform(AbstractFi lePayloadTransformer.java:71)
    at org.springframework.integration.transformer.Messag eTransformingHandler.handleRequestMessage(MessageT ransformingHandler.java:67)
    ... 27 more
    Caused by: java.io.FileNotFoundException: P:\test\File_Share\message1.processed (The process cannot access the file because it is being used by another process)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.springframework.integration.file.transformer.F ileToStringTransformer.transformFile(FileToStringT ransformer.java:48)
    at org.springframework.integration.file.transformer.F ileToStringTransformer.transformFile(FileToStringT ransformer.java:32)
    at org.springframework.integration.file.transformer.A bstractFilePayloadTransformer.transform(AbstractFi lePayloadTransformer.java:58)
    ... 28 more

    My app-context.xml entries are as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:int="http://www.springframework.org/schema/integration"
    xmlns:stream="http://www.springframework.org/schema/integration/stream"
    xmlns:file="http://www.springframework.org/schema/integration/file"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schem...ontext-2.5.xsd
    http://www.springframework.org/schema/integration
    http://www.springframework.org/schem...ration-2.0.xsd
    http://www.springframework.org/schem...gration/stream
    http://www.springframework.org/schem...stream-1.0.xsd
    http://www.springframework.org/schema/integration/file
    http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd">

    <channel id="message.inbound" />
    <channel id="message.outbound" />

    <file:inbound-channel-adapter id="mfInputFileProcessor"
    directory="file:${input.directory}" filename-pattern="message*">
    <poller id="mfInputPoller" fixed-delay="1" />
    </file:inbound-channel-adapter>

    <file:file-to-string-transformer
    input-channel="mfInputFileProcessor"
    output-channel="mfInputFileParser" charset="UTF-8"
    delete-files="false" />

    <splitter input-channel="mfInputFileParser" ref="mFileHandler"
    method="extractLines" output-channel="message.inbound" />

    <beans:bean id="mFileHandler"
    class="com.test.app.book.bookFileAdaptor.Utilities .FileHandler" />

    <beans:bean id="printBudeMessage"
    class="com.test.app.book.bookFileAdaptor.bookTrans formerTest" />

    <splitter input-channel="message.inbound" ref="printBudeMessage"
    method="printLine" output-channel="message.outbound" />

    </beans:beans>

    Please help me to overcome from this issue.
Working...
X