Note that there are some explanatory texts on larger screens.

plurals
  1. POResourceClient hanging on LockSupport.park() on SunOS when connecting to Restlet Server
    primarykey
    data
    text
    <p>I have a very simple Restlet server that I'm testing with a very simple Restlet client, all using Restlet-2.1.0 with the following extensions: xstream-1.4, jettison-1.3.</p> <p>Everything works well on my Mac, but when trying to run this on SunOS 5.10, the client hangs when connecting to the server. I can get a response when hitting the server from a browser, or from telnet, and also this same client works fine when connecting to any <em>other</em> resource other than the Restlet server.</p> <p>Looking at the thread dump I see this:</p> <pre><code>"main" prio=3 tid=0x08070800 nid=0x2 waiting on condition [0xfe0eb000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for &lt;0xbbe827e8&gt; (a java.util.concurrent.CountDownLatch$Sync) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:811) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:969) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:207) at org.restlet.engine.connector.ClientConnectionHelper.handle(ClientConnectionHelper.java:517) at org.restlet.Client.handle(Client.java:180) at org.restlet.Restlet.handle(Restlet.java:284) at com.redprairie.task.common.TempClient.main(TempClient.java:17) </code></pre> <p>I tried using both ClientResource.get() and Client.handle(Request) and both hang.</p> <p>Server code:</p> <pre><code>server = new Server(Protocol.HTTP, SERVER_PORT, TestServerResource.class); Context ctx = new Context(); server.setContext(ctx); server.start(); </code></pre> <p>Client code:</p> <pre><code>Request request = new Request(Method.GET, "http://localhost:8188/retrieve"); Client client = new Client(Protocol.HTTP); Response response = client.handle(request); response.getEntity().write(System.out); </code></pre> <p>Resource:</p> <pre><code>public class TestServerResource extends ServerResource { private static volatile Customer bernard = Customer.createSample(); @Get("json") public Customer retrieve() { System.out.println("GET request received"); return bernard; } } </code></pre> <p>The xstream and jettison extensions work perfectly to convert java objects to JSON and vice versa, and again, this works fine on my Mac OS X, but hangs on Sun...</p> <p>I am new to Restlet so perhaps I'm doing something wrong, but these are simple examples taken from available documentation.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload