You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by buzzterrier <te...@gmail.com> on 2009/06/24 01:25:18 UTC

TypConverter

My camel client sends a request to my service:

Future future = camelTemplate.asyncRequestBody(camelURI, searchTerms);


Where searchTerms is a simple pojo SearchTerms that has just string values
to be used for our query on the server.


On the server I get a NoTypeConversionAvailableException on SearchTerms. 

My camel service has the method:

	@Consume(uri = "activemq:queue:bluid:articles")
	public List<String> getArticles(SearchTerms searchTerms) {
...
	}

Is there a way easily convert my searchTerms pojo? I was hoping it would be
like spring were I bind to a command object and cast it. I looked that the
typeconverter examples, and it is not all the clear how I would hand this.



-----
Buzzterrier

http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer... 
-- 
View this message in context: http://www.nabble.com/TypConverter-tp24176269p24176269.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: TypConverter

Posted by buzzterrier <te...@gmail.com>.
Sorry, stupid user trick.

I had the camel context's package tag too narrow on my client. I had had it
looking only at my foo.bar.bluidapi.jms package to use my ServerRoutes impl.
But my pojo was in foo.bar.bluidapi.shared.

When I changed the camel:package to foo.bar.bluidapi it worked.

	<camel:camelContext id="camel">
		<camel:package>foo.bar.bluidapi</camel:package>
	</camel:camelContext>


Thanks for your help. Sorry for the goose chase.


-----
Buzzterrier

http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer... 
-- 
View this message in context: http://www.nabble.com/TypConverter-tp24176269p24189487.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: TypConverter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Thanks. We did some work on the trunk with that type converter thingy. But
let me take a look at it tomorrow. I have started this thread.

I will build an unit test in camel-jms that will send your SearchTerm class
over jms.
To prepare for tomorrow can you post what can help, eg snippets of your
route if, eg how do you send it to the queue?


On Wed, Jun 24, 2009 at 5:54 PM, buzzterrier <te...@gmail.com> wrote:

