LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem in Java with ports.... (https://www.linuxquestions.org/questions/programming-9/problem-in-java-with-ports-380142/)

vivekr 11-05-2005 05:38 AM

Problem in Java with ports....
 
Hi to all.
I am actually struggling a lot. I desperately need some help.
It all started some months before. Initially I was working in java using Forte Java(I am afraid I dont remember the exact version) in Windows XP. initially it was working well. Suddenly it popped up a message like it couldnt reach or handle some port-So it cant execute servlets. From then on a lot of probs crept in- I couldnt trace the program. Every time I compiled the prog some msgs kept popping up. So I uninstalled the s/w.

Later when I tried Apache Tomcat(V5.0 ,V5.5) both of them failed to connect to the local loopback port(127.0.0.1). Its not popping up any errors but shows the message Page cannot be found.


When I tried to run networking programs written in Java the showed the same error---

:confused: "Socket Exception---(blah blah) : JVM_BIND" (Now I dont remember the exact exception thrown)

Worse was, a month back I gave net connection to my comp. I am able to connect to Internet without any problem in Linux(Fedora Core 3). However , in Windows XP I couldnt do the same. I couldnt connect to the network at all.

I used "ping" to connect to networks. It works fine, sending(say 60-80) and receiving(5-10) packets.

Now, the problem is I have all my works stored in XP. So I cant move as such to Linux now. I also need XP for few s/ws available specifically only for Windows.

So can anybody help me with a soln. I would be extremely happy if anyone of u can help me out of this problem.:cry:

An advance thanks to anyone cares for helping me to get rid of this problem

jaristr 11-05-2005 07:32 AM

Well I don't know much about java but since you mentioned JVM_BIND I think that binding the server to port fails because the port is already in use. What you need to do is to either try another port or set some attribute so before calling bind that it forces socket to bind on the port even if its already used.
Sorry that I don't know how to do this in java but here's couple links that might help:

http://swforum.sun.com/jive/thread.j...44757&tstart=0
http://www.jboss.org/?module=bb&op=viewtopic&t=67937

try "java bind JVM_BIND" in google for more.

mrcheeks 11-05-2005 08:00 AM

You need to make sure the server has stopped completely before running it. If another server is running at the adress or the process didn't die, you will have a message saying tomcat cannot bind the desired port.

vivekr 11-06-2005 02:38 AM

Thanks 4 the response.

Actually I have used TCPViewer before and it popped up the message
"Connection Exception: 10098"

And i have oracle's Apache server on my machine. But I am not using ports 8080 and <1024. But still its not working.
Actually in my post I have written
" Worse was, a month back I gave net connection to my comp. I am able to connect to Internet without any problem in Windows. However , in Windows XP I couldnt do the same. I couldn't connect to the network at all. "

Actually now I am working with the internet using Linux(Fedora Core 3). That was a small typing mistake.


All times are GMT -5. The time now is 08:47 PM.