I didn't try a standalone Tomcat. And also I didn't try another JBoss AS or JRE.... I tried it in windows xp and it is working fine. So I feel that its not a problem with my JBoss or JRE. Some configuration missing or wrong in windows 7 OS....
Looking at the output it appears that the Java socket classes are being loaded from the correct JAR file. Thus I do not think that it is a problem with Java code. Also, since you already ran another application (the RMI one) and it got the same error, trying Tomcat or another version of JBoss AS probably will not help.
However the suggestion to try another JVM is worthwhile. The reason is that the JVMs use native libraries for sockets and if the native library that you have for JRE 6u20 is corrupt, changing to a different JVM would fix that. So give that a try.
If there is still a problem, then it could be caused by some other DLL. The best way to find that out is to get Process Explorer from sysinternals. In Process Explorer, select the java.exe process running JBoss AS. The DLLs loaded by the process appear in the bottom pane. You will need to add the Path and Time Stamp columns to the bottom pane (right-click the column header and choose Select Columns).
If you can't spot a suspicious DLL, then with java.exe still selected, do File | Save. The resulting text file contains the list of processes and the list of DLLs for java.exe. You might want to filter out the processes other than java.exe before posting the file to the forum. Maybe I can spot a suspicious DLL. If nothing else, I can at least compare to what I have.
Also, could you tell me a little bit about the physical environment in which you are doing this in. Is it a corporate network or a home network? Is Windows running on a physical box or in a VM? If a VM, what kind (and what host OS, if that applies).
At last my friend(Network Administrator) fixed this issue. He just saw my ipconfig and said that IPv6 is not disabled properly. And i did jsut 2 changes.
First he told me to change my hosts file
I commented the 2nd line.
Then i started my jboss server by run.bat -Djava.net.preferIPv4Stack=true
Using the extra option "-Djava.net.preferIPv4Stack=true" did the rest.
Thank you guys for helping me....