Vasumathi,

This is probably caused by something consuming a StreamSource or
StaxSource before your service touches it.  To make sure that this is
the cause, could you try enabling DEBUG logging because this should
'solve' the issue then?

Once we are sure that this is the cause of the problem, we should try
to modify the bean method so that it converts the source into a
re-readable source type before actually processing it.  Our
MessageUtil class has a method named enableContentRereadability() that
was created exactly for this purpose.

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/2/5 Vasumathi, Rajamarthandan <[email protected]>:
> Hi All,
>
> I am new to service Mix and JBI. I am getting the below error while
> executing a content enricher EIP. The service Mix version I am using is
> 3.3.1.3. I am using In-Only exchange pattern.
>
>  Overall flow goes like this
>
> JMS BC -> Content Enricher EIP -> Service Unit(Temporarily using a
> Single Service Unit)
>
> Error I am facing
>
> [Fatal Error] :-1:-1: Premature end of file.
> [Fatal Error] :-1:-1: Premature end of file.
> ERROR - EIPComponent                   - Error processing exchange
> InOnly[
>  id: ID:10.102.11.29-11f46231bc3-11:0
>  status: Active
>  role: provider
>  service: {http://test}MyStaticRoutingSlip1Service
>  endpoint: myStaticRoutingSlip1Su
>  operation: {http://test}onMessage
>  in: Unable to display: org.xml.sax.SAXParseException: Premature end of
> file
> ]
> org.xml.sax.SAXParseException: Premature end of file.
>
> Please find the code
>
> JMS BC
> -------
>
> <beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
> xmlns:test="http://test"; xmlns:amq="http://activemq.org/config/1.0";>
>  <jms:endpoint service="test:MyJmsQueueTest" endpoint="jmsQueue"
>  targetService="test:MyStaticRoutingSlip1Service"
> targetEndpoint="myStaticRoutingSlip1Su"
>  role="consumer" destinationStyle="queue"
> jmsProviderDestinationName="myJmsQueueTest"
>  defaultMep="http://www.w3.org/2004/08/wsdl/in-only";
> defaultOperation="test:onMessage"
>  connectionFactory="#connectionFactory">
>  </jms:endpoint>
>  <amq:connectionFactory id="connectionFactory"
>  brokerURL="tcp://localhost:61616" />
> </beans>
>
> Cotent Enricher EIP
> -------------------
> <beans xmlns:eip="http://servicemix.apache.org/eip/1.0";
> xmlns:test="http://test";>
> <eip:content-enricher service="test:MyStaticRoutingSlip1Service"
> endpoint="myStaticRoutingSlip1Su">
>  <eip:enricherTarget>
>    <eip:exchange-target service="test:MyS1PojoService"/>
>  </eip:enricherTarget>
>
> </eip:content-enricher>
> </beans>
>
> Service Unit  - Pojo code
> --------------------------
>
> public void onMessageExchange(MessageExchange exchange)
> {
>  if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
>
>   NormalizedMessage normalizedMessage =null;
>   NormalizedMessage normalizedMessageOut=null;
>   normalizedMessage = exchange.getMessage("in");
>   normalizedMessageOut= exchange.createMessage();
>   String outMessage = processXml(normalizedMessage);
>   normalizedMessageOut.setContent(new StringSource(outMessage));
>   exchange.setMessage(normalizedMessageOut, "out");
>   exchange.setStatus(ExchangeStatus.ACTIVE);
>   channel.send(exchange);
>
>  }
>  }
>
> I am struggling for the past four days with this issue. Please help me
> to solve the issue.
>
> Thanks
> Vasumathi
>
>
>
>
>
>
>
>

Reply via email to