You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Charles Moulliard (JIRA)" <ji...@apache.org> on 2009/11/30 13:01:52 UTC

[jira] Created: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Cannot determine specific JmsMessage type to use from body class
----------------------------------------------------------------

                 Key: CAMEL-2239
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.1.0
            Reporter: Charles Moulliard
             Fix For: 2.2.0


Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint

is reported with the following camel routing

{code}
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xsi:schemaLocation="
	    http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
		http://camel.apache.org/schema/osgi
		http://camel.apache.org/schema/osgi/camel-osgi.xsd
		http://camel.apache.org/schema/spring
		http://camel.apache.org/schema/spring/camel-spring.xsd
		http://camel.apache.org/schema/cxf
		http://camel.apache.org/schema/cxf/camel-cxf.xsd
		http://cxf.apache.org/jaxrs 
		http://cxf.apache.org/schemas/jaxrs.xsd
		http://cxf.apache.org/core
		http://cxf.apache.org/schemas/core.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
	
	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="connectionFactory">
      <bean class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
      </bean>
    </property>
    </bean>

	<!--
		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
	-->
	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
		staticSubresourceResolution="true">
		<jaxrs:serviceBeans>
			<ref bean="reportIncidentService" />
		</jaxrs:serviceBeans>
		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
	</jaxrs:server>

	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
	
	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />

	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>

	<camel:camelContext trace="true"
		xmlns="http://camel.apache.org/schema/osgi">

		<camel:route>
			<camel:from uri="cxfrs:bean:rsServer" />
			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
			<camel:to uri="jms:queue:in" />
		</camel:route>
		
		<camel:route>
			<camel:from uri="jms:queue:in"/>
			<camel:to uri="cxfrs:bean:rsClient" />
		</camel:route>
	</camel:camelContext>
	
</beans>
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56191#action_56191 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

@Charles
Just back to your case, you have to put the outMessage which is sent to cxf:rsServer with the Response object, otherwise cxf:rsServer will complain about the returned message is not a Response object.


> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56194#action_56194 ] 

Charles Moulliard commented on CAMEL-2239:
------------------------------------------

@Willem,

Can you explain this "Just back to your case, you have to put the outMessage which is sent to cxf:rsServer with the Response object, otherwise cxf:rsServer will complain about the returned message is not a Response object." as I don't understand ?

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56215#action_56215 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

@Sergey,
If we just need to deal with the Response object , I think it is reasonable to put the processors into Camel-RS, but there may be some other
message body objects which are not serializable. If so we still need to add other processor to deal with these message body object.
And for most camel component there is no requirement that message body should be serializable, if we setup the processors by default , it will 
be useless for most of case. 

So, I'd like to let the user to choice which message body object that he want to be serializable himself.

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56195#action_56195 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

To resolve the upper issue , we can make Response object to be serializable.
We can create 2 processor to do this job.
{code}
            <camel:route>
			<camel:from uri="cxfrs:bean:rsServer" />
			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
			<camel:to uri="jms:queue:in" />
                        <camel:process ref="unmarshalResponse"/>
		</camel:route>
		
		<camel:route>
			<camel:from uri="jms:queue:in"/>
			<camel:to uri="cxfrs:bean:rsClient" />
                        <camel:process ref="marshalResponse"/>
		</camel:route>
{code}
marshalResponse processor just take out the Response's entity and status code, meta data and put them into a serializable  Object.
unmarshalResponse processor will restore the entity's InputStream into an OutputStream, and set the status code and meta data back to a new Response instance.


> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56222#action_56222 ] 

Charles Moulliard commented on CAMEL-2239:
------------------------------------------

@Willem,

Using a SEDA endpoint combined with CXF:JAXRS, we could achieve the example presented here in the doc : http://camel.apache.org/seda.html
for a mina endpoint :

{code}
In Camel 2.0 the SEDA component supports using Request Reply, where the caller will wait for the Async route to complete. For instance:

from("mina:tcp://0.0.0.0:9876?textline=true&sync=true").to("seda:input");

from("seda:input").to("bean:processInput").to("bean:createResponse");

In the route above, we have a TCP listener on port 9876 that accepts incoming requests. The request is routed to the seda:input queue. As it is a Request Reply message, we wait for the response. When the consumer on the seda:input queue is complete, it copies the response to the original message response.
{code}

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56220#action_56220 ] 

Sergey Beryozkin commented on CAMEL-2239:
-----------------------------------------

Hi Willem

> If we just need to deal with the Response object , I think it is reasonable to put the processors into Camel-RS

I'm just thinking of CXFRS having utility processors dedicated to marshalling/unmarshalling raw Responses, so that users can just to 

<camel:route>
			<camel:from uri="cxfrs:bean:rsServer" />
			<camel:to uri="jms:queue:in" />
                        <camel:process ref="unmarshalResponse"/>
</camel:route>

<bean id="unmarshalResponse" class="org.apache.camel.cxfrs.UnmarshalResponseProcessor"/>

Just a little simplification, so that users just don't have to code what seems like can be captured in a utility class. I agree that in some other cases they may need to code some custom processors though

thanks, Sergey

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2239.
--------------------------------

    Resolution: Cannot Reproduce

Create a new ticket in the future if this is still a problem after 2.3 has been released.

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.3.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56201#action_56201 ] 

Sergey Beryozkin commented on CAMEL-2239:
-----------------------------------------

Thanks Willem.

I'm wondering, can we ship utility marshalResponse and unmarshalResponse processors, as part of the CXF JAXRS code base ? Looks like they can be made reusable ?

For ex, UnmarshalResponseProcessor will do :

ResponseBuilder builder = Response.status(orginalResponse.getStatus()).entity(orginalResponse.getEntity());

for (Map.Entry<String, List<String>> entry : orginalResponse.getMetadata()) {
    for (String value : entry.getValue()) {
          builder.header(entry.getKey(), value);
    }
}

MarshalProcessor will do something similar ?

return builder.build();

Do you think it is something that can be done internally by CxfRs itself ?

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56193#action_56193 ] 

Sergey Beryozkin commented on CAMEL-2239:
-----------------------------------------

Can it be defaulted somehow ? Ideally a user would not need to do the additional config...
Given the above camel context, would Charles need to update it somehow for it just to work ? The example would help...

As far as I understand this issue only occurs when a JAXRS service method returns a Response object. But all works fine if it is a usual object like Customer or Incident which is returned...

thanks, Sergey


> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56197#action_56197 ] 

Sergey Beryozkin commented on CAMEL-2239:
-----------------------------------------

Hi Willem, I'm a bit confused so would like to clarify :

1. If a JAXRS service method returns Response explicitly *then, and only then* Charles will need to add  marshalResponse and unmarshalResponse processors for a jms:queue producer/consumer work well with cxfrs

2. No need to introduce custom processors when it is only http which is involved, that is it is only cxf:rsServer, cxf:rsClient and jaxrs:server which are used.

 





> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard updated CAMEL-2239:
-------------------------------------

    Comment: was deleted

(was: @Willem,

Using a SEDA endpoint combined with CXF:JAXRS, we could achieve the example presented here in the doc : http://camel.apache.org/seda.html
for a mina endpoint :

{code}
In Camel 2.0 the SEDA component supports using Request Reply, where the caller will wait for the Async route to complete. For instance:

from("mina:tcp://0.0.0.0:9876?textline=true&sync=true").to("seda:input");

from("seda:input").to("bean:processInput").to("bean:createResponse");

In the route above, we have a TCP listener on port 9876 that accepts incoming requests. The request is routed to the seda:input queue. As it is a Request Reply message, we wait for the response. When the consumer on the seda:input queue is complete, it copies the response to the original message response.
{code})

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-2239:
-------------------------------

    Fix Version/s:     (was: 2.2.0)
                   2.3.0

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.3.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56221#action_56221 ] 

Charles Moulliard commented on CAMEL-2239:
------------------------------------------

@Willem, @Sergey,

An elegant alternative approach could be that the thread running the method called in the REST service :

    @GET
    @Path("/incidents/{id}/")
    public Incident getIncident(@PathParam("id") String id) {
        long idNumber = Long.parseLong(id);
        Incident i = incidents.get(idNumber);
        return i;
    }

is suspended and resumed when we receive through Camel route what the client is expected to receive as reply. This could be achieved if we add a new annotation @ProcessStatus to inform camel endpoint or CXF that we wait exchange return from Camel route (where we call a POJO in charge by example to make a DataBase request) before to provide back the reply to the RESTfull client.



> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56192#action_56192 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

@Claus,

I think we can live with the InputStream entity, as we can use JAXB or Jason to  unmarshal the InputStream instance.


> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Charles Moulliard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Charles Moulliard updated CAMEL-2239:
-------------------------------------

    Comment: was deleted

(was: @Willem, @Sergey,

An elegant alternative approach could be that the thread running the method called in the REST service :

    @GET
    @Path("/incidents/{id}/")
    public Incident getIncident(@PathParam("id") String id) {
        long idNumber = Long.parseLong(id);
        Incident i = incidents.get(idNumber);
        return i;
    }

is suspended and resumed when we receive through Camel route what the client is expected to receive as reply. This could be achieved if we add a new annotation @ProcessStatus to inform camel endpoint or CXF that we wait exchange return from Camel route (where we call a POJO in charge by example to make a DataBase request) before to provide back the reply to the RESTfull client.

)

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56186#action_56186 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

if I set the request message header
with Response.class,
{code}
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Response.class);
{code}
to invoke the Customer service method with WebClient API:
{code}
    @POST
    @Path("/customersUniqueResponseCode/")
    public Response addCustomerUniqueResponseCode(Customer customer) {
        customer.setId(++currentId);

        customers.put(customer.getId(), customer);

        return Response.status(201).entity(customer).build();
    }
{code}
I will get the response entity as an InputStream, not the Customer
instance that I want.
After digging the WebClient code for a while, I found
{code}
response = WebClient.invoke(httpMethod, body, responseClass);
{code}
will use the responseClass to unmarshal the inputStream with Provider.
So we need to specify the Response's entity Class for the HttpClient API to get right response entity.

For the camel-cxfrs producer, it is not possible to find the entity information from the Response class, so we need to let the user specify the Response's entity class first. I wrote a test case to demonstrate this issue.
{code}
@Test
    public void testAddCustomerUniqueResponseCode() {
        Exchange exchange = template.send("cxfrs://http://localhost:9002?httpClientAPI=true", new Processor() {

            public void process(Exchange exchange) throws Exception {
                exchange.setPattern(ExchangePattern.InOut);
                Message inMessage = exchange.getIn();
                // set the Http method
                inMessage.setHeader(Exchange.HTTP_METHOD, "POST");
                // set the relative path
                inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/customersUniqueResponseCode");
                // put the response's entity into out message body
                // by specifying the response entity class    inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
                // create a new customer object
                Customer customer = new Customer();
                customer.setId(8888);
                customer.setName("Willem");
                inMessage.setBody(customer);
            }

        });

        // get the response message
        Customer response = (Customer) exchange.getOut().getBody();

        assertNotNull("The response should not be null ", response);
        assertTrue("Get a wrong customer id ", response.getId() != 8888);
        assertEquals("Get a wrong customer name", response.getName(), "Willem");
    }
{code}

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56199#action_56199 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

Hi Sergey , 
You said what I want to say. I'm sorry I did not make them clear enough.



> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-2239:
-----------------------------------

    Assignee: Willem Jiang

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56186#action_56186 ] 

Willem Jiang edited comment on CAMEL-2239 at 12/1/09 2:17 AM:
--------------------------------------------------------------

if I set the request message header
with Response.class,
{code}
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Response.class);
{code}
to invoke the Customer service method with WebClient API:
{code}
    @POST
    @Path("/customersUniqueResponseCode/")
    public Response addCustomerUniqueResponseCode(Customer customer) {
        customer.setId(++currentId);

        customers.put(customer.getId(), customer);

        return Response.status(201).entity(customer).build();
    }
{code}
I will get the response entity as an InputStream, not the Customer
instance that I want.
After digging the WebClient code for a while, I found
{code}
response = WebClient.invoke(httpMethod, body, responseClass);
{code}
will use the responseClass to unmarshal the inputStream with Provider.
So we need to specify the Response's entity Class for the HttpClient API to get right response entity.

For the camel-cxfrs producer, it is not possible to find the entity information from the Response class, so we need to let the user specify the Response's entity class first. I wrote a test case to demonstrate this issue.
{code}
@Test
    public void testAddCustomerUniqueResponseCode() {
        Exchange exchange = template.send("cxfrs://http://localhost:9002?httpClientAPI=true", new Processor() {

            public void process(Exchange exchange) throws Exception {
                exchange.setPattern(ExchangePattern.InOut);
                Message inMessage = exchange.getIn();
                // set the Http method
                inMessage.setHeader(Exchange.HTTP_METHOD, "POST");
                // set the relative path
                inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/customersUniqueResponseCode");
                // put the response's entity into out message body
                // by specifying the response entity class   
                inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
                // create a new customer object
                Customer customer = new Customer();
                customer.setId(8888);
                customer.setName("Willem");
                inMessage.setBody(customer);
            }

        });

        // get the response message
        Customer response = (Customer) exchange.getOut().getBody();

        assertNotNull("The response should not be null ", response);
        assertTrue("Get a wrong customer id ", response.getId() != 8888);
        assertEquals("Get a wrong customer name", response.getName(), "Willem");
    }
{code}

      was (Author: njiang):
    if I set the request message header
with Response.class,
{code}
inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Response.class);
{code}
to invoke the Customer service method with WebClient API:
{code}
    @POST
    @Path("/customersUniqueResponseCode/")
    public Response addCustomerUniqueResponseCode(Customer customer) {
        customer.setId(++currentId);

        customers.put(customer.getId(), customer);

        return Response.status(201).entity(customer).build();
    }
{code}
I will get the response entity as an InputStream, not the Customer
instance that I want.
After digging the WebClient code for a while, I found
{code}
response = WebClient.invoke(httpMethod, body, responseClass);
{code}
will use the responseClass to unmarshal the inputStream with Provider.
So we need to specify the Response's entity Class for the HttpClient API to get right response entity.

For the camel-cxfrs producer, it is not possible to find the entity information from the Response class, so we need to let the user specify the Response's entity class first. I wrote a test case to demonstrate this issue.
{code}
@Test
    public void testAddCustomerUniqueResponseCode() {
        Exchange exchange = template.send("cxfrs://http://localhost:9002?httpClientAPI=true", new Processor() {

            public void process(Exchange exchange) throws Exception {
                exchange.setPattern(ExchangePattern.InOut);
                Message inMessage = exchange.getIn();
                // set the Http method
                inMessage.setHeader(Exchange.HTTP_METHOD, "POST");
                // set the relative path
                inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/customersUniqueResponseCode");
                // put the response's entity into out message body
                // by specifying the response entity class    inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, Customer.class);
                // create a new customer object
                Customer customer = new Customer();
                customer.setId(8888);
                customer.setName("Willem");
                inMessage.setBody(customer);
            }

        });

        // get the response message
        Customer response = (Customer) exchange.getOut().getBody();

        assertNotNull("The response should not be null ", response);
        assertTrue("Get a wrong customer id ", response.getId() != 8888);
        assertEquals("Get a wrong customer name", response.getName(), "Willem");
    }
{code}
  
> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56188#action_56188 ] 

Claus Ibsen commented on CAMEL-2239:
------------------------------------

Just throwing in a though

Isnt it possible to use Camels type converter mechanism

{code}
  Customer response = (Customer) exchange.getOut().getBody();
{code}

Could then become
{code}
  Customer response = exchange.getOut().getBody(Customer.class);
{code}

And then maybe you avoid that ugly header?

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56196#action_56196 ] 

Willem Jiang commented on CAMEL-2239:
-------------------------------------

@Charles,
I just want to say we should not change the Response in the camel-cxfrs producer and consumer.

> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CAMEL-2239) Cannot determine specific JmsMessage type to use from body class

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=56195#action_56195 ] 

Willem Jiang edited comment on CAMEL-2239 at 12/1/09 5:25 AM:
--------------------------------------------------------------

To resolve the upper issue , we can make Response object to be serializable.
We can create 2 processor to do this job.
{code}
            <camel:route>
			<camel:from uri="cxfrs:bean:rsServer" />
			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
			<camel:to uri="jms:queue:in" />
                        <camel:process ref="unmarshalResponse"/>
		</camel:route>
		
		<camel:route>
			<camel:from uri="jms:queue:in"/>
			<camel:to uri="cxfrs:bean:rsClient" />
                        <camel:process ref="marshalResponse"/>
		</camel:route>
{code}
marshalResponse processor just take out the Response's entity and status code, meta data and put them into a serializable  Object.
unmarshalResponse processor will restore the entity's InputStream, and set the status code and meta data back to a new Response instance.


      was (Author: njiang):
    To resolve the upper issue , we can make Response object to be serializable.
We can create 2 processor to do this job.
{code}
            <camel:route>
			<camel:from uri="cxfrs:bean:rsServer" />
			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
			<camel:to uri="jms:queue:in" />
                        <camel:process ref="unmarshalResponse"/>
		</camel:route>
		
		<camel:route>
			<camel:from uri="jms:queue:in"/>
			<camel:to uri="cxfrs:bean:rsClient" />
                        <camel:process ref="marshalResponse"/>
		</camel:route>
{code}
marshalResponse processor just take out the Response's entity and status code, meta data and put them into a serializable  Object.
unmarshalResponse processor will restore the entity's InputStream into an OutputStream, and set the status code and meta data back to a new Response instance.

  
> Cannot determine specific JmsMessage type to use from body class
> ----------------------------------------------------------------
>
>                 Key: CAMEL-2239
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2239
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>             Fix For: 2.2.0
>
>
> Error : Cannot determine specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class: org.apache.cxf.jaxrs.impl.ResponseImpl. If you want to send a POJO then your class might need to implement java.io.Serializable, or you can force a specific type by setting the jmsMessageType option on the JMS endpoint
> is reported with the following camel routing
> {code}
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
> 	xmlns:camel="http://camel.apache.org/schema/spring" xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	xmlns:cxf-core="http://cxf.apache.org/core" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xsi:schemaLocation="
> 	    http://www.springframework.org/schema/beans
> 		http://www.springframework.org/schema/beans/spring-beans.xsd
> 		http://www.springframework.org/schema/context
>         http://www.springframework.org/schema/context/spring-context.xsd
> 		http://camel.apache.org/schema/osgi
> 		http://camel.apache.org/schema/osgi/camel-osgi.xsd
> 		http://camel.apache.org/schema/spring
> 		http://camel.apache.org/schema/spring/camel-spring.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.xsd
> 		http://cxf.apache.org/jaxrs 
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://cxf.apache.org/core
> 		http://cxf.apache.org/schemas/core.xsd">
> 	<import resource="classpath:META-INF/cxf/cxf.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
> 	<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
> 	<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml" />
> 	
> 	<bean id="jms" class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="connectionFactory">
>       <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>         <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
>       </bean>
>     </property>
>     </bean>
> 	<!--
> 		<jaxrs:features> <cxf-core:logging/> </jaxrs:features> <bean
> 		id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"/>
> 	-->
> 	<jaxrs:server id="restService" address="/proxy/camel-rest-example/"
> 		staticSubresourceResolution="true">
> 		<jaxrs:serviceBeans>
> 			<ref bean="reportIncidentService" />
> 		</jaxrs:serviceBeans>
> 		<!--  <jaxrs:features><cxf-core:logging/></jaxrs:features> -->
> 	</jaxrs:server>
> 	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	
> 	<cxf:rsServer id="rsServer" address="/camel-rest-example/"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8181/cxf/proxy/"/>
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs:bean:rsServer" />
> 			<!-- <camel:to uri="log:org.apache.camel.example.reportIncident?level=DEBUG" /> -->
> 			<camel:to uri="jms:queue:in" />
> 		</camel:route>
> 		
> 		<camel:route>
> 			<camel:from uri="jms:queue:in"/>
> 			<camel:to uri="cxfrs:bean:rsClient" />
> 		</camel:route>
> 	</camel:camelContext>
> 	
> </beans>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.