Fedora Linux Support Community & Resources Center
Sections ›› Home | Forums | Guidelines | Forum Help | Fedora FAQ | Fedora News 

Go Back   FedoraForum.org > Fedora Support > Networking

Networking Networking with Fedora such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2005-06-16, 09:20 AM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
Problem with java opening network connection

Hi I am running fedora core (fc4 32bit) and when i run simple test program from java i get the following error :

java.net.SocketException: Invalid argument or cannot assign requested address

All programs (e.g. tomcat) have the same error when executing code trying to use the network however the same version of java running on solaris os has no problem and the program executes flawlessly.

Does anyone know what might be going on?

Thanks

Last edited by ramman; 2005-06-16 at 09:30 AM CDT.
Reply With Quote
  #2  
Old 2005-06-16, 09:26 AM CDT
bytesniper's Avatar
bytesniper Offline
Registered User
 
Join Date: May 2005
Location: Abq, NM
Age: 32
Posts: 1,153
fc3? fc4? 32bit? 64bit? did you install an actual version of Java from sun or are you using the gcj that comes with fedora? whats the output of java -version?
__________________
I am root. If you see me laughing you better have a backup.
Reply With Quote
  #3  
Old 2005-06-16, 09:28 AM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
fc4 32bit. I installed the actual version of java from sun that i downloaded.

java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)



Quote:
Originally Posted by bytesniper
fc3? fc4? 32bit? 64bit? did you install an actual version of Java from sun or are you using the gcj that comes with fedora?

Last edited by ramman; 2005-06-16 at 09:38 AM CDT.
Reply With Quote
  #4  
Old 2005-06-16, 10:31 AM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
help needed badly

Please if anyone could help , any suggestions? I need help
Reply With Quote
  #5  
Old 2005-06-16, 11:53 AM CDT
bytesniper's Avatar
bytesniper Offline
Registered User
 
Join Date: May 2005
Location: Abq, NM
Age: 32
Posts: 1,153
i did some searching related to that error and im assuming that the application that your using to test is azureus since evertyime i found this error it was with azureus. what i found is one of two things:

1) something else is using the port that azureus is trying to bind to (6881)
2) your loopback interface is not listening. ifconfig lo 127.0.0.1 up
__________________
I am root. If you see me laughing you better have a backup.
Reply With Quote
  #6  
Old 2005-06-16, 12:38 PM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
unforunately no, it has nothong to do with that. The problem occurs on my test program which i wrote which just opens a url connection to an address and tries to get information from it.

It works fine on sun solaris but for some reason its just not working on fc4. I found the problem after trying to test a test query from tomcat to mysql through the network. I got this error message (above) and then i wrote the following test program which gives me the same socket error. There is nothing already bound to the port that it should be using.
Also I should mention that i deliberately configured this fc44 installation with no firewall or network security.


import java.io.*;
import java.net.*;

public class network_test {

public static void main(String [] args) {


try {
System.out.println("aa22222");
URL u = new URL("http://www.google.com");
InputStream in = u.openStream();
System.out.println("a");
int b;
while ((b = in.read()) != -1) {
System.out.write(b);
}
System.out.println("B");

} catch (Exception ex) {
ex.printStackTrace();
}
}

}

Quote:
Originally Posted by bytesniper
i did some searching related to that error and im assuming that the application that your using to test is azureus since evertyime i found this error it was with azureus. what i found is one of two things:

1) something else is using the port that azureus is trying to bind to (6881)
2) your loopback interface is not listening. ifconfig lo 127.0.0.1 up

Last edited by ramman; 2005-06-16 at 12:42 PM CDT.
Reply With Quote
  #7  
Old 2005-06-16, 01:17 PM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
heres the output btw:

aa22222
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(PlainSoc ketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.j ava:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java :139)
at sun.net.www.http.HttpClient.openServer(HttpClient. java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient. java:618)
at sun.net.www.http.HttpClient.<init>(HttpClient.java :306)
at sun.net.www.http.HttpClient.<init>(HttpClient.java :267)
at sun.net.www.http.HttpClient.New(HttpClient.java:33 9)
at sun.net.www.http.HttpClient.New(HttpClient.java:32 0)
at sun.net.www.http.HttpClient.New(HttpClient.java:31 5)
at sun.net.www.protocol.http.HttpURLConnection.plainC onnect(HttpURLConne
ction.java:521)
at sun.net.www.protocol.http.HttpURLConnection.connec t(HttpURLConnection
.java:498)
at sun.net.www.protocol.http.HttpURLConnection.getInp utStream(HttpURLCon
nection.java:626)
at java.net.URL.openStream(URL.java:913)
at network_test.main(network_test.java:14)
Reply With Quote
  #8  
Old 2005-06-16, 02:10 PM CDT
kg4cbk Offline
Registered User
 
Join Date: Feb 2005
Posts: 675
You may want to try version jre-1_5_0_03-linux-i586.rpm. I had to get that version in order to get javaws to work correctly. Previous versions had a problem with the newer linux kernels.
Reply With Quote
  #9  
Old 2005-06-16, 02:12 PM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
Hmm good idea, i might try this , only problem is that i think i may have to upgrade components of apache and what not as well.

Thanks

Quote:
Originally Posted by kg4cbk
You may want to try version jre-1_5_0_03-linux-i586.rpm. I had to get that version in order to get javaws to work correctly. Previous versions had a problem with the newer linux kernels.
Reply With Quote
  #10  
Old 2005-06-16, 03:11 PM CDT
noky2 Offline
Registered User
 
Join Date: Jun 2005
Posts: 8
ramman, I had the same problem you did. I can confirm that using sun java 1.5.0_03 does indeed fix the problem.

What a pain! I'm a java developer using 1.4.2... I hope that this doesn't throw a monkey wrench into things. I already had to tweak my Eclipse settings to get it to pick up the proper JDK installation.

Now, if only I could get the java plugin to work... What a bad day, I should have never upgraded my development machine to FC4. :^(
Reply With Quote
  #11  
Old 2005-06-16, 03:13 PM CDT
ramman Offline
Registered User
 
Join Date: Jun 2005
Posts: 7
Thanks for your reply, i havent had a chance to check myself but what you said sounds like it must be the problem.

That is truly very annoying, I am not sure i will be able to get all the components of apache, tomcat, connector j and etc to work together under 1.5 so i think i may just go with a sun os installation instead.

Oh well.. thanks for the help guys.

Quote:
Originally Posted by noky2
ramman, I had the same problem you did. I can confirm that using sun java 1.5.0_03 does indeed fix the problem.

What a pain! I'm a java developer using 1.4.2... I hope that this doesn't throw a monkey wrench into things. I already had to tweak my Eclipse settings to get it to pick up the proper JDK installation.

Now, if only I could get the java plugin to work... What a bad day, I should have never upgraded my development machine to FC4. :^(
Reply With Quote
  #12  
Old 2005-06-16, 04:50 PM CDT
kg4cbk Offline
Registered User
 
Join Date: Feb 2005
Posts: 675
Solaris 10 is very nice.
Reply With Quote
  #13  
Old 2005-06-17, 09:17 AM CDT
laltopi's Avatar
laltopi Offline
Registered User
 
Join Date: Jun 2005
Posts: 106
I am having the same issue as well but with jdk1.5.0_03
I am also running FC4 32 bit - never had this issue with FC3 and the same version of java.

Did the upgrade solve your issue? Is there something more needed than the version upgrade?
Reply With Quote
  #14  
Old 2005-06-17, 09:23 AM CDT
noky2 Offline
Registered User
 
Join Date: Jun 2005
Posts: 8
laltopi, sun's jdk 1.5.0_03 works for Socket creation. Make sure you install from the .bin (not RPM). Also, make sure you explicitly use the java executable from that installation. There could be different flavors of java on your system.

Eg: If you installed in /opt/jdk-1.5.0_03, use: /opt/jdk-1.5.0_03/bin/java.

By default FC4 uses /usr/bin/java, which is created by "alternatives" and links to the FC4 default version of java. You might want to run alternatives to point to your new sun java install dir or alter your PATH env var.
Reply With Quote
  #15  
Old 2005-06-17, 09:25 AM CDT
kg4cbk Offline
Registered User
 
Join Date: Feb 2005
Posts: 675
Did you verify that you are using the correct version of java? I have seen systems where there are several versions installed and depending on pathing you may be using the wrong one.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rhythmbox not opening an SFTP connection? SteveT Software 4 2008-09-16 12:29 AM CDT
Re: FC4 (x)maple 9.5.2 "connection to kernel lost", java problem? J.F. Vasconcelos gmane.linux.redhat.fedora.general 5 2005-08-05 03:05 AM CDT
Re: FC4 (x)maple 9.5.2 "connection to kernel lost", java problem? J.F. Vasconcelos gmane.linux.redhat.fedora.general 0 2005-08-05 02:43 AM CDT
Re: FC4 (x)maple 9.5.2 "connection to kernel lost", java problem? Des Johnston gmane.linux.redhat.fedora.general 0 2005-08-05 01:46 AM CDT
FC4 (x)maple 9.5.2 "connection to kernel lost", java problem? Des Johnston gmane.linux.redhat.fedora.general 3 2005-08-05 01:42 AM CDT

Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Yiddish

All times are GMT -7. The time now is 08:42 PM CST.

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
Hosting provided by ThePlanet



All trademarks, and forum posts in this site are property of their respective owner(s).

FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact | Founding Members
Designed By Ewdison Then | Powered by vBulletin ©2000-2009, Jelsoft Enterprises Ltd.
FedoraForum is Powered by Open Source Projects and Products
Translations made by vBET