users@jersey.java.net

[Jersey] Re: java jersey OPTIONS command gives me Glassfish error message "Couldn't find JAX-B element for javax.ws.rs.core.Response"

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 27 Nov 2012 08:21:30 +0100

Hello Fiona,

this message is generated when WadlGenerator cannot for some reason
generate XML schema.

About your case - WADL generation is doing "static" code analysis, so
returned Response instance is not really relevant what is in there. Log
message means, that Response itself is not JAXB annotated class, thus
XML schema cannot be generated for it. You can safely ignore this
message if you don't need XML Schema in your WADL. Glassfish uses
java.util.logging and it should be easy to disable this particular
logger, see
http://docs.oracle.com/cd/E18930_01/html/821-2416/gklmn.html#scrolltoc .

Pavel

On 11/26/12 11:57 PM, Fiona Sisk wrote:
> Hi,
>
> I asked this on stack overflow but I didn't get a response. I hope
> I've better luck here!
>
> If I do a curl -X OPTIONS "http:....." against a RESTful service
> implemented by Jersey on Glassfish-3.1.2, it all works perfectly and I
> get back my WADL.
>
> I can also do the above programmatically and I get 200 OK response,
> WADL message in Message buffer, all as expected.
> The only fly in the ointment is that the Glassfish has an error
> message in the server.log
> |INFO|glassfish3.1.2|com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator|_ThreadID=25;_ThreadName=Thread-2;|Couldn't
> find JAX-B element for class javax.ws.rs.core.Response|#
> Now the RESTful service does have an GET that does return a
> javax.ws.rs.core.Response. Also, in this response is a JAX-B annotated
> bean.
> However, since I'm not actually invoking the GET, why would this
> matter to the operation of the curl -X "OPTIONS". Is this a harmless
> error message. Can I get rid of it ?
>
> thanks in advance,
> Fiona