5
votes

On running, my code, on terminal, it gives this error

Exception in thread "main" java.lang.RuntimeException: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/core]

Offending resource: class path resource [META-INF/test.xml]

my test.xml file is

<?xml version="1.0" encoding="UTF-8"?>
<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:cxf="http://cxf.apache.org/core"
    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/core http://cxf.apache.org/schemas/core.xsd">


    <bean id="clientI"
        class="LI" />
    <bean id="clientL"
        class="LIn" />

        <cxf:bus>
        <cxf:outInterceptors>
            <ref bean="clientI" />
        </cxf:outInterceptors>
        <cxf:inInterceptors>
            <ref bean="clientL" />
        </cxf:inInterceptors>
    </cxf:bus>
</beans>

However the same code works in eclipse. Does anyone know what the problem may be ?

2
Do you have the CXF jar on the runtime classpath? - chrylis -cautiouslyoptimistic-
This can be thrown if the jar file that contains core.xsd is not in the classpath when you run the app from the console. - Augusto
I have following cxf jar in my classpath cxf-api-2.7.3.jar cxf-rt-bindings-xml-2.7.3.jar; cxf-rt-core-2.7.3.jar; cxf-rt-features-clustering-2.7.3.jar; cxf-rt-frontend-jaxrs-2.7.3.jar; cxf-rt-frontend-jaxws-2.7.3.jar; cxf-rt-frontend-simple-2.7.3.jar; cxf-rt-transports-http-2.7.3.jar; cxf-rt-transports-local-2.7.3.jar I also have core.xsd in my classpath - Suraj Menon

2 Answers

3
votes

This issue arose because cxf-bundle JAR was not present in my classpath

You can get it from here: http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle/2.7.6 (the latest version).

0
votes

I guess you don't have, in your classpath, the JAR containing the cxf schema Try to add it to your classpath