Sorry - I did not spot it, thanks for the confirmation. I'll note that some
custom validation may have to be added to the cxf jaxrs spring-related
code...

cheers, Sergey

On Fri, Sep 24, 2010 at 12:55 PM, benoit villaumie
<[email protected]>wrote:

>  I finally found the problem :
>
> in the endpoints.xml, serviceBeans is ill-declared
>
> <jaxrs:server id="rest-customerService" address="/rest/">
> <jaxrs:serviceBeans>
> <list>
> <ref bean="pojo-customerService" />
> </list>
> </jaxrs:serviceBeans>
>
> I have to remove <list>  and it's work.
>
> Thx everyone.
>
>
> Le 23/09/2010 17:02, benoit villaumie a écrit :
>
>   Thanks for your reply Sergey.
>>
>> As you suggested, I have tried a basic implementation without any api.
>> However, I have the exception.
>>
>>   23 sept. 2010 16:53:15 org.apache.catalina.startup.HostConfig deployWAR
>>   INFO: D�ploiement de l'archive
>>   jsonoverhttp-cxf-server-2.0.0-SNAPSHOT.war de l'application web
>>   23 sept. 2010 16:53:15 org.apache.catalina.loader.WebappClassLoader
>>   validateJarFile
>>   INFO:
>>
>> validateJarFile(C:\bvillaumie\localhost\apache-tomcat-6.0.x-standalone\work\Catalina\localhost\jsonoverhttp-cxf-server-2.0.0-SNAPSHOT\WEB-INF\lib\geronimo-servlet_2.5_spec-1.2.jar)
>>   - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending
>>   class: javax/servlet/Servlet.class
>>   23 sept. 2010 16:53:15 org.springframework.web.context.ContextLoader
>>   initWebApplicationContext
>>   INFO: Root WebApplicationContext: initialization started
>>   23 sept. 2010 16:53:15
>>   org.springframework.context.support.AbstractApplicationContext
>>   prepareRefresh
>>   INFO: Refreshing
>>   org.springframework.web.context.support.xmlwebapplicationcont...@6210fb
>> :
>>   display name [Root WebApplicationContext]; startup date [Thu Sep 23
>>   16:53:15 CEST 2010]; root of context hierarchy
>>   23 sept. 2010 16:53:15
>>   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
>>   loadBeanDefinitions
>>   INFO: Loading XML bean definitions from ServletContext resource
>>   [/WEB-INF/service-servlet.xml]
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
>>   loadBeanDefinitions
>>   INFO: Loading XML bean definitions from class path resource
>>   [META-INF/cxf/cxf.xml]
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
>>   loadBeanDefinitions
>>   INFO: Loading XML bean definitions from class path resource
>>   [META-INF/cxf/cxf-servlet.xml]
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
>>   loadBeanDefinitions
>>   INFO: Loading XML bean definitions from class path resource
>>   [META-INF/cxf/cxf-extension-jaxrs-binding.xml]
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
>>   loadBeanDefinitions
>>   INFO: Loading XML bean definitions from class path resource
>>   [META-INF/spring/json-over-http/endpoints.xml]
>>   23 sept. 2010 16:53:16
>>   org.springframework.context.support.AbstractApplicationContext
>>   obtainFreshBeanFactory
>>   INFO: Bean factory for application context
>>   [org.springframework.web.context.support.xmlwebapplicationcont...@6210fb
>> ]:
>>
>> org.springframework.beans.factory.support.defaultlistablebeanfact...@70610a
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.support.DefaultListableBeanFactory
>>   preInstantiateSingletons
>>   INFO: Pre-instantiating singletons in
>>
>> org.springframework.beans.factory.support.defaultlistablebeanfact...@70610a
>> :
>>   defining beans
>>
>> [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.transport.servlet.ServletTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,pojo-customerService,rest-customerService];
>>   root of factory hierarchy
>>   23 sept. 2010 16:53:16 org.apache.cxf.jaxrs.utils.ResourceUtils
>>   checkMethodDispatcher
>>   ATTENTION: No resource methods have been found for resource class
>>   java.util.ArrayList
>>   23 sept. 2010 16:53:16 org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean
>>   checkResources
>>   GRAVE: No resource classes found
>>   23 sept. 2010 16:53:16
>>   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
>>   destroySingletons
>>   INFO: Destroying singletons in
>>
>> org.springframework.beans.factory.support.defaultlistablebeanfact...@70610a
>> :
>>   defining beans
>>
>> [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.transport.servlet.ServletTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,pojo-customerService,rest-customerService];
>>   root of factory hierarchy
>>   23 sept. 2010 16:53:16 org.springframework.web.context.ContextLoader
>>   initWebApplicationContext
>>   GRAVE: Context initialization failed
>>   org.springframework.beans.factory.BeanCreationException: Error
>>   creating bean with name 'rest-customerService': Invocation of init
>>   method failed; nested exception is
>>   org.apache.cxf.service.factory.ServiceConstructionException
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>>        at
>>
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>>        at
>>
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>>        at
>>
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
>>        at
>>
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
>>        at
>>
>> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>>        at
>>
>> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>>        at
>>
>> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>>        at
>>
>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
>>        at
>>
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
>>        at
>>
>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>>        at
>>   org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>>        at
>>   org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>>        at
>>   org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
>>        at
>>   org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
>>        at
>>   org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
>>        at
>>   org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
>>        at
>>
>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>>        at
>>
>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>>        at
>>   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>>        at
>>   org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>>        at
>>   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>>        at
>>   org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>>        at
>>   org.apache.catalina.core.StandardService.start(StandardService.java:516)
>>        at
>>   org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>>        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>>   Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>>        at
>>
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:122)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>        at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
>>        at
>>
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
>>        ... 39 more
>>   Caused by: javax.ws.rs.WebApplicationException
>>        at
>>
>> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:238)
>>        at
>>
>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:85)
>>        ... 46 more
>>   23 sept. 2010 16:53:16 org.apache.catalina.core.StandardContext start
>>   GRAVE: Error listenerStart
>>   23 sept. 2010 16:53:16 org.apache.catalina.core.StandardContext start
>>   GRAVE: Erreur de d�marrage du contexte
>>   [/jsonoverhttp-cxf-server-2.0.0-SNAPSHOT] suite aux erreurs
>>   pr�c�dentes
>>
>> My implementation is :
>>
>>   package com.karavel.tutorial.backend.cxf;
>>
>>   import java.util.Date;
>>
>>   import javax.ws.rs.Consumes;
>>   import javax.ws.rs.GET;
>>   import javax.ws.rs.Path;
>>   import javax.ws.rs.Produces;
>>
>>   @Path("/tutorial/")
>>   @Consumes("application/json")
>>   @Produces("application/json")
>>
>>   public class TutorialServiceJsonOverHttpFacadeImpl {
>>
>>        public TutorialServiceJsonOverHttpFacadeImpl() {
>>            super();
>>        }
>>
>>        @GET
>>        @Path("echo")
>>        public String echo() {
>>            return "hello world @"+new Date();
>>        }
>>   }
>>
>> The web.xml is
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>        xmlns="http://java.sun.com/xml/ns/javaee";
>>        xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
>>        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
>>        id="services" version="2.5">
>>
>> <context-param>
>> <param-name>contextConfigLocation</param-name>
>> <param-value>/WEB-INF/service-servlet.xml</param-value>
>> </context-param>
>> <listener>
>> <listener-class>
>>                org.springframework.web.context.ContextLoaderListener
>> </listener-class>
>> </listener>
>> <servlet>
>> <servlet-name>CXFServlet</servlet-name>
>> <servlet-class>
>>                org.apache.cxf.transport.servlet.CXFServlet
>> </servlet-class>
>> </servlet>
>> <servlet-mapping>
>> <servlet-name>CXFServlet</servlet-name>
>> <url-pattern>/*</url-pattern>
>> </servlet-mapping>
>> </web-app>
>>
>>
>> The service-servlet.xml is
>>
>> <beans xmlns="http://www.springframework.org/schema/beans";
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>        xmlns:jaxws="http://cxf.apache.org/jaxws";
>>        xsi:schemaLocation="
>>   http://www.springframework.org/schema/beans
>>   http://www.springframework.org/schema/beans/spring-beans.xsd
>>   http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>>   http://camel.apache.org/schema/spring
>>   http://camel.apache.org/schema/spring/camel-spring-2.3.0.xsd";>
>>
>> <import resource="classpath:META-INF/cxf/cxf.xml" />
>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>>
>> <!-- support rest json -->
>> <import
>>   resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
>> <import
>>   resource="classpath:META-INF/spring/json-over-http/endpoints.xml" />
>>
>> </beans>
>>
>> And the endpoints.xml is
>>
>> <beans xmlns="http://www.springframework.org/schema/beans";
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>   xmlns:cxf="http://cxf.apache.org/core";
>>        xmlns:jaxws="http://cxf.apache.org/jaxws";
>>   xmlns:jaxrs="http://cxf.apache.org/jaxrs";
>>        xsi:schemaLocation="
>>   http://www.springframework.org/schema/beans
>>   http://www.springframework.org/schema/beans/spring-beans.xsd
>>   http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
>>   http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>>   http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
>>   http://camel.apache.org/schema/spring
>>   http://camel.apache.org/schema/spring/camel-spring-2.3.0.xsd";>
>>
>> <bean id="pojo-customerService"
>>
>> class="com.karavel.tutorial.backend.cxf.TutorialServiceJsonOverHttpFacadeImpl"
>>   />
>>
>> <!-- for incoming http/json -->
>> <jaxrs:server id="rest-customerService" address="/rest/">
>> <jaxrs:serviceBeans>
>> <list>
>> <ref bean="pojo-customerService" />
>> </list>
>> </jaxrs:serviceBeans>
>> <jaxrs:extensionMappings>
>> <!--  entry key="feed" value="application/atom+xml"/-->
>> <entry key="json" value="application/json" />
>> <!--entry key="xml" value="application/xml"/-->
>> <!--entry key="html" value="text/html"/-->
>> </jaxrs:extensionMappings>
>> </jaxrs:server>
>>
>> </beans>
>>
>> The dependdncy tree of the project is
>>
>>   INFO]
>>   upgrade.karavel.tutorial:jsonoverhttp-cxf-server:war:2.0.0-SNAPSHOT
>>   INFO] +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
>>   INFO] \- org.apache.cxf:cxf-bundle-jaxrs:jar:2.2.9:compile
>>   INFO]    +- org.springframework:spring-core:jar:2.5.6:compile
>>   INFO]    +- commons-logging:commons-logging:jar:1.1.1:compile
>>   INFO]    +- org.springframework:spring-beans:jar:2.5.6:compile
>>   INFO]    +- org.springframework:spring-context:jar:2.5.6:compile
>>   INFO]    +- aopalliance:aopalliance:jar:1.0:compile
>>   INFO]    +-
>>   org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1:compile
>>   INFO]    +- javax.xml.bind:jaxb-api:jar:2.1:compile
>>   INFO]    +-
>>   org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
>>   INFO]    +- wsdl4j:wsdl4j:jar:1.6.2:compile
>>   INFO]    +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.5:compile
>>   INFO]    +- commons-lang:commons-lang:jar:2.4:compile
>>   INFO]    +-
>>   org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile
>>   INFO]    +- org.codehaus.woodstox:wstx-asl:jar:3.2.9:compile
>>   INFO]    +- org.apache.neethi:neethi:jar:2.0.4:compile
>>   INFO]    +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
>>   INFO]    +-
>>   org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
>>   INFO]    +- org.springframework:spring-web:jar:2.5.6:compile
>>   INFO]    +- org.mortbay.jetty:jetty:jar:6.1.21:compile
>>   INFO]    +- org.mortbay.jetty:jetty-util:jar:6.1.21:compile
>>   INFO]    +- org.slf4j:slf4j-api:jar:1.5.8:runtime
>>   INFO]    +-
>>   org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.2:compile
>>   INFO]    +- org.apache.abdera:abdera-core:jar:1.0:compile
>>   INFO]    +- org.apache.abdera:abdera-i18n:jar:1.0:compile
>>   INFO]    +- commons-codec:commons-codec:jar:1.3:compile
>>   INFO]    +- org.apache.abdera:abdera-parser:jar:1.0:compile
>>   INFO]    +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.7:compile
>>   INFO]    +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.7:compile
>>   INFO]    +- jaxen:jaxen:jar:1.1.1:compile
>>   INFO]    +- org.apache.abdera:abdera-extensions-json:jar:1.0:compile
>>   INFO]    +- org.apache.abdera:abdera-extensions-main:jar:1.0:compile
>>   INFO]    +- org.codehaus.jettison:jettison:jar:1.2:compile
>>   INFO]    \- org.apache.xmlbeans:xmlbeans:jar:2.4.0:compile
>>   INFO]
>>
>>  I a must be a very basic mustake, but the stack trace give me no hints...
>>
>>
>> Le 15/09/2010 18:55, Sergey Beryozkin a écrit :
>>
>>> Hi
>>>
>>> there should be a log record reporting the cause, but from the trace I
>>> can
>>> see that the
>>> "pojo-customerService" bean is not being recognized as a valid JAX-RS
>>> root
>>> resource.
>>>
>>> Try deploying a JAXRS endpoint only, without JAXWS annotations. If it
>>> works
>>> then the JAXRS runtime is being confused by the additional annotations,
>>> should not be the case, but it is worth checking.
>>>
>>> Try removing the interface just for a test, there were some similar cases
>>> reported before, where JAXRS annotations were spread across the interface
>>> and the implementation class, ex, interface methods had all the @Path
>>> annotations but the impl class was effectively hiding them by having
>>> annotations such as @QueryParam only...
>>>
>>> Something is interfering in the process so please try to isolate the
>>> cause.
>>>
>>> Let us know if you can make it work
>>>
>>> cheers, Sergey
>>>
>>> On Wed, Sep 15, 2010 at 2:37 PM, benoit villaumie<[email protected]
>>> >wrote:
>>>
>>>   Hello everyone,
>>>>
>>>> I am trying to expose a service using http/json via cxf.
>>>> However, I issue a stacktrace at the startup of the webapp :
>>>>
>>>>   14:49:44,648 | {main} | [WARN ] |
>>>>   [org.springframework.beans.GenericTypeAwarePropertyDescriptor] :
>>>>   Invalid JavaBean property 'serviceBeans' being accessed! Ambiguous
>>>>   write methods found next to actually used [public void
>>>>
>>>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(java.util.List)]:
>>>>
>>>>   [public void
>>>>
>>>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.setServiceBeans(java.lang.Object[])]
>>>>
>>>>   14:49:44,695 | {main} | [INFO ] |
>>>>   [org.springframework.beans.factory.support.DefaultListableBeanFactory]
>>>>   : Destroying singletons in
>>>>
>>>>
>>>> org.springframework.beans.factory.support.defaultlistablebeanfact...@1861086
>>>> :
>>>>   defining beans
>>>>
>>>> [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf
>>>>
>>>>
>>>> .binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,org.apache.camel.component.cxf.transport.CamelTransportFactory#0,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,jms-customerService-ConnectionFactory,jms-customerService-PooledConnectionFactory,jms-customerService-Config,pojo-customerService,rest-customerService,http-customerService,jms-customerService,direct-customerService,template,consumerTemplate,camelContext-server:beanPostProcessor,camelContext-server,org.apache.camel.component.cxf.transport.CamelTransportFactory#1];
>>>>
>>>>   root of factory hierarchy
>>>>   14:49:44,695 | {main} | [ERROR] |
>>>>   [org.springframework.web.context.ContextLoader] : Context
>>>>   initialization failed
>>>>   org.springframework.beans.factory.BeanCreationException: Error
>>>>   creating bean with name 'rest-customerService': Invocation of init
>>>>   method failed; nested exception is
>>>>   org.apache.cxf.service.factory.ServiceConstructionException
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
>>>>
>>>>        at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
>>>>
>>>>        at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
>>>>
>>>>        at
>>>>
>>>> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>>>>
>>>>        at
>>>>
>>>> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>>>>
>>>>        at
>>>>
>>>> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>>>>
>>>>        at
>>>>
>>>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
>>>>
>>>>        at
>>>>
>>>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
>>>>        at
>>>>
>>>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>>>>
>>>>        at
>>>>
>>>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>>>>        at
>>>>   org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>>>>        at
>>>>   org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
>>>>        at
>>>>   org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
>>>>        at
>>>>   org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
>>>>        at
>>>>   org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
>>>>        at
>>>>
>>>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>>>>
>>>>        at
>>>>
>>>> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>>>>
>>>>        at
>>>>   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
>>>>        at
>>>>   org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>>>>        at
>>>>   org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>>>>        at
>>>>   org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>>>>        at
>>>>
>>>> org.apache.catalina.core.StandardService.start(StandardService.java:516)
>>>>        at
>>>>   org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
>>>>        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
>>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>        at
>>>>
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>
>>>>        at
>>>>
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>
>>>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>>>        at
>>>> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>>>>        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>>>>   Caused by: org.apache.cxf.service.factory.ServiceConstructionException
>>>>        at
>>>>
>>>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:125)
>>>>
>>>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>        at
>>>>
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>
>>>>        at
>>>>
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>
>>>>        at java.lang.reflect.Method.invoke(Method.java:597)
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>>>>
>>>>        at
>>>>
>>>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
>>>>
>>>>        ... 36 more
>>>>   Caused by: javax.ws.rs.WebApplicationException
>>>>        at
>>>>
>>>> org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.checkResources(AbstractJAXRSFactoryBean.java:262)
>>>>
>>>>        at
>>>>
>>>> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:85)
>>>>
>>>>        ... 43 more
>>>>
>>>> The error message gave me no hints. Can someone helps or encountered
>>>> similar stack ?
>>>>
>>>> I am using cxf 2.2.9 (try also with 2.2.10). For information soap over
>>>> http
>>>> and soap over jms were working before the test with json. Other spring
>>>> files
>>>> are not copy/paste (mainly related to soap over jms integration)
>>>>
>>>> the spring configuration is
>>>>
>>>> <beans xmlns="http://www.springframework.org/schema/beans";
>>>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>>   xmlns:cxf="http://cxf.apache.org/core";
>>>>        xmlns:jaxws="http://cxf.apache.org/jaxws";
>>>>   xmlns:jaxrs="http://cxf.apache.org/jaxrs";
>>>>        xsi:schemaLocation="
>>>>   http://www.springframework.org/schema/beans
>>>>   http://www.springframework.org/schema/beans/spring-beans.xsd
>>>>   http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
>>>>   http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
>>>>   http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
>>>>   http://camel.apache.org/schema/spring
>>>>   http://camel.apache.org/schema/spring/camel-spring-2.3.0.xsd";>
>>>>
>>>> <bean id="pojo-customerService"
>>>>   class="com.karavel.tutorial.backend.impl.ComponentImpl" />
>>>>
>>>> <!-- for incoming http/json -->
>>>> <jaxrs:server id="rest-customerService" address="/rest/">
>>>> <jaxrs:serviceBeans>
>>>> <list>
>>>> <ref bean="pojo-customerService" />
>>>> </list>
>>>> </jaxrs:serviceBeans>
>>>> <jaxrs:extensionMappings>
>>>> <!--  entry key="feed" value="application/atom+xml"/-->
>>>> <entry key="json" value="application/json" />
>>>> <!--entry key="xml" value="application/xml"/-->
>>>> <!--entry key="html" value="text/html"/-->
>>>> </jaxrs:extensionMappings>
>>>> </jaxrs:server>
>>>>
>>>> <!-- for incoming http/soap -->
>>>> <jaxws:endpoint id="http-customerService"
>>>>   implementor="#pojo-customerService"
>>>>            address="/service" />
>>>>
>>>> <!-- for incoming jms/soap -->
>>>> <!-- http://camel.apache.org/jms.html -->
>>>> <!-- http://camel.apache.org/activemq.html -->
>>>> <bean id="jms-customerService"
>>>>   class="org.apache.activemq.camel.component.ActiveMQComponent">
>>>> <property name="configuration" ref="jms-customerService-Config" />
>>>> <property name="useMessageIDAsCorrelationID" value="true" />
>>>> <property name="requestTimeout" value="20000" /> <!-- ms, time
>>>>   between post and consumption in the queue -->
>>>> <property name="receiveTimeout" value="5000" /> <!-- ms -->
>>>> </bean>
>>>> <jaxws:endpoint id="direct-customerService"
>>>>   implementor="#pojo-customerService"
>>>>            address="camel://direct:customerService">
>>>> <jaxws:features>
>>>> <!-- Enables logging of SOAP messages. -->
>>>> <logging xmlns="http://cxf.apache.org/core"; />
>>>> </jaxws:features>
>>>> </jaxws:endpoint>
>>>>
>>>> </beans>
>>>>
>>>>
>>>> The java interface is
>>>>
>>>>   @WebService
>>>>   @Path("/json")
>>>>   public interface ICustomerFacadeService extends ICustomerService {
>>>>
>>>>        @GET
>>>>        @Path("/fake_echo")
>>>>        public String fake_echo();
>>>>
>>>>
>>>>        @WebResult(name = "echo")
>>>>        @WebMethod
>>>>        public String echo(@WebParam(name = "string") String string,
>>>>   @WebParam(name = "time-to-sleep-in-ms") long timeToSleepInMs);
>>>>
>>>>
>>>>        @WebResult(name = "getCustomerByName1Out")
>>>>        @WebMethod
>>>>        public CustomerSyntheseVO getCustomerByName1(
>>>>            @WebParam(name = "name") String name ) throws
>>>>   NoSuchCustomerException;
>>>>
>>>>
>>>>        @WebResult(name = "getCustomersByName1Out")
>>>>        @WebMethod
>>>>        public CustomerSyntheseVO[] getCustomersByName1(
>>>>            @WebParam(name = "name") String name ) throws
>>>>   NoSuchCustomerException;
>>>>
>>>>        @WebResult(name = "getCustomersByName2Out")
>>>>        @WebMethod
>>>>        public CustomerSyntheseVO[] getCustomersByName2(
>>>>                @WebParam(name = "name") String name );
>>>>
>>>>        @WebResult(name = "new_methodOut")
>>>>        @WebMethod
>>>>        public NewOutVO new_method(@WebParam(name = "in")  NewInVO in);
>>>>
>>>>       @WebMethod
>>>>       @Oneway
>>>>       public void insertWithoutException(@WebParam(name = "in") String
>>>>   name);
>>>>   }
>>>>
>>>> Thanks for your help.
>>>>
>>>>
>>>>
>>>>
>>
>>
>
> --
> Benoit Villaumié
> Karavel / Promovacances - Responsable Architecture
> Tel. 01 48 01 51 88
> --
>
>
>

Reply via email to