Hello,

In the discussion about the refactoring would drop the LdRenderer
Service without replacement. I understood the proposal as to unpinning
Freemarker stuff from the LdRenderer (which admittedly was at the
wrong place). I think a service to Render RdfViewables is needed and
that such a service should be independent of Jax-Rs. Apart from being
broken I think the refactored WebConsolePlugin code is also
significantly less nice than the original version. It introduced a
dependency on jax-rs and to freemarker which weren't there before. I
think this stuff should be abstracted away.

Rupert could you please reintroduce a service equivalent to LdRenderer
to serialize RdfViewables to Stream without having to care about
jax-rs or Freemarker classes? As I already pointed out in my mail to
the original thread there is nothing web-specific in such a service.

Cheers,
Reto

On Wed, Feb 13, 2013 at 11:51 AM, Danny Ayers <[email protected]> wrote:
> note also the API access is also broken, running:
>
> curl --user admin:admin -H "Accept:text/turtle"
> http://localhost:8080/user-management/user/anonymous
>
> throws:
>
> SEVERE: Mapped exception to response: 500 (Internal Server Error)
> javax.ws.rs.WebApplicationException:
> com.sun.jersey.api.MessageException: A message body writer for Java
> class org.apache.stanbol.commons.web.viewable.RdfViewable, and Java
> type class org.apache.stanbol.commons.web.viewable.RdfViewable, and
> MIME media type application/octet-stream was not found
>         at 
> com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:285)
> ...
>
> On 13 February 2013 11:45, Danny Ayers <[email protected]> wrote:
>> The root of the problem making User Management totally unusable is the
>> latest change made at:
>>
>> http://svn.apache.org/viewvc/stanbol/trunk/commons/security/usermanagement/src/main/java/org/apache/stanbol/commons/usermanagement/WebConsolePlugin.java?view=log
>>
>> associated with:
>> STANBOL-910
>> Refactor Viewable and LDpath Freemaker Template rendering
>>
>> (The previous version used a LdRenderer, the latest uses a LdViewableWriter)
>>
>> Would it please be possible to revert this change (or refactor to a
>> working state).
>>
>> Thanks,
>> Danny.
>>
>> On 13 February 2013 11:29, Reto Bachmann-Gmür <[email protected]> wrote:
>>> Clearly something seems quite weird of using the MessageBodyWriter
>>> which should be a service for JAX-RS in this non JAX-RS context. The
>>> Original Version was directly accessing LdRenderer.
>>>
>>> You should see when this changed and maybe reopen the issue the change
>>> was associated with.
>>>
>>> Cheers,
>>> Reto
>>>
>>> On Wed, Feb 13, 2013 at 11:16 AM, Danny Ayers <[email protected]> wrote:
>>>> will do.
>>>>
>>>> On 13 February 2013 11:12, Reto Bachmann-Gmür <[email protected]> wrote:
>>>>> Hi
>>>>>
>>>>> I see the problem too.
>>>>>
>>>>> Can you create an issue to address this?
>>>>>
>>>>> Cheers,
>>>>> Reto
>>>>>
>>>>> On Tue, Feb 12, 2013 at 3:54 PM, Danny Ayers <[email protected]> 
>>>>> wrote:
>>>>>> [I'll post again later re. User Management module more generally, re.
>>>>>> STANBOL-897, but before going any further I could do with a working
>>>>>> system :) ]
>>>>>>
>>>>>> From a checkout & install from svn, I believe a pristine system, when
>>>>>> I click on the User Management tab I'm getting a 500:
>>>>>>
>>>>>> java.lang.IllegalStateException: WRITER
>>>>>>         at org.mortbay.jetty.Response.getOutputStream(Response.java:594)
>>>>>>         at 
>>>>>> javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112)
>>>>>>         at 
>>>>>> org.apache.stanbol.commons.usermanagement.WebConsolePlugin.renderContent(WebConsolePlugin.java:79)
>>>>>>         at 
>>>>>> org.apache.felix.webconsole.AbstractWebConsolePlugin.doGet(AbstractWebConsolePlugin.java:155)
>>>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>>>> ...
>>>>>>
>>>>>> When I was working from a git clone of a git clone of the svn (!) this
>>>>>> wasn't happening, but I haven't been able to track down what's
>>>>>> changed.
>>>>>>
>>>>>> Possibly related is this message on startup:
>>>>>>
>>>>>> WARNING: A HTTP GET method, public void
>>>>>> org.apache.clerezza.platform.security.permissioncheck.PermissionCheck.checkPermission(java.lang.String),
>>>>>> MUST return a non-void type.
>>>>>>
>>>>>> The call which leads to the 500 is:
>>>>>>
>>>>>> private LdViewableWriter rdfViewableWriter;
>>>>>>
>>>>>> ...
>>>>>>
>>>>>>         RdfViewable rdfViewable = new RdfViewable(
>>>>>>             "org/apache/stanbol/commons/usermanagement/webConsole.ftl",
>>>>>>             userManager.getUserType());
>>>>>>
>>>>>>         rdfViewableWriter.writeTo(rdfViewable, RdfViewable.class,
>>>>>> RdfViewable.class,
>>>>>>             RdfViewable.class.getAnnotations(), MediaType.TEXT_HTML_TYPE,
>>>>>>             null, response.getOutputStream());
>>>>>>
>>>>>> I've tried a dummy .ftl - that didn't change anything, and
>>>>>> userManager.getUserType() is producing an appropriate value (a
>>>>>> foaf:Agent).
>>>>>>
>>>>>>  I vaguely remember this kind of exception arising when you try
>>>>>> writing to a closed stream. But there's so much filter chaining going
>>>>>> on, and not a little magic, it's really hard to see what's going
>>>>>> wrong.
>>>>>>
>>>>>> Any suggestions?
>>>>>>
>>>>>> Cheers,
>>>>>> Danny.
>>>>>>
>>>>>> --
>>>>>> http://dannyayers.com
>>>>>>
>>>>>> http://webbeep.it  - text to tones and back again
>>>>
>>>>
>>>>
>>>> --
>>>> http://dannyayers.com
>>>>
>>>> http://webbeep.it  - text to tones and back again
>>
>>
>>
>> --
>> http://dannyayers.com
>>
>> http://webbeep.it  - text to tones and back again
>
>
>
> --
> http://dannyayers.com
>
> http://webbeep.it  - text to tones and back again

Reply via email to