users@jersey.java.net

Re: Generating urls and controlling rendering/serialization

From: Jo Størset <jo.storset_at_usit.uio.no>
Date: Mon, 3 Mar 2008 11:55:13 +0100

Den 29. feb.. 2008 kl. 11.41 skrev Paul Sandoz:

> How have you implemented the freemarker template processor? can you
> provide some example code.

My inital cut is the same as your example. The provider is found

INFO: Provider classes found:
   class no.uio.total.frida.FreemarkerTemplateProcessor

But my debug sysout in resolve never shows up:

     public String resolve(String path) {
         System.out.println("Hello world: " + path);
    ....

Instead I get this (expected) exception:

2008-03-03 11:49:21.782::WARN: /test/
java.lang.IllegalArgumentException: A message body writer for Java
type, class no.uio.total.frida.resources.Test, and MIME media type,
application/octet-stream, was not found
        at
com
.sun
.ws
.rest
.impl
.application
.MessageBodyFactory.getMessageBodyWriter(MessageBodyFactory.java:153)

I suspect this might be a problem with my use of the SpringServlet
(copied from the blog example), and that this overrides some of the
initialization logic. I guess it might be to early to try to use
different extension mechanisms at the same time, without knowing the
internals of the initialization.

As an example I see the springservlet overrides
         wa.initiate(rc);
with
         wa.initiate(rc, new SpringComponentProvider(springContext));

I'll see if I can make some time tonight to take another look at it.

Jo