java - Weird validation error in beans.xml Spring CXF -
currently working on cxf spring. returns warning:
10:40:38,492 warn [org.springframework.beans.factory.xml.xmlbeandefinitionreader] (msc service thread 1-2) ignored xml validation warning: org.xml.sax.saxparseexception: schema_reference.4: failed read schema document 'http://cxf.apache.org/schemas/jaxrs.xsd', because 1) not find document; 2) document not read; 3) root element of document not <xsd:schema>.
then returns error on startup:
10:40:38,571 error [org.springframework.web.context.contextloader] (msc service thread 1-2) context initialization failed: org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 14 in xml document servletcontext resource [/web-inf/mvc-dispatcher-servlet.xml] invalid; nested exception org.xml.sax.saxparseexception: cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'jaxrs:server'.
this beans.xml:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> <import resource="classpath:meta-inf/cxf/cxf.xml" /> <jaxrs:server id="myorder" address="/"> <jaxrs:servicebeans> <ref bean="orderinfoimpl"> </ref> </jaxrs:servicebeans> </jaxrs:server> <bean id="orderinfoimpl" class="com.example.rest.orderinfoimpl"> </bean> <context:component-scan base-package="simpleclient, com.example.rest" /> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix"> <value>/web-inf/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> </beans>
was able fix adding correct jars, apparently, jboss 7 has it's own off shelf cxf jars, jars using application different version. matched jars , worked, exclude jetty in classpath/pom.xml.
Comments
Post a Comment