How to point xml schemaLocation to a xsd packaged in an application in JBoss EAP?

Solution Unverified - Updated -

Issue

  • JBoss is still having an issue in reading the xsd files packaged inside the war file, when I package the xsds in WEB-INF and reference them like this:

    <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
            http://www.springframework.org/schema/beans spring-beans.xsd
            http://cxf.apache.org/jaxws jaxws.xsd
            http://cxf.apache.org/configuration/beans cxf-beans.xsd">
    ....
    
  • I get this error in the log:

    INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-5) Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-beans.xml]
    WARNING [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (MSC service thread 1-5) Ignored XML validation warning: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'spring-beans.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content