camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lekkie <lekkie.ay...@gmail.com>
Subject Re: TransformerException: Source object passed to ''{0}'' has no contents.
Date Thu, 26 Nov 2009 17:28:43 GMT

I have been able to resolve this. 

Just convert the soap to a streamsource and that shld do. See code below 

<from uri="jms:queue:CollegeRequestQueue" /> 
<convertBodyTo type="javax.xml.transform.stream.StreamSource" /> 
<to uri="nmr:CollegeService" /> 




lekkie wrote:
> 
> I am trying to send a soap request from a JMS queue to service engine (JBI
> in OSGI) and I encountered the ffg errors:
> 
> 23:49:22,484 | ERROR | Service-thread-1 | NMRDestination                  
> | nmr.core.InternalEndpointWrapper   86 | error preparing message
> javax.xml.transform.TransformerException:
> javax.xml.transform.TransformerException: Source object passed to ''{0}''
> has no contents.
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:756)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:349)
> 	at
> org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)
> 	at
> org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113)
> 	at
> org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)
> 	at
> org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)
> 	at org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.xml.transform.TransformerException: Source object passed
> to ''{0}'' has no contents.
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:704)
> 	at
> com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:744)
> 	... 9 more
> 23:49:22,484 | WARN  | Service-thread-1 | NMR                             
> | .servicemix.nmr.core.ChannelImpl  293 | Error processing exchange [
>   id:        92aaefb2-525d-4297-ab09-b0145b5cc8d0
>   mep:       InOnly
>   status:    Active
>   role:      Provider
>   target:    PropertyMatchingReference[{NAME=nauCollegeService}]
>   In: [
>     content: <?xml version="1.0" encoding="UTF-8"?>
> <ser:NotifyPaymentRequest xmlns:ser="http://services.colleges.com">
> <StudentNumber>91283123</StudentNumber>
> <TxnDateTime>20082734</TxnDateTime>
> <PINReceiptNumber>dgf322343</PINReceiptNumber>
> <StudentName>asdasd asds</StudentName>
> <AmountPaid>900</AmountPaid>
> <FeeName>sdfsdfd</FeeName>
> <CollegeSession>sdfdsf</CollegeSession>
> <CollegeSemester>asdsdfs</CollegeSemester>
> <PaymentReferenceNumber>safsdfd</PaymentReferenceNumber>
> <BankName>asfdsad</BankName>
> <BranchName>asdasd</BranchName>
> <CollegeName>asdas</CollegeName>
> </ser:NotifyPaymentRequest>
>     properties: [
>       operationName = <null>
>     ]
>   ]
> ]
> 
> 
> Here is the content of my soap message:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <ser:NotifyPaymentRequest xmlns:ser="http://services.colleges.com">
>    <StudentNumber>91283123</StudentNumber>
>    <TxnDateTime>20082734</TxnDateTime>
>    <PINReceiptNumber>dgf322343</PINReceiptNumber>
>    <StudentName>asdasd asds</StudentName>
>    <AmountPaid>900</AmountPaid>
>    <FeeName>sdfsdfd</FeeName>
>    <CollegeSession>sdfdsf</CollegeSession>
>    <CollegeSemester>asdsdfs</CollegeSemester>
>    <PaymentReferenceNumber>safsdfd</PaymentReferenceNumber>
>    <BankName>asfdsad</BankName>
>    <BranchName>asdasd</BranchName>
>    <CollegeName>asdas</CollegeName>
> </ser:NotifyPaymentRequest>
> 
> 
> Here is my camelContext xml:
> 
> <osgi:camelContext xmlns="http://camel.apache.org/schema/spring">
> 		<route>
> 			<from uri="jms:queue:CollegeRequestQueue" />
> 			<to uri="nmr:CollegeService" />		
> 		</route>
> 	</osgi:camelContext>
> 
> Am I missing something? Do I have to transform the message?
> 

-- 
View this message in context: http://old.nabble.com/TransformerException%3A-Source-object-passed-to-%27%27%7B0%7D%27%27-has-no-contents.-tp26504770p26532642.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message