Well I would say you declared the bean twice like Sergey already hinted. Once in the beans.xml and once in the jaxrs.xml.
Why do you have two separate spring configs anyway? Simply use one file and load this using the spring ContextLoaderListener.
Christian Am 11.06.2011 19:11, schrieb odyssey045:
Not really.. My beans.xml looks something like this:' <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <jaxrs:server id="categoryservice" address="/"> <jaxrs:features> <cxf:logging/> </jaxrs:features> <jaxrs:serviceBeans> <ref bean="categoryServiceBean" /> </jaxrs:serviceBeans> </jaxrs:server> <bean id="categoryServiceBean" class="com.demo.cxf.server.CategoryService"/> </beans> And my jaxrs.xml used by spring looks something like tis: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="categoryService" class="com.demo.cxf.server.CategoryService"> <property name="categoryDAO"> <ref bean="categoryDAO"/> </property> </bean> <bean id="categoryDAO" class="com.demo.cxf.dao.CategoryDao"></bean> </beans> Should i *not* be declaring the categoryservice in beans.xml? -- View this message in context: http://cxf.547215.n5.nabble.com/Spring-cxf-the-injected-bean-in-the-service-is-not-persisted-Get-NPE-tp4475916p4479210.html Sent from the cxf-user mailing list archive at Nabble.com.
-- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com