>
> Here is the stack trace:
>
>  [java] [ultMessageListenerContainer-15] EndpointMessageListener
>    DEBUG Endpoint[activemq:queue:bluid:programs] consumer receiving JMS
> message: ActiveMQObjectMessage {commandId = 8, responseRequired = true,
> messageId = ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination =
> null, originalTransactionId = null, producerId =
> ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
> transactionId = null, expiration = 1245858087436, timestamp =
> 1245858067436,
> arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
> correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
> temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false}
>     [java] [ultMessageListenerContainer-15] EndpointMessageListener WARN
> Endpoint[activemq:queue:bluid:programs] consumer caught an exception while
> processing JMS message: ActiveMQObjectMessage {commandId = 8,
> responseRequired = true, messageId =
> ID:xw-014-2157-1245858065483-0:0:2:1:1,
> originalDestination = null, originalTransactionId = null, producerId =
> ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
> transactionId = null, expiration = 1245858087436, timestamp =
> 1245858067436,
> arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
> correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
> temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false}
>     [java] org.apache.camel.NoTypeConversionAvailableException: No type
> converter available to convert from type:
> org.apache.camel.component.jms.JmsMessage to the required type:
> foo.bar.bluidapi.shared.SearchTerms with value JmsMessage:
> ActiveMQObjectMessage {commandId = 8, responseRequired = true, messageId =
> ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
> transactionId = null, expiration = 1245858087436, timestamp =
> 1245858067436,
> arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
> correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
> temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false}
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:155)
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94)
>     [java]     at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:86)
>     [java]     at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
>     [java]     at
>
> org.apache.camel.builder.ExpressionBuilder$12.evaluate(ExpressionBuilder.java:301)
>     [java]     at
> org.apache.camel.impl.ExpressionSupport.evaluate(ExpressionSupport.java:37)
>     [java]     at
> org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:187)
>     [java]     at
>
> org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:78)
>     [java]     at
>
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:101)
>     [java]     at
>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:101)
>     [java]     at
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
>     [java]     at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
>     [java]     at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
>     [java]     at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
>     [java]     at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
>     [java]     at java.lang.Thread.run(Thread.java:619)
>     [java] [ultMessageListenerContainer-15] efaultMessageListenerContainer
> WARN  Execution of JMS message listener failed
>     [java] org.apache.camel.NoTypeConversionAvailableException: No type
> converter available to convert from type:
> org.apache.camel.component.jms.JmsMessage to the required type:
> foo.bar.bluidapi.shared.SearchTerms with value JmsMessage:
> ActiveMQObjectMessage {commandId = 8, responseRequired = true, messageId =
> ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination = null,
> originalTransactionId = null, producerId =
> ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
> transactionId = null, expiration = 1245858087436, timestamp =
> 1245858067436,
> arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
> correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
> temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
> null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
> null, compressed = false, userID = null, content =
> org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
> dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
> readOnlyProperties = true, readOnlyBody = true, droppable = false}
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:155)
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
>     [java]     at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94)
>     [java]     at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:86)
>     [java]     at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
>     [java]     at
>
> org.apache.camel.builder.ExpressionBuilder$12.evaluate(ExpressionBuilder.java:301)
>     [java]     at
> org.apache.camel.impl.ExpressionSupport.evaluate(ExpressionSupport.java:37)
>     [java]     at
> org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:187)
>     [java]     at
>
> org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:78)
>     [java]     at
>
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:101)
>     [java]     at
>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:101)
>     [java]     at
>
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
>     [java]     at
>
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
>     [java]     at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
>     [java]     at
>
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
>     [java]     at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
>     [java]     at
>
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
>     [java]     at java.lang.Thread.run(Thread.java:619)
>
>
> and the pojo (which is on the classpath) is:
>
> package foo.bar.bluidapi.shared;
>
> import java.io.Serializable;
>
>
> public class SearchTerms implements Serializable{
>        private static final long serialVersionUID = -663051405139476552L;
>        private String  parent;
>        private String  search;
>
>        public SearchTerms(){
>
>        }
>        public SearchTerms(String parent, String search) {
>                this.parent = parent;
>                this.search = search;
>        }
>
>        public String getParent() {
>                return parent;
>        }
>
>        public String getSearch() {
>                return search;
>        }
>
>        public void setParent(String parent) {
>                this.parent = parent;
>        }
>
>        public void setSearch(String search) {
>                this.search = search;
>         }
>
> }
>
> -----
> Buzzterrier
>
> http://buzzterrier.blogspot.com/ View my blog: Ordinary Average
> Developer...
> --
> View this message in context:
> http://www.nabble.com/TypConverter-tp24176269p24187548.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: TypConverter

Posted by buzzterrier <te...@gmail.com>.
Here is the stack trace:  

  [java] [ultMessageListenerContainer-15] EndpointMessageListener        
    DEBUG Endpoint[activemq:queue:bluid:programs] consumer receiving JMS
message: ActiveMQObjectMessage {commandId = 8, responseRequired = true,
messageId = ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination =
null, originalTransactionId = null, producerId =
ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
transactionId = null, expiration = 1245858087436, timestamp = 1245858067436,
arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false}
     [java] [ultMessageListenerContainer-15] EndpointMessageListener WARN 
Endpoint[activemq:queue:bluid:programs] consumer caught an exception while
processing JMS message: ActiveMQObjectMessage {commandId = 8,
responseRequired = true, messageId = ID:xw-014-2157-1245858065483-0:0:2:1:1,
originalDestination = null, originalTransactionId = null, producerId =
ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
transactionId = null, expiration = 1245858087436, timestamp = 1245858067436,
arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false}
     [java] org.apache.camel.NoTypeConversionAvailableException: No type
converter available to convert from type:
org.apache.camel.component.jms.JmsMessage to the required type:
foo.bar.bluidapi.shared.SearchTerms with value JmsMessage:
ActiveMQObjectMessage {commandId = 8, responseRequired = true, messageId =
ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
transactionId = null, expiration = 1245858087436, timestamp = 1245858067436,
arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false}
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:155)
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94)
     [java]     at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:86)
     [java]     at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
     [java]     at
org.apache.camel.builder.ExpressionBuilder$12.evaluate(ExpressionBuilder.java:301)
     [java]     at
org.apache.camel.impl.ExpressionSupport.evaluate(ExpressionSupport.java:37)
     [java]     at
org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:187)
     [java]     at
org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:78)
     [java]     at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:101)
     [java]     at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:101)
     [java]     at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
     [java]     at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
     [java]     at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
     [java]     at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
     [java]     at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
     [java]     at java.lang.Thread.run(Thread.java:619)
     [java] [ultMessageListenerContainer-15] efaultMessageListenerContainer
WARN  Execution of JMS message listener failed
     [java] org.apache.camel.NoTypeConversionAvailableException: No type
converter available to convert from type:
org.apache.camel.component.jms.JmsMessage to the required type:
foo.bar.bluidapi.shared.SearchTerms with value JmsMessage:
ActiveMQObjectMessage {commandId = 8, responseRequired = true, messageId =
ID:xw-014-2157-1245858065483-0:0:2:1:1, originalDestination = null,
originalTransactionId = null, producerId =
ID:xw-014-2157-1245858065483-0:0:2:1, destination = queue://bluid:programs,
transactionId = null, expiration = 1245858087436, timestamp = 1245858067436,
arrival = 0, brokerInTime = 1245858067423, brokerOutTime = 1245858067425,
correlationId = ID-xw-014-2027-1245856921279-2-0, replyTo =
temp-queue://ID:xw-014-2157-1245858065483-0:0:1, persistent = true, type =
null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId =
null, compressed = false, userID = null, content =
org.apache.activemq.util.ByteSequence@22e177, marshalledProperties = null,
dataStructure = null, redeliveryCounter = 0, size = 0, properties = null,
readOnlyProperties = true, readOnlyBody = true, droppable = false}
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.doConvertTo(DefaultTypeConverter.java:155)
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:98)
     [java]     at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:94)
     [java]     at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:86)
     [java]     at
org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:52)
     [java]     at
org.apache.camel.builder.ExpressionBuilder$12.evaluate(ExpressionBuilder.java:301)
     [java]     at
org.apache.camel.impl.ExpressionSupport.evaluate(ExpressionSupport.java:37)
     [java]     at
org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:187)
     [java]     at
org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:78)
     [java]     at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:101)
     [java]     at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:101)
     [java]     at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
     [java]     at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
     [java]     at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
     [java]     at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
     [java]     at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
     [java]     at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
     [java]     at java.lang.Thread.run(Thread.java:619)


and the pojo (which is on the classpath) is:

package foo.bar.bluidapi.shared;

import java.io.Serializable;


public class SearchTerms implements Serializable{
	private static final long serialVersionUID = -663051405139476552L;
	private String	parent;
	private String	search;

	public SearchTerms(){
		
	}
	public SearchTerms(String parent, String search) {
		this.parent = parent;
		this.search = search;
	}

	public String getParent() {
		return parent;
	}

	public String getSearch() {
		return search;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}

	public void setSearch(String search) {
		this.search = search;
	}

}

-----
Buzzterrier

http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer... 
-- 
View this message in context: http://www.nabble.com/TypConverter-tp24176269p24187548.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: TypConverter

Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Could you post the stacktrace?

And also DEBUG log the org.apache.camel.component.jms to see that it pick up
the Object JMS type to send your payload.

And yes you need SearchTerm.class on the classpath on the server side.

And the Camel tracer could also help look into the message as its routed.


On Wed, Jun 24, 2009 at 4:58 AM, buzzterrier <te...@gmail.com> wrote:

>
> Hey,
>
> Thanks for the response. I thought that having the pojo implement
> serializable would be all I needed, but I got the
> NoTypeConversion..Exception, so I thought I needed to use some sort of
> converter. Any ideas on why I would get this with the pojo being
> serializable?
>
>
>
> willem.jiang wrote:
> >
> > Hi,
> >
> > If you are planing to send the SearchTerms object through the JMS
> > transport, you need to let the SeachTerms to implement the Serializable
> > interface.
> >
> > camel-jms will take care rest of the work ;)
> >
> > Willem
> >
> > buzzterrier wrote:
> >> My camel client sends a request to my service:
> >>
> >> Future future = camelTemplate.asyncRequestBody(camelURI, searchTerms);
> >>
> >>
> >> Where searchTerms is a simple pojo SearchTerms that has just string
> >> values
> >> to be used for our query on the server.
> >>
> >>
> >> On the server I get a NoTypeConversionAvailableException on SearchTerms.
> >>
> >> My camel service has the method:
> >>
> >>      @Consume(uri = "activemq:queue:bluid:articles")
> >>      public List<String> getArticles(SearchTerms searchTerms) {
> >> ...
> >>      }
> >>
> >> Is there a way easily convert my searchTerms pojo? I was hoping it would
> >> be
> >> like spring were I bind to a command object and cast it. I looked that
> >> the
> >> typeconverter examples, and it is not all the clear how I would hand
> >> this.
> >>
> >>
> >>
> >> -----
> >> Buzzterrier
> >>
> >> http://buzzterrier.blogspot.com/ View my blog: Ordinary Average
> >> Developer...
> >
> >
> >
>
>
> -----
> Buzzterrier
>
> http://buzzterrier.blogspot.com/ View my blog: Ordinary Average
> Developer...
> --
> View this message in context:
> http://www.nabble.com/TypConverter-tp24176269p24177862.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: TypConverter

Posted by buzzterrier <te...@gmail.com>.
Hey,

Thanks for the response. I thought that having the pojo implement
serializable would be all I needed, but I got the
NoTypeConversion..Exception, so I thought I needed to use some sort of
converter. Any ideas on why I would get this with the pojo being
serializable?



willem.jiang wrote:
> 
> Hi,
> 
> If you are planing to send the SearchTerms object through the JMS
> transport, you need to let the SeachTerms to implement the Serializable
> interface.
> 
> camel-jms will take care rest of the work ;)
> 
> Willem
> 	
> buzzterrier wrote:
>> My camel client sends a request to my service:
>> 
>> Future future = camelTemplate.asyncRequestBody(camelURI, searchTerms);
>> 
>> 
>> Where searchTerms is a simple pojo SearchTerms that has just string
>> values
>> to be used for our query on the server.
>> 
>> 
>> On the server I get a NoTypeConversionAvailableException on SearchTerms. 
>> 
>> My camel service has the method:
>> 
>> 	@Consume(uri = "activemq:queue:bluid:articles")
>> 	public List<String> getArticles(SearchTerms searchTerms) {
>> ...
>> 	}
>> 
>> Is there a way easily convert my searchTerms pojo? I was hoping it would
>> be
>> like spring were I bind to a command object and cast it. I looked that
>> the
>> typeconverter examples, and it is not all the clear how I would hand
>> this.
>> 
>> 
>> 
>> -----
>> Buzzterrier
>> 
>> http://buzzterrier.blogspot.com/ View my blog: Ordinary Average
>> Developer... 
> 
> 
> 


-----
Buzzterrier

http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer... 
-- 
View this message in context: http://www.nabble.com/TypConverter-tp24176269p24177862.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: TypConverter

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

If you are planing to send the SearchTerms object through the JMS
transport, you need to let the SeachTerms to implement the Serializable
interface.

camel-jms will take care rest of the work ;)

Willem
	
buzzterrier wrote:
> My camel client sends a request to my service:
> 
> Future future = camelTemplate.asyncRequestBody(camelURI, searchTerms);
> 
> 
> Where searchTerms is a simple pojo SearchTerms that has just string values
> to be used for our query on the server.
> 
> 
> On the server I get a NoTypeConversionAvailableException on SearchTerms. 
> 
> My camel service has the method:
> 
> 	@Consume(uri = "activemq:queue:bluid:articles")
> 	public List<String> getArticles(SearchTerms searchTerms) {
> ...
> 	}
> 
> Is there a way easily convert my searchTerms pojo? I was hoping it would be
> like spring were I bind to a command object and cast it. I looked that the
> typeconverter examples, and it is not all the clear how I would hand this.
> 
> 
> 
> -----
> Buzzterrier
> 
> http://buzzterrier.blogspot.com/ View my blog: Ordinary Average Developer...