cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joanne Kubischta (Created) (JIRA)" <>
Subject [jira] [Created] (CXF-4220) After loading XSDs from links in WADL, JAX-RS get all for all resources fail with 400
Date Mon, 02 Apr 2012 16:37:23 GMT
After loading XSDs from links in WADL, JAX-RS get all for all resources fail with 400

                 Key: CXF-4220
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.5.2
         Environment: Linux
            Reporter: Joanne Kubischta

We use a CustomCXFNonSpringJaxrsServlet with one overriding method in order to use our hand
written WADL.
   protected void setSchemasLocations(JAXRSServerFactoryBean bean, ServletConfig servletConfig)
      super.setSchemasLocations(bean, servletConfig);
      // Set the WADL document location
      if(servletConfig.getInitParameter(JAXRSUtils.DOC_LOCATION) != null)

In the web.xml of the user resource, the XSDs are referenced as follows - 

In the wadl file, the grammar section is as follows - 
    <include href="xml.xsd" />
    <include href="atom.xsd" />
    <include href="user.xsd" />
    <include href="user-role.xsd" />

Here are the steps to reproduce the error - 

1. Verify get all and get a single resource work for all resources including user.
2. Access user wadl from https://server:port/api/rest/users?_wadl successfully but the grammar
section is changed to -
    <include href="https://server:8443/api/rest/users//xml.xsd" />
    <include href="https://server:8443/api/rest/users//atom.xsd" />
    <include href="https://server:8443/api/rest/users//user.xsd" />
    <include href="https://server:8443/api/rest/users//user-role.xsd" />
3. Repeat step 1. Result is good.
4. Click the first link and view xml.xsd from a browser. Note xml.xsd is availale from the
internet and does not have a schemaLocation tag. 
5. Repeat step 1. Result is good.
6. Click the link to atom.xsd or any of rest of the links and the XSD loads correctly. Note
all those XSDs are only available in the classpath of user.war.
   Below is an excerpt of how schema is referenced in the XSD -
   <xs:import namespace="urn:api:rest:user-role" schemaLocation="https://server:8443/api/rest/users//"
   <xs:import namespace="" schemaLocation="https://server:8443/api/rest/users//"
7. Do a get all request using https://server:8443/api/rest/users and get the following error
   400: Bad Request
   org.xml.sax.SAXParseException: Premature end of file.
8. Do a get all request to other resources and get the same 400.
9. Restart JBoss and problem goes away.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message