Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problem with Socket connection when running JUnit
Problem with Socket connection when running JUnit [message #210330] Wed, 20 July 2005 15:37 Go to next message
Eclipse UserFriend
Originally posted by: kpram.dartmouth.edu

I am unable to run my JUnit tests from within eclipse, after being able
to do so for several weeks.
When I attempt to run or debug a unit test, I get an exception:
Could not connect to: : 33048
java.net.SocketException: Invalid argument or cannot assign requested
address
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.ja va:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at java.net.Socket.<init>(Socket.java:309)
at java.net.Socket.<init>(Socket.java:124)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.conne ct(RemoteTestRunner.java:744)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:326)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:186)

This error doesn't happen when I run the test from the command line.
The socket number goes up by 21 every time.

The lowest socket number I made note of was 32771, which is suspiciously
close to 2^15. There were a handful of failures before I noted that number.

Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't
help. Making a new project didn't help.

I can see java listening on the socket via netstat, but I don't know why
the connection is failing.

Any suggestions? I'm stumped.
Re: Problem with Socket connection when running JUnit [message #210345 is a reply to message #210330] Wed, 20 July 2005 16:20 Go to previous messageGo to next message
Przemyslaw Doe is currently offline Przemyslaw DoeFriend
Messages: 49
Registered: July 2009
Member
Have you any firewalls active?


"Kevin Mitcham" <kpram@dartmouth.edu> schrieb im Newsbeitrag
news:dblr4d$uf6$1@news.eclipse.org...
>I am unable to run my JUnit tests from within eclipse, after being able to
>do so for several weeks.
> When I attempt to run or debug a unit test, I get an exception:
> Could not connect to: : 33048
> java.net.SocketException: Invalid argument or cannot assign requested
> address
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
> at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.ja va:171)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
> at java.net.Socket.connect(Socket.java:452)
> at java.net.Socket.connect(Socket.java:402)
> at java.net.Socket.<init>(Socket.java:309)
> at java.net.Socket.<init>(Socket.java:124)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.conne ct(RemoteTestRunner.java:744)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:326)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:186)
>
> This error doesn't happen when I run the test from the command line.
> The socket number goes up by 21 every time.
>
> The lowest socket number I made note of was 32771, which is suspiciously
> close to 2^15. There were a handful of failures before I noted that
> number.
>
> Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't help.
> Making a new project didn't help.
>
> I can see java listening on the socket via netstat, but I don't know why
> the connection is failing.
>
> Any suggestions? I'm stumped.
Re: Problem with Socket connection when running JUnit [message #210361 is a reply to message #210345] Wed, 20 July 2005 16:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kpram.dartmouth.edu

A firewall is active, but was active before the problem started to occur.

In addition, I opened a port on the firewall corresponding to the next
socket that would be attempted, and the socket still failed to open,
with an identical message (except a change in the socket number) to runs
with the wall closed.

I would rather not drop the entire firewall for what should be a purely
local connection.

Kevin
Re: Problem with Socket connection when running JUnit [message #210431 is a reply to message #210330] Thu, 21 July 2005 00:29 Go to previous messageGo to next message
Eddie Man is currently offline Eddie ManFriend
Messages: 102
Registered: July 2009
Senior Member
Are you using jdk 1.4.2 under Linux and just update the kernel? I have
the same situation with you, after using the old kernel or using jdk 1.5
the problem was fixed.

Kevin Mitcham wrote:
> I am unable to run my JUnit tests from within eclipse, after being able
> to do so for several weeks.
> When I attempt to run or debug a unit test, I get an exception:
> Could not connect to: : 33048
> java.net.SocketException: Invalid argument or cannot assign requested
> address
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
> at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.ja va:171)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
> at java.net.Socket.connect(Socket.java:452)
> at java.net.Socket.connect(Socket.java:402)
> at java.net.Socket.<init>(Socket.java:309)
> at java.net.Socket.<init>(Socket.java:124)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.conne ct(RemoteTestRunner.java:744)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:326)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:186)
>
>
> This error doesn't happen when I run the test from the command line.
> The socket number goes up by 21 every time.
>
> The lowest socket number I made note of was 32771, which is suspiciously
> close to 2^15. There were a handful of failures before I noted that
> number.
>
> Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't
> help. Making a new project didn't help.
>
> I can see java listening on the socket via netstat, but I don't know why
> the connection is failing.
>
> Any suggestions? I'm stumped.
Re: Problem with Socket connection when running JUnit [message #210490 is a reply to message #210431] Thu, 21 July 2005 14:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kpram.dartmouth.edu

I was using 1.4.2 under the new kernel. As you say, using 1.5 or the
previous kernel solves the problem. Thank you very much!

Kevin

eddie wrote:
> Are you using jdk 1.4.2 under Linux and just update the kernel? I have
> the same situation with you, after using the old kernel or using jdk 1.5
> the problem was fixed.
>

>>
>> This error doesn't happen when I run the test from the command line.
>> The socket number goes up by 21 every time.
>>
>> The lowest socket number I made note of was 32771, which is
>> suspiciously close to 2^15. There were a handful of failures before I
>> noted that number.
>>
>> Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't
>> help. Making a new project didn't help.
>>
>> I can see java listening on the socket via netstat, but I don't know
>> why the connection is failing.
>>
>> Any suggestions? I'm stumped.
Re: Problem with Socket connection when running JUnit [message #217462 is a reply to message #210490] Thu, 20 October 2005 19:37 Go to previous message
Luca Di Stefano is currently offline Luca Di StefanoFriend
Messages: 41
Registered: July 2009
Member
--=-q65NfRoS0Nu8PCv0GeJD
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,

I had the same problem: take care to have a default constructor in your
test case class, not only the one with the string parameter.

hope that helps,

Luca


On Thu, 2005-07-21 at 10:42 -0400, Kevin Mitcham wrote:

> I was using 1.4.2 under the new kernel. As you say, using 1.5 or the
> previous kernel solves the problem. Thank you very much!
>
> Kevin
>
> eddie wrote:
> > Are you using jdk 1.4.2 under Linux and just update the kernel? I have
> > the same situation with you, after using the old kernel or using jdk 1.5
> > the problem was fixed.
> >
>
> >>
> >> This error doesn't happen when I run the test from the command line.
> >> The socket number goes up by 21 every time.
> >>
> >> The lowest socket number I made note of was 32771, which is
> >> suspiciously close to 2^15. There were a handful of failures before I
> >> noted that number.
> >>
> >> Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't
> >> help. Making a new project didn't help.
> >>
> >> I can see java listening on the socket via netstat, but I don't know
> >> why the connection is failing.
> >>
> >> Any suggestions? I'm stumped.

--=-q65NfRoS0Nu8PCv0GeJD
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.6.2">
</HEAD>
<BODY>
Hi,<BR>
<BR>
I had the same problem: take care to have a default constructor in your test case class, not only the one with the string parameter.<BR>
<BR>
hope that helps,<BR>
<BR>
Luca<BR>
<BR>
<BR>
On Thu, 2005-07-21 at 10:42 -0400, Kevin Mitcham wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I was using 1.4.2 under the new kernel. As you say, using 1.5 or the </FONT>
<FONT COLOR="#000000">previous kernel solves the problem. Thank you very much!</FONT>

<FONT COLOR="#000000">Kevin</FONT>

<FONT COLOR="#000000">eddie wrote:</FONT>
<FONT COLOR="#000000">&gt; Are you using jdk 1.4.2 under Linux and just update the kernel? I have </FONT>
<FONT COLOR="#000000">&gt; the same situation with you, after using the old kernel or using jdk 1.5 </FONT>
<FONT COLOR="#000000">&gt; the problem was fixed.</FONT>
<FONT COLOR="#000000">&gt; </FONT>

<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; This error doesn't happen when I run the test from the command line.</FONT>
<FONT COLOR="#000000">&gt;&gt; The socket number goes up by 21 every time.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; The lowest socket number I made note of was 32771, which is </FONT>
<FONT COLOR="#000000">&gt;&gt; suspiciously close to 2^15. There were a handful of failures before I </FONT>
<FONT COLOR="#000000">&gt;&gt; noted that number.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Upgrading eclipse to 3.1 didn't help. Making a new workspace didn't </FONT>
<FONT COLOR="#000000">&gt;&gt; help. Making a new project didn't help.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; I can see java listening on the socket via netstat, but I don't know </FONT>
<FONT COLOR="#000000">&gt;&gt; why the connection is failing.</FONT>
<FONT COLOR="#000000">&gt;&gt;</FONT>
<FONT COLOR="#000000">&gt;&gt; Any suggestions? I'm stumped.</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-q65NfRoS0Nu8PCv0GeJD--
Previous Topic:TimeoutExceptions in Debugger
Next Topic:Bogus ecj error?
Goto Forum:
  


Current Time: Tue Mar 19 06:47:10 GMT 2024

Powered by FUDForum. Page generated in 0.02631 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top