Hi Jerome,

I have tried as you suggested, but I am having different issues in different 
tests.

I have initialized a static variable in my application with Client object one 
time and using it for all my ClientResource calls. Using these changes, if I 
now run my test that does a GET of a partcular resource 100 times, this worked 
fine. I did not see HTTP Connector start and stop messages I was seeing earlier.

Then I tried a test on another resource that does  PUT to create an object. In 
this test, it went fine for about 9 calls and then got blocked. It appeared as 
if it ran out of connections and blocked. It times out evenutally and gives me 
some errors.

Then I tried another test that does a PUT and DELETE on a resource in a loop. 
In this situation I see that first PUT and DELETE succeeded, but the next PUT 
gets blocked and I eventually get a Null Pointer Exception in the server. I am 
exchanging java object representations between client and server.

Can you shed any light on what am I doing wrong here?

Below are my client and server messages:

Dec 29, 2010 2:08:58 PM org.restlet.engine.http.connector.HttpClientHelper start
INFO: Starting the default HTTP client
 Created Organization id: 2
Dec 29, 2010 2:10:02 PM org.restlet.resource.ClientResource handle
INFO: A recoverable error was detected (1002), attempting again in 2000 ms.
Internal Server Error (500) - Internal Server Error
        at org.restlet.resource.ClientResource.handle(ClientResource.java:854)
        at org.restlet.resource.ClientResource.put(ClientResource.java:1264)
        at 
com.sios.caspian.cmgi.client.Tenant.createOrganization(Tenant.java:62)
        at 
com.sios.caspian.cmgi.client.PerformanceTest.testCreateOrganizationPerformance(PerformanceTest.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at 
org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


Server side:

Dec 29, 2010 2:09:02 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:09:02        127.0.0.1       sa      -       80      
GET     /casp/cmgi/security/user-password/Admin -       200     -       0       
2640    http://localhost        Restlet-Framework/2.0.4 -
Dec 29, 2010 2:09:02 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:09:02        127.0.0.1       Admin   -       80      
GET     /casp/cmgi/security/user-session        -       200     -       0       
3063    http://localhost        Restlet-Framework/2.0.4 -
2010-12-29 14:09:02.390 INFO net.spy.memcached.MemcachedConnection:  Added {QA 
sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, 
topWop=null, toWrite=0, interested=0} to connect queue
2010-12-29 14:09:02.421 INFO net.spy.memcached.MemcachedConnection:  Connection 
state changed for sun.nio.ch.selectionkeyi...@11b86c7
Dec 29, 2010 2:09:02 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:09:02        127.0.0.1       
994c5d66-d47c-47b1-9b5d-2f5509e653c7    -       80      PUT     
/casp/cmgi/tenant/organization  -       200     -       -       125     
http://localhost        Restlet-Framework/2.0.4 -
2010-12-29 14:09:02.703 INFO net.spy.memcached.MemcachedConnection:  Added {QA 
sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, 
topWop=null, toWrite=0, interested=0} to connect queue
2010-12-29 14:09:02.750 INFO net.spy.memcached.MemcachedConnection:  Connection 
state changed for sun.nio.ch.selectionkeyi...@11a0d35
Dec 29, 2010 2:09:02 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:09:02        127.0.0.1       
994c5d66-d47c-47b1-9b5d-2f5509e653c7    -       80      DELETE  
/casp/cmgi/tenant/organization/2        -       200     -       0       109     
http://localhost        Restlet-Framework/2.0.4 -
2010-12-29 14:09:03.015 INFO net.spy.memcached.MemcachedConnection:  Added {QA 
sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, 
topWop=null, toWrite=0, interested=0} to connect queue
2010-12-29 14:09:03.046 INFO net.spy.memcached.MemcachedConnection:  Connection 
state changed for sun.nio.ch.selectionkeyi...@a6cbf7
Dec 29, 2010 2:09:03 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:09:03        127.0.0.1       
994c5d66-d47c-47b1-9b5d-2f5509e653c7    -       80      PUT     
/casp/cmgi/tenant/organization  -       200     -       -       78      
http://localhost        Restlet-Framework/2.0.4 -
2010-12-29 14:10:05.167 INFO net.spy.memcached.MemcachedConnection:  Added {QA 
sa=localhost/127.0.0.1:11211, #Rops=0, #Wops=0, #iq=0, topRop=null, 
topWop=null, toWrite=0, interested=0} to connect queue
2010-12-29 14:10:05.198 INFO net.spy.memcached.MemcachedConnection:  Connection 
state changed for sun.nio.ch.selectionkeyi...@6b62d1
Dec 29, 2010 2:10:05 PM org.restlet.resource.UniformResource doCatch
WARNING: Exception or error caught in resource
java.lang.NullPointerException
        at 
org.restlet.representation.ObjectRepresentation.<init>(ObjectRepresentation.java:71)
        at 
com.sios.caspian.tenant.service.Organization.createOrganization(Organization.java:101)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:446)
        at org.restlet.resource.ServerResource.put(ServerResource.java:1170)
        at org.restlet.resource.ServerResource.doHandle(ServerResource.java:521)
        at 
org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:587)
        at 
org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:299)
        at org.restlet.resource.ServerResource.handle(ServerResource.java:846)
        at org.restlet.resource.Finder.handle(Finder.java:510)
        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:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        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:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        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:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        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.routing.Filter.handle(Filter.java:203)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at 
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
        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:388)
        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:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        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:497)
        at org.restlet.routing.Router.handle(Router.java:737)
        at org.restlet.routing.Filter.doHandle(Filter.java:156)
        at 
org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
        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:387)
        at org.restlet.Server.handle(Server.java:488)
        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(Unknown 
Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Dec 29, 2010 2:10:05 PM org.restlet.engine.log.LogFilter afterHandle
INFO: 2010-12-29        14:10:05        127.0.0.1       
994c5d66-d47c-47b1-9b5d-2f5509e653c7    -       80      PUT     
/casp/cmgi/tenant/organization  -       500     486     0       78      
http://localhost        Restlet-Framework/2.0.4 -

Regards,
RK.

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

Reply via email to