Jersey: what does it mean “can't find a grammar element”?

After upgrading Jersey from version 1.15 to 1.17, he began to log the following messages:

Apr 2, 2013 5:13:06 PM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes
INFO: Couldn't find grammar element for class java.lang.String

An example of a service that creates such a message:

@GET
@Path("/bla/{a}")
@Produces("application/json")
public String doStuff(@PathParam("a") String a) {
    return a;
}

My first impression is to consider this error message, purely based on how the message is expressed ("could not be found"). However, it is registered at the INFO level, and in practice it is practically not operational, since all services continue to work.

So my question is whether these log messages indicate a (potential) problem with how we configure or use Jersey. Since this did not happen with the previous version, I already checked the release notes, but did not find anything related.

+7
source share
2

"info". java (Boolean, String...), , @XmlRootElement no-param , .

, "WadlGeneratorJAXBGrammarGenerator" :

Object parameterClassInstance = null;
try {
    Constructor<?> defaultConstructor = type.getDeclaredConstructor();
    defaultConstructor.setAccessible(true);
    parameterClassInstance = defaultConstructor.newInstance();
} catch (InstantiationException ex) {
    LOGGER.log(Level.FINE, null, ex);
} catch (IllegalAccessException ex) {
    LOGGER.log(Level.FINE, null, ex);
} catch (IllegalArgumentException ex) {
    LOGGER.log(Level.FINE, null, ex);
} catch (InvocationTargetException ex) {
    LOGGER.log(Level.FINE, null, ex);
} catch (SecurityException ex) {
    LOGGER.log(Level.FINE, null, ex);
} catch (NoSuchMethodException ex) {
    //getting here for Boolean/String and some other primitive data type
    LOGGER.log(Level.FINE, null, ex);
}

if (parameterClassInstance==null) {
    return null;
}

, String, Boolean , NoSuchMethodException, nulls .

, , , wadl, . web.xml

  <init-param>
         <param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
         <param-value>true</param-value>
     </init-param>
+11

@Kim D, DisableWADL, . , - AJAX JSON Chrome. , origin " CORS".

0

All Articles