Announcement Announcement Module
Collapse
No announcement yet.
Tests can't find schemas Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tests can't find schemas

    I work behind a firewall. I have proxies defined in my browser and Eclipse, which are ok.

    I'm trying to build a unit test using SpringJUnit4ClassRunner. I managed to get it to start loading the application context, but it fails when it tries to load schemas referenced in the application context. I've tried running the test directly from maven on the command line, and also executing the test class in Eclipse. At least it fails the same way using both strategies.

    If it matters, here's an excerpt from the log:
    Code:
    [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [applicationContext.xml]
    [main] WARN org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://cxf.apache.org/schemas/jaxrs.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 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
    I must be missing something simple.

    I've verified that there is a valid schema there. I can get to it both from my browser and my command line. I have proxy settings in both.

    Here are the annotations I've put on the test class:
    Code:
    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration({"/applicationContext.xml"})

  • #2
    I guess this must be a Maven Surefire problem. I've tried to set the proxy in Surefire, but it's not working. I'm pursuing this on another forum.

    Comment

    Working...
    X