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/24 10:29:52 UTC

[jira] Created: (CAMEL-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
-------------------------------------------------------------------------------------

                 Key: CAMEL-2219
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.1.0
            Reporter: Charles Moulliard
            Assignee: Willem Jiang


camel - route defintion :

{code}
<?xml version="1.0" encoding="UTF-8"?>
	<!--
		Licensed to the Apache Software Foundation (ASF) under one or more
		contributor license agreements. See the NOTICE file distributed with
		this work for additional information regarding copyright ownership.
		The ASF licenses this file to You under the Apache License, Version
		2.0 (the "License"); you may not use this file except in compliance
		with the License. You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
		applicable law or agreed to in writing, software distributed under the
		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
		CONDITIONS OF ANY KIND, either express or implied. See the License for
		the specific language governing permissions and limitations under the
		License.
	-->
<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:osgi="http://www.springframework.org/schema/osgi"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xmlns:cxf="http://camel.apache.org/schema/cxf"
	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://www.springframework.org/schema/osgi
		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
		http://cxf.apache.org/schemas/jaxrs.xsd
		http://camel.apache.org/schema/cxf
		http://camel.apache.org/schema/cxf/camel-cxf.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" />
	
	<jaxrs:server id="restService"
		        address="/report" 
		        staticSubresourceResolution="true">
    	<jaxrs:serviceBeans>
      		<ref bean="reportIncidentService"/>
    	</jaxrs:serviceBeans>       
  	</jaxrs:server>
  	
  	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />

	<cxf:rsClient id="rsClient" address="http://localhost:8080"
		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />

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

		<camel:route>
			<camel:from uri="cxfrs://bean://rsClient" />
			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
				<camel:constant>True</camel:constant>
			</camel:setHeader>
			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
		</camel:route>
	</camel:camelContext>

</beans>

{code}

and error reported 


{code}
karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
        at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
        at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
        at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
va:358)
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
Context.java:320)
        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
cyWaiterApplicationContextExecutor.java:136)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
jaxrs.JAXRSServerFactoryBean
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
        at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
        ... 12 more
Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
        at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
        at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
        at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
        at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
        at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
        ... 14 more
{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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Charles Moulliard commented on CAMEL-2219:
------------------------------------------

@Willem,

I have updated my camel route like this :

{code}
<?xml version="1.0" encoding="UTF-8"?>
	<!--
		Licensed to the Apache Software Foundation (ASF) under one or more
		contributor license agreements. See the NOTICE file distributed with
		this work for additional information regarding copyright ownership.
		The ASF licenses this file to You under the Apache License, Version
		2.0 (the "License"); you may not use this file except in compliance
		with the License. You may obtain a copy of the License at

		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
		applicable law or agreed to in writing, software distributed under the
		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
		CONDITIONS OF ANY KIND, either express or implied. See the License for
		the specific language governing permissions and limitations under the
		License.
	-->
<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"
	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">

	<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" />
	 
    <cxf:rsServer id="rsServer"
                  address="/camel-rest-example/"
                  serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />

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

		<camel:route>
			<camel:from uri="cxfrs://bean://rsServer" />
			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
				<camel:constant>True</camel:constant>
			</camel:setHeader>
			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
		</camel:route>
	</camel:camelContext>

</beans>

{code}

The ReportIncidentService is defined like this for :
- @path --> /reportservice/
- @POST --> @Path("/incidents/")

Using a java standalone application simulating REST call (http://code.google.com/p/rest-client/), I try the following url :

http://localhost:8080/cxf/camel-rest-example/reportservice/incidents (as POST) 

but I don't receive anything and I see the following info in the Apache Felix Karaf log :

12:54:38,608 | WARN  | 30601495@qtp3-0  | JAXRSUtils                       | pache.cxf.jaxrs.utils.JAXRSUtils  973 | No message body reader has been found for request class Incident, ContentType : */*.
12:54:38,623 | WARN  | 30601495@qtp3-0  | WebApplicationExceptionMapper    | pl.WebApplicationExceptionMapper   52 | WebApplicationException has been caught : no cause is available

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Sergey Beryozkin commented on CAMEL-2219:
-----------------------------------------

Hi Willem

We've had an offline chat with Charles. Hopefully, POST request should be handled ok now by the IncidentService.
However, the GET request still fails with

The get request works :

http://localhost:8080/cxf/camel-rest-example/reportservice/incidents/111/

except that we have the following error :

13:05:07,780 | INFO  | 30601495@qtp3-0  | Tracer                           | rg.apache.camel.processor.Logger   88 | 515ad634-3c5f-40c7-83f0-2067f5842b56 >>> from(/camel-rest-example/) --> setHeader[CamelCxfRsUsingHttpAPI], Pattern:InOut, Headers:{CamelHttpUri=/cxf/camel-rest-example/reportservice/incidents/111/, CamelHttpPath=/camel-rest-example/reportservice/incidents/111/, CamelCxfRsOperationResourceInfoStack=[org.apache.cxf.jaxrs.model.MethodInvocationInfo@b2d28b], CamelCxfRsResponseClass=class org.apache.camel.example.reportincident.restful.Incident, CamelHttpCharacterEncoding=ISO-8859-1, CamelHttpMethod=GET, operationName=getIncident, CamelAcceptContentType=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8}, BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d
13:05:07,780 | INFO  | 30601495@qtp3-0  | Tracer                           | rg.apache.camel.processor.Logger   88 | 515ad634-3c5f-40c7-83f0-2067f5842b56 >>> setHeader[CamelCxfRsUsingHttpAPI] --> log://org.apache.camel.example.reportIncident?level=INFO, Pattern:InOut, Headers:{CamelHttpMethod=GET, CamelHttpCharacterEncoding=ISO-8859-1, CamelCxfRsOperationResourceInfoStack=[org.apache.cxf.jaxrs.model.MethodInvocationInfo@b2d28b], CamelCxfRsResponseClass=class org.apache.camel.example.reportincident.restful.Incident, CamelAcceptContentType=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, CamelCxfRsUsingHttpAPI=True, operationName=getIncident, CamelHttpUri=/cxf/camel-rest-example/reportservice/incidents/111/, CamelHttpPath=/camel-rest-example/reportservice/incidents/111/}, BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d
13:05:07,780 | INFO  | 30601495@qtp3-0  | reportIncident                   | rg.apache.camel.processor.Logger   88 | Exchange[BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d]
13:05:07,795 | WARN  | 30601495@qtp3-0  | JAXRSOutInterceptor              | .interceptor.JAXRSOutInterceptor  346 | No message body writer has been found for response class Object[].

I'm wondering why JAXRSOutInterceptor assumes that the responseObject is of type Object[], even though it is actually a JAXRS Response instance which is returned.

As far as CXF is concerned, its JAXRSInvoker wraps a response object in a MessageContentsList : return new MessageContentsList(object)

and JAXRSOutInterceptor accesses it like this :

MessageContentsList objs = MessageContentsList.getContentsList(message);
Object responseObject = objs.get(0)

Now, I can see from the log that the ExchangeBodyType is Object[] so it looks like this Object[] is used to initialize  a new MessageContentsList instance.
Perhaps it is only the first element of the body type object array which should be used ?, something like : 
new MessageContentsList(bodyTypeArray[0])

thanks








> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Sergey Beryozkin commented on CAMEL-2219:
-----------------------------------------

Hi Willem

<setHeader headerName="CamelCxfRsUsingHttpAPI">
         <constant>True</constant>        
</setHeader>

This is a default now, right ? so may be no need to set it ?

thanks, Sergey



> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Charles Moulliard commented on CAMEL-2219:
------------------------------------------

The get request works :

http://localhost:8080/cxf/camel-rest-example/reportservice/incidents/111/

except that we have the following error :

{code}
13:05:07,780 | INFO  | 30601495@qtp3-0  | Tracer                           | rg.apache.camel.processor.Logger   88 | 515ad634-3c5f-40c7-83f0-2067f5842b56 >>> from(/camel-rest-example/) --> setHeader[CamelCxfRsUsingHttpAPI], Pattern:InOut, Headers:{CamelHttpUri=/cxf/camel-rest-example/reportservice/incidents/111/, CamelHttpPath=/camel-rest-example/reportservice/incidents/111/, CamelCxfRsOperationResourceInfoStack=[org.apache.cxf.jaxrs.model.MethodInvocationInfo@b2d28b], CamelCxfRsResponseClass=class org.apache.camel.example.reportincident.restful.Incident, CamelHttpCharacterEncoding=ISO-8859-1, CamelHttpMethod=GET, operationName=getIncident, CamelAcceptContentType=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8}, BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d
13:05:07,780 | INFO  | 30601495@qtp3-0  | Tracer                           | rg.apache.camel.processor.Logger   88 | 515ad634-3c5f-40c7-83f0-2067f5842b56 >>> setHeader[CamelCxfRsUsingHttpAPI] --> log://org.apache.camel.example.reportIncident?level=INFO, Pattern:InOut, Headers:{CamelHttpMethod=GET, CamelHttpCharacterEncoding=ISO-8859-1, CamelCxfRsOperationResourceInfoStack=[org.apache.cxf.jaxrs.model.MethodInvocationInfo@b2d28b], CamelCxfRsResponseClass=class org.apache.camel.example.reportincident.restful.Incident, CamelAcceptContentType=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, CamelCxfRsUsingHttpAPI=True, operationName=getIncident, CamelHttpUri=/cxf/camel-rest-example/reportservice/incidents/111/, CamelHttpPath=/camel-rest-example/reportservice/incidents/111/}, BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d
13:05:07,780 | INFO  | 30601495@qtp3-0  | reportIncident                   | rg.apache.camel.processor.Logger   88 | Exchange[BodyType:Object[], Body:[Ljava.lang.Object;@1cac3d]
13:05:07,795 | WARN  | 30601495@qtp3-0  | JAXRSOutInterceptor              | .interceptor.JAXRSOutInterceptor  346 | No message body writer has been found for response class Object[].
{code}

I think that the object must be transformed in XML format when returned to the resource calling it (web browser, ...)

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Willem Jiang commented on CAMEL-2219:
-------------------------------------

@Sergey
Yes, CXFRS client is default to use HttpAPI, we can remove the set header code out.
 

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Willem Jiang resolved CAMEL-2219.
---------------------------------

    Resolution: Won't Fix

Update the wiki page for it.

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Willem Jiang commented on CAMEL-2219:
-------------------------------------

@Sergey,
You can configure the custom provider as cxfrs endpoint does.

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Charles Moulliard commented on CAMEL-2219:
------------------------------------------

My Incident class is a copy/paste of the Customer class (available here : https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerService.java)

> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Willem Jiang commented on CAMEL-2219:
-------------------------------------

@Charles

Because we use the cxf rs endpoint inside the camel, camel-cxf did some customer on the spring configuration.
You had to define the server endpoint for consumer, and client endpoint for the producer like this.
{code}
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:cxf="http://camel.apache.org/schema/cxf"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
    ">


  <cxf:rsServer id="rsServer" address="http://localhost:9000/router"
    serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>


  <cxf:rsClient id="rsClient" address="http://localhost:9002/helloworld"
    serviceClass="org.apache.camel.component.cxf.jaxrs.testbean.CustomerService"/>

  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <route>
       <from uri="cxfrs://bean://rsServer"/>
       <setHeader headerName="CamelCxfRsUsingHttpAPI">
         <constant>True</constant>        
       </setHeader>
       <to uri="cxfrs://bean://rsClient"/>
    </route>
  </camelContext>

</beans>
{code}
I will update the wiki page to add a spring configuration example.


> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Sergey Beryozkin commented on CAMEL-2219:
-----------------------------------------

Is Incident a JAXB-annotated class ? If yes, then it might be worth adding @Consumes("application/xml") 
to a method which expects an Incident XML payload and setting a request ContentType to "application/xml".

If it's not a JAXB annotated bean then a custom provider has to be registered. 
Willem, is it possible to register custom providers using cxf:rsServer ? It would probably be nice if it were possible to refer from cxf:rsServer to a jaxrs:server bean, given that jaxrs:server has a number of config options...

cheers, Sergey


> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {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-2219) The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

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

Sergey Beryozkin commented on CAMEL-2219:
-----------------------------------------

Hi Charles,

Did you mean

https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/Customer.java

?

CustomerService is a root resource class, so I'm presuming you have a similar IncidentService resource class which accepts POST/GET requests.

So assuming Incident.class is an XMLRootElement annotated class then the default JAXB provider shipped with CXF should help in handling POST requests.
As I suggested above, please also make sure a method on the IncidentService class which expects an Incident instance is also annotated 
with @Consumes("application/xml"), it may help, and set the request content type too.

Can you also give some more info about the method which handles @GET ? Doers it return Object[] ? or Incident[] ?

If you'd like we can take it offline (provided it's now just JAX-RS related issues that we're discussing and cxfrs is not contributing to the issues you're reporting) - please consider posting the details to the cxf users list or #cxf or sberyozkin@gmail.com


> The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2219
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2219
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>            Reporter: Charles Moulliard
>            Assignee: Willem Jiang
>
> camel - route defintion :
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> 	<!--
> 		Licensed to the Apache Software Foundation (ASF) under one or more
> 		contributor license agreements. See the NOTICE file distributed with
> 		this work for additional information regarding copyright ownership.
> 		The ASF licenses this file to You under the Apache License, Version
> 		2.0 (the "License"); you may not use this file except in compliance
> 		with the License. You may obtain a copy of the License at
> 		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
> 		applicable law or agreed to in writing, software distributed under the
> 		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
> 		CONDITIONS OF ANY KIND, either express or implied. See the License for
> 		the specific language governing permissions and limitations under the
> 		License.
> 	-->
> <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:osgi="http://www.springframework.org/schema/osgi"
> 	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> 	xmlns:cxf="http://camel.apache.org/schema/cxf"
> 	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://www.springframework.org/schema/osgi
> 		http://www.springframework.org/schema/osgi/spring-osgi.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://cxf.apache.org/jaxrs
> 		http://cxf.apache.org/schemas/jaxrs.xsd
> 		http://camel.apache.org/schema/cxf
> 		http://camel.apache.org/schema/cxf/camel-cxf.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" />
> 	
> 	<jaxrs:server id="restService"
> 		        address="/report" 
> 		        staticSubresourceResolution="true">
>     	<jaxrs:serviceBeans>
>       		<ref bean="reportIncidentService"/>
>     	</jaxrs:serviceBeans>       
>   	</jaxrs:server>
>   	
>   	<bean id="reportIncidentService" class="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<cxf:rsClient id="rsClient" address="http://localhost:8080"
> 		serviceClass="org.apache.camel.example.reportincident.restful.ReportIncidentService" />
> 	<camel:camelContext trace="true"
> 		xmlns="http://camel.apache.org/schema/osgi">
> 		<camel:route>
> 			<camel:from uri="cxfrs://bean://rsClient" />
> 			<camel:setHeader headerName="CamelCxfRsUsingHttpAPI">
> 				<camel:constant>True</camel:constant>
> 			</camel:setHeader>
> 			<camel:to uri="log:org.apache.camel.example.reportIncident?level=INFO" />
> 		</camel:route>
> 	</camel:camelContext>
> </beans>
> {code}
> and error reported 
> {code}
> karaf@root> Exception in thread "SpringOsgiExtenderThread-9" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: jav
> a.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:562)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
>         at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
>         at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
>         at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
>         at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
>         at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.ja
> va:358)
>         at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>         at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplication
> Context.java:320)
>         at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(Dependen
> cyWaiterApplicationContextExecutor.java:136)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.
> jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:938)
>         at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
>         ... 12 more
> Caused by: java.lang.IllegalArgumentException: The configure bean is not the instance of org.apache.cxf.jaxrs.JAXRSServerFactoryBean
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.checkBeanType(CxfRsSpringEndpoint.java:66)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsSpringEndpoint.setupJAXRSServerFactoryBean(CxfRsSpringEndpoint.java:71)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createJAXRSServerFactoryBean(CxfRsEndpoint.java:152)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.<init>(CxfRsConsumer.java:37)
>         at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.createConsumer(CxfRsEndpoint.java:103)
>         at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:60)
>         at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:83)
>         at org.apache.camel.impl.RouteService.doStart(RouteService.java:123)
>         at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:55)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:906)
>         ... 14 more
> {code}

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