exception while putting object in s3: Address already in use

75 views
Skip to first unread message

reformy

unread,
Feb 22, 2010, 8:46:10 AM2/22/10
to JetS3t Users
Hi All,

I get this exception:
org.jets3t.service.S3ServiceException: S3 PUT connection failed for '/
079a0706-1355-485c-8af0-2156d1343e06-investigatorArguments'
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.performRequest(RestS3Service.java:
491)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.performRestPut(RestS3Service.java:
775)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.createObjectImpl(RestS3Service.java:
1343)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.putObjectImpl(RestS3Service.java:
1261)
at
org.jets3t.service.S3Service.putObject(S3Service.java:1588)
...
Caused by: java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native
Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown
Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)

While I send a few requests in parallel (through SimpleJPA).
Any idea why this happens?

Thanks,
Yair

James Murty

unread,
Feb 22, 2010, 11:53:44 PM2/22/10
to jets3t...@googlegroups.com
Hi Yair,

I'm not sure why this would be happening. JetS3t doesn't create sockets at all beyond the usual mechanics required for outgoing HTTP/S connections. Whatever is causing the issue it's probably not specific to JetS3t.

I'm not familiar with SimpleJPA, have you tried asking about this in that project's forums?

Another thing worth trying is to turn off SSL so all connections are plain HTTP to see if that makes a difference.

James


--
You received this message because you are subscribed to the Google Groups "JetS3t Users" group.
To post to this group, send email to jets3t...@googlegroups.com.
To unsubscribe from this group, send email to jets3t-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jets3t-users?hl=en.


reformy

unread,
Feb 23, 2010, 10:56:14 AM2/23/10
to JetS3t Users
Hi James,
Thanks for the answer.
We tried it (using HTTP) and get the same exception (without the SSL
methods in the stack trace).
We tried running only one thread, and it worked well.
This is the new stack trace, maybe u can track the reason for opening
port here:

Caused by: java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native
Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown
Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at
sun.reflect.GeneratedMethodAccessor200.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:
140)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:
125)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:
707)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:
1361)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:
387)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:
171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
397)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:
323)
at
org.jets3t.service.impl.rest.httpclient.RestS3Service.performRequest(RestS3Service.java:
359)

Thanks.

On Feb 23, 6:53 am, James Murty <jamu...@gmail.com> wrote:
> Hi Yair,
>
> I'm not sure why this would be happening. JetS3t doesn't create sockets at
> all beyond the usual mechanics required for outgoing HTTP/S connections.
> Whatever is causing the issue it's probably not specific to JetS3t.
>
> I'm not familiar with SimpleJPA, have you tried asking about this in that
> project's forums?
>
> Another thing worth trying is to turn off SSL so all connections are plain
> HTTP to see if that makes a difference.
>
> James
>

> ---http://www.jamesmurty.com

> > jets3t-users...@googlegroups.com<jets3t-users%2Bunsu...@googlegroups.com>

James Murty

unread,
Feb 24, 2010, 1:14:54 AM2/24/10
to jets3t...@googlegroups.com
A possibility is that using multiple MultiThreadedHttpConnectionManager classes, a connection pooling utility provided by the HttpClient library, causes confusion in allocating a sockets at a system level. This seems unlikely but I suppose it's possible.

The RestS3Service implementation is intended to be shared between multiple threads, hence it relies on the MultiThreadedHttpConnectionManager to manage connection resources. I don't know what architecture is used by the SimpleJPA project but if different RestS3Service instances are started for each thread then it becomes impossible to manage connections in a central organised way.

However you're really going to have to take this up with the SimpleJPA folks. I'm just guessing.

James



To unsubscribe from this group, send email to jets3t-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages