You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Stefaan Vanderheyden (JIRA)" <ji...@apache.org> on 2014/07/31 16:07:41 UTC

[jira] [Created] (CXF-5918) ResoureUtils#createJaxbContext hides JaxB validation errors

Stefaan Vanderheyden created CXF-5918:
-----------------------------------------

             Summary: ResoureUtils#createJaxbContext hides JaxB validation errors
                 Key: CXF-5918
                 URL: https://issues.apache.org/jira/browse/CXF-5918
             Project: CXF
          Issue Type: Improvement
          Components: JAXB Databinding
    Affects Versions: 2.7.12, 3.0.0-milestone2, 3.0.0-milestone1
         Environment: All
            Reporter: Stefaan Vanderheyden


When creating a Jaxb context, the ResourceUtils class catches all JAXBExceptions and eats them!

These errors are usually related to the validation of JAXB class annotations and are required to fix problems with the WADL grammar section...

Suggest logging at least an WARNING level entry and include the original JAXBException in the log to provide sufficient info to fix the warning...

JAXBContext ctx;
        try {
            ctx = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),
                                          contextProperties);
            return ctx;
        } catch (JAXBException ex) {
            LOG.fine("No JAXB context can be created");
        }

should be

JAXBContext ctx;
        try {
            ctx = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),
                                          contextProperties);
            return ctx;
        } catch (JAXBException ex) {
            LOG.log(Level.WARNING, "No JAXB context can be created", ex);
        }



--
This message was sent by Atlassian JIRA
(v6.2#6252)