Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Application fails to find XSD resource file

SummerBulb
2011-11-29
2013-05-23
  • SummerBulb
    SummerBulb
    2011-11-29

    I get the following error:

    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jar:file:/../bin/myJar.jar!/lib/InnerJar.jar!/mySchema.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>.

    Note: i am using the maven plugin.

     
  • P. Simon Tuffs
    P. Simon Tuffs
    2011-11-30

    Can you provide more of the stack trace?  It sounds like you're running into classloader inversion: I would guess that the class which is trying to load the XSD (SAX) is loaded by the system classloader, is therefore not using the One-JAR JAR url loader.  Can you extract and post a minimal set of example code to reproduce this.

    Thanks,

    Simon.

     
  • Hi, same happens to me with 0.97, but 0.96 works.

    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jar:file:/D:/Data/Springfield/ExeCache/txm-router-02.one-jar.jar!/lib/tcw-fip-trade-xmlbeans-bindings-COREET-SNAPSHOT.jar!/GMTTrade.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>.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
        at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:594)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:626)
        at com.barcap.tcw.trade.builder.BondBuilder.<init>(BondBuilder.java:26)
        at com.barcap.tcw.txm.common.config.TcwTradeServicesConfig.tradeFactory(TcwTradeServicesConfig.java:31)
        at com.barcap.tcw.txm.common.config.TcwTradeServicesConfig$$EnhancerByCGLIB$$f54b2906.CGLIB$tradeFactory$0(<generated>)
        at com.barcap.tcw.txm.common.config.TcwTradeServicesConfig$$EnhancerByCGLIB$$f54b2906$$FastClassByCGLIB$$cf24715e.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:210)
        at com.barcap.tcw.txm.common.config.TcwTradeServicesConfig$$EnhancerByCGLIB$$f54b2906.tradeFactory(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:145)