Hi

I'm working on a project where I'm using restlets.   I have a problem
I can't solve:
I've searched the archives and couldn't find it there so I'm posting
it here before
I start to dig deeper.


   Situation:

       Using Restlet RC 4 based server to receive images uploaded
        from a MIDP client.

   Failure:

    Source code where the failure occurs
    
------------------------------------------------------------------------------
    public void setContentFrom(final Representation rep) {
        try {
            final ReadableByteChannel rb = rep.getChannel();
            final long expectedSize = rep.getSize();
            final java.nio.ByteBuffer bb =
                ByteBuffer.allocate((int) expectedSize);

            assert (rb.isOpen());

            long bytesRead = rb.read(bb);

             ....
       
------------------------------------------------------------------------------



  Uploads works perfectly when using HTTP, but fails when
  using HTTPS.    The failure works like this:

      o  I'm uploading an image that's about 80K in size.
          The client performing the upload is  running on
          Sun Wireless Toolkit emulator 2.5.1.
      o  I'm reading the content using the code above.
      o  In the HTTP case, the bytesRead variable is set to
          exactly the number of bytes in the image.

      o In the HTTPS case the bytesRead is 2016.
         -> Just to see what happened,  I attempted
              to read more from the input, and ,
              that is indeed possible (rb isn't closed),
              but after reading 16128 bytes this fails,
              giving the stacktrace included below.
              All of the rb.read(bb) invocations returns
              2016 bytes.

What I'd like to know is:

    -> Is this kind of behavior a problem that is known (for someone .-)
    -> Does anyone have any ideas about what the root cause is?
        (I'm currently guessing that the Restlet toolkit's HTTPS implementation
         does not support chunked uploads).
    -> Will it disappear if I upgrade to a later implementation of  Restlet
        (I'd rather  postpone  upgrading until a bit more of my program works,
         but if I have to I will do it :-)


Cheers

(Rmz)



btpool4-1, fatal error: 80: problem unwrapping net record
javax.net.ssl.SSLException: Unsupported record version Unknown-24.30
%% Invalidated:  [Session-1, SSL_RSA_WITH_RC4_128_SHA]
btpool4-1, SEND SSLv3 ALERT:  fatal, description = internal_error
btpool4-1, WRITE: SSLv3 Alert, length = 22
Handle PUT/POST failed due to exception java.lang.RuntimeException:
org.mortbay.jetty.EofException
11:41:27,538 ERROR RestRoomRestlet:? - Caught exception:
java.lang.RuntimeException: Handle PUT/POST failed due to exception
java.lang.RuntimeException: org.mortbay.jetty.EofException, dumping
stack to stdout
java.lang.RuntimeException: Handle PUT/POST failed due to exception
java.lang.RuntimeException: org.mortbay.jetty.EofException
        at mobi.ilabs.restroom.storage.AbstractStorage.handle(Unknown Source)
        at mobi.ilabs.restroom.RestRoomRestlet.handle(Unknown Source)
        at mobi.ilabs.restroom.HttpMethodOverriderRestlet.handle(Unknown Source)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Guard.accept(Guard.java:83)
        at org.restlet.Guard.doHandle(Guard.java:171)
        at org.restlet.Filter.handle(Filter.java:134)
        at mobi.ilabs.restroom.ObStoreRestlet.handle(Unknown Source)
        at mobi.ilabs.restroom.RestRoomApplication$1.handle(Unknown Source)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Router.handle(Router.java:440)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:87)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at 
com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:92)
        at org.restlet.Application.handle(Application.java:290)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Router.handle(Router.java:440)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Router.handle(Router.java:440)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:87)
        at org.restlet.Filter.handle(Filter.java:134)
        at org.restlet.Filter.doHandle(Filter.java:105)
        at org.restlet.Filter.handle(Filter.java:134)
        at 
com.noelios.restlet.component.ComponentHelper.handle(ComponentHelper.java:115)
        at org.restlet.Component.handle(Component.java:223)
        at org.restlet.Server.handle(Server.java:266)
        at com.noelios.restlet.ServerHelper.handle(ServerHelper.java:99)
        at 
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:87)
        at 
com.noelios.restlet.ext.jetty.JettyServerHelper$WrappedServer.handle(JettyServerHelper.java:232)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:710)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:203)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
        at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
        at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
11:41:27,541 ERROR RestRoomRestlet:? - Dumping stack for exception
handler to stdout

Reply via email to