Hi, My comment inline ------------- Freeman(Yue) Fang
Red Hat, Inc. FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: @Freeman小屋 On 2013-6-24, at 下午8:15, Veeraraghavan wrote: > Hi, > > I wrote a simple Apache CXF rest webservices using spring beans. When I > deployed it in tomcat it is working fine and I'm able to see the result. > > I made the whole project into .WAR file and deployed it in service mix. When > I try to access the service from browser, I'm getting the following > exception. > > *contextLoader | 121 - org.springframework.web - > 3.0.7.RELEASE | Context initialization failed > org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected > exception parsing XML document from ServletContext resource > [/WEB-INF/beans.xml]; nested exception is > org.springframework.beans.FatalBeanException: Class > [org.apache.cxf.jaxrs.spring.NamespaceHandler] for namespace > [http://cxf.apache.org/jaxrs] does not implement the > [org.springframework.beans.factory.xml.NamespaceHandler] interface* This generally means you have class org.springframework.beans.factory.xml.NamespaceHandler loaded by different classloaders. > > > I have all the necessary spring jar files in the lib folder which gets > bundled with .WAR file itself. Can someone please help. This is the problem, SMX install spring bundles out of the box, but your war embed spring jars as well, this can cause ClassCastException as there are two spring copy in the container loaded by different classloaders. You should remove the embedded spring jars and add OSGi headers to your war, to make it use the spring bundles installed in the container, take a look at [1] to get more details. [1]http://karaf.apache.org/manual/latest-2.3.x/users-guide/web-applications.html > > > > -- > View this message in context: > http://servicemix.396122.n5.nabble.com/Apache-CXF-with-Spring-beans-deployed-on-Service-mix-throws-org-springframework-beans-factory-BeanDen-tp5717092.html > Sent from the ServiceMix - User mailing list archive at Nabble.com.
