On Aug 30, 2010, at 2:23 PM, Morten wrote:
> Hi,
>
> I am using Jersey 1.3 on the server and jersey client for tests and  
> I am experiencing a strange unit test exception on one computer out  
> of six (fails on one, works fine on 5 computer, fails on just one).  
> We are using newest release versions of Java +  JDK 1.6_20 on Macs,  
> Windows and Linux.
>
> Everything works on my Mac but one team member (also on a Mac) gets  
> exceptions like the one below for ALL our webservice calls in  
> tests.  It seems to be client related as manual requests using a  
> browser works just fine also for him. At first we used Jersey 1.2  
> but upgrading to newest version of Jersey and newest embedded  
> grizzly did not change anything. I also have removed all  
> authentication without any improvement.
>
> Any ideas for what could cause this ? A bug in jersey ? Machine  
> configuration ? Any suggestions for how to find out more ?
>
This seems to be a resource issue with the machine. The stack trace  
goes all the way to socket creation so i doubt it is directly a Jersey  
issue. Perhaps check the maven/JVM options being used?
I suspect you might be able to reproduce by writing a simple Java app  
using HttpURLConnection directly.
> P.S: Maybe I should ask him to run the build in tests for the jersey  
> project? What is the easiest way to do that (what to download?)
>
You will need to check out Jersey do to that:
   
https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html 
#d4e1772
Paul.
>   [junit] com.sun.jersey.api.client.ClientHandlerException:  
> java.net.ConnectException: Cannot allocate memory
>    [junit] at  
> com 
> .sun 
> .jersey 
> .client 
> .urlconnection 
> .URLConnectionClientHandler.handle(URLConnectionClientHandler.java: 
> 128)
>    [junit] at com.sun.jersey.api.client.Client.handle(Client.java:569)
>    [junit] at  
> com.sun.jersey.api.client.WebResource.handle(WebResource.java:556)
>    [junit] at  
> com.sun.jersey.api.client.WebResource.post(WebResource.java:219)
>    [junit] at com.myapp.api.control.remote.WebServiceApiImpl 
> $ 
> AsynchronousBackupServiceInvokerAdaptor.clear(WebServiceApiImpl.java: 
> 84)
>    [junit] at  
> com 
> .myapp 
> .ws 
> .controller 
> .activities.ActivitiesTest.remoteInvoke(ActivitiesTest.java:387)
>    [junit] at  
> com 
> .myapp 
> .ws 
> .controller 
> .activities.ActivitiesTest.getActivities(ActivitiesTest.java:164)
>    [junit] Caused by: java.net.ConnectException: Cannot allocate  
> memory
>    [junit] at java.net.PlainSocketImpl.socketConnect(Native Method)
>    [junit] at  
> java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>    [junit] at  
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>    [junit] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java: 
> 182)
>    [junit] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java: 
> 432)
>    [junit] at java.net.Socket.connect(Socket.java:529)
>    [junit] at sun.net.NetworkClient.doConnect(NetworkClient.java:158)
>    [junit] at sun.net.www.http.HttpClient.openServer(HttpClient.java: 
> 394)
>    [junit] at sun.net.www.http.HttpClient.openServer(HttpClient.java: 
> 529)
>    [junit] at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
>    [junit] at sun.net.www.http.HttpClient.New(HttpClient.java:306)
>    [junit] at sun.net.www.http.HttpClient.New(HttpClient.java:323)
>    [junit] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient 
> (HttpURLConnection.java:860)
>    [junit] at  
> sun 
> .net 
> .www 
> .protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java: 
> 801)
>    [junit] at  
> sun 
> .net 
> .www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java: 
> 726)
>    [junit] at sun.net.www.protocol.http.HttpURLConnection.getInputStream 
> (HttpURLConnection.java:1049)
>    [junit] at  
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
>    [junit] at  
> com 
> .sun 
> .jersey 
> .client 
> .urlconnection 
> .URLConnectionClientHandler._invoke(URLConnectionClientHandler.java: 
> 215)
>    [junit] at  
> com 
> .sun 
> .jersey 
> .client 
> .urlconnection 
> .URLConnectionClientHandler.handle(URLConnectionClientHandler.java: 
> 126)
>    [junit]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>