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