I have a spring project built with the usage of maven (packaged as jar) (dependencies are copied to a separate directory and added to classpath)
I want to run it as java -jar
The problem is that when I run it I get:
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
It happens because spring.schemas and spring.handlers are located in a few jars i.e.: spring-beans, etc.
Is there any way to solve it, supposing that I don't want to use shade plugin to unpack all dependencies and concatenate the content of spring.schemas and spring.handlers?
I would also like to avoid saving xsd files in my project and changing schemaLocation to point to my location.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camel:camelContext>
<camel:routeBuilder ref="fakeRouteBuilder"/>
</camel:camelContext>
<bean id="fakeRouteBuilder" class="<className>" />
</beans>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> <camel:camelContext> <camel:routeBuilder ref="fakeRouteBuilder"/> </camel:camelContext> <bean id="fakeRouteBuilder" class="com..." /> </beans>
– JJT Feb 11 '11 at 18:07xsi:schemaLocation
attribute. It seems to be incorrect, but that might also be caused by the linkification of the URLs in the comments. Actually it would be better, if you edited your question by adding your previous comment as a code block (=select the code and click the{}
button to make it appear as a code block) – jasso Feb 11 '11 at 20:57