Hello Thierry,

I've made two tests, one with the following signature:

@Propfind
public Representation propfind(Variant variant) throws ResourceException

It behaved like the original version, that is HTTP 405 (Method Not Allowed).

The following test was with the signature you proposed, and now the
PROPFIND request is handled, albeit wrongly (WebDAV specifies that the
entity body is an XML message, all of WebDAV requests payload is XML).

I've added a log trace of the value of the 'text' parameter and got
the text (String) representation of the XML request body, but of
course when processing it, the DOM methods fail (because it's a String
and not the expected DomRepresentation), here's the relevant log
trace:

Aug 4, 2010 8:17:13 AM com.calenco.resource.workspace.ContentResource propfind
INFO: *+*+*+PROPFIND GOT: <?xml version="1.0" encoding="utf-8"?>
<propfind xmlns="DAV:"><prop>
<getcontentlength xmlns="DAV:"/>
<getlastmodified xmlns="DAV:"/>
<executable xmlns="http://apache.org/dav/props/"/>
<resourcetype xmlns="DAV:"/>
<checked-in xmlns="DAV:"/>
<checked-out xmlns="DAV:"/>
</prop></propfind>

java.lang.RuntimeException: java.net.MalformedURLException
        at 
org.restlet.ext.xml.XmlRepresentation.internalEval(XmlRepresentation.java:556)
        at 
org.restlet.ext.xml.XmlRepresentation.getNode(XmlRepresentation.java:426)
        at 
com.calenco.resource.workspace.ContentResource.propfind(ContentResource.java:767)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:453)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:522)
        at 
org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:563)
        at 
org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:299)
        at org.restlet.resource.ServerResource.handle(ServerResource.java:821)
        at org.restlet.resource.Finder.handle(Finder.java:513)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at 
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at 
org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:72)
        at org.restlet.Application.handle(Application.java:386)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Router.doHandle(Router.java:495)
        at org.restlet.routing.Router.handle(Router.java:735)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at 
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:154)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at org.restlet.routing.Filter.handle(Filter.java:203)
        at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
        at org.restlet.Component.handle(Component.java:390)
        at org.restlet.Server.handle(Server.java:474)
        at 
org.restlet.engine.http.connector.BaseServerHelper.handle(BaseServerHelper.java:158)
        at 
org.restlet.engine.http.connector.BaseServerHelper.handleInbound(BaseServerHelper.java:167)
        at 
org.restlet.engine.http.connector.BaseHelper.handleNextInbound(BaseHelper.java:418)
        at 
org.restlet.engine.http.connector.Connection.readMessages(Connection.java:705)
        at 
org.restlet.engine.http.connector.Controller$2.run(Controller.java:95)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.MalformedURLException
        at java.net.URL.<init>(URL.java:601)
        at java.net.URL.<init>(URL.java:464)
        at java.net.URL.<init>(URL.java:413)
        at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown 
Source)
        at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at 
org.restlet.ext.xml.DomRepresentation.getDocument(DomRepresentation.java:169)
        at 
org.restlet.ext.xml.XmlRepresentation.evaluate(XmlRepresentation.java:270)
        at 
org.restlet.ext.xml.XmlRepresentation.internalEval(XmlRepresentation.java:552)
        ... 58 more
Aug 4, 2010 8:17:13 AM com.calenco.resource.workspace.ContentResource propfind
SEVERE: Bad or no XML in the request body
Aug 4, 2010 8:17:13 AM com.calenco.resource.workspace.ContentResource propfind
INFO: PROPFIND request processed in 0.165 sec.
Aug 4, 2010 8:17:13 AM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-08-04        08:17:13        0:0:0:0:0:0:0:1 [email protected]       
-       9000    PROPFIND        /workspaces/W1/content/ -       207     -288    
176     http://localhost:9000   cadaver/0.23.3
neon/0.29.0     -


The line in my ContentResource server resource class where the
exception is fired is this one:

Node propNode = reqXML.getNode("/propfind/prop"); // NOI18N

which is expected, because as I've mentionned above, Restlet is
handling me a String, instead of a DomRepresentation of the request
body.

Thanks in advance for:

1) Fixing this ASAP
2) Telling me if there's a workaround I can use to deploy 2.0.0 now,
and the updated one with the fix later.

On Tue, Aug 3, 2010 at 4:49 PM, Thierry Boileau
<[email protected]> wrote:
> Hello Fabian,
>
> I guess the converter service is messing a little bit here. Can you try with 
> the following signature?
> @Propfind
> public Representation propfind(String text) throws ResourceException
>
> I have a look at your code.
>
> Best regards,
> Thierry Boileau
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2642426
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2642773

Reply via email to