This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 140000 - java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported.
Summary: java.io.IOException: The server sockets created using the LocalRMIServerSocke...
Status: CLOSED WONTFIX
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@profiler
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-15 08:45 UTC by Marian Mirilovic
Modified: 2009-12-03 03:25 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 74173


Attachments
stacktrace (533 bytes, text/plain)
2008-07-15 08:45 UTC, Marian Mirilovic
Details
stacktrace (533 bytes, text/plain)
2008-09-29 06:21 UTC, esmithbss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2008-07-15 08:45:22 UTC
Build: NetBeans IDE Dev (Build 200807101204)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Linux, 2.6.24-19-generic, amd64

User Comments: 
Running NB IDE on JDK 6u10 and run also visualwm from JDK6u7 at the same time ... this exception is thrown again and again .... so it makes IDE not usable
Comment 1 Marian Mirilovic 2008-07-15 08:45:30 UTC
Created attachment 64507 [details]
stacktrace
Comment 2 Marian Mirilovic 2008-07-15 09:11:15 UTC
Profiler guys would probably know what to do with this type of issue ...
Comment 3 lmalvent 2008-07-15 11:10:51 UTC
Check if the hostname correctly resolves to the host address.

Run the "hostname -i" command. If it reports 127.0.0.1, VisualVM would not be able to connect
through JMX to the JVM running on that Linux machine. To fix this issue, edit /etc/hosts such
that the hostname resolves to the host address.

The problem seems to be related to the encoded address in the RMI stubs exported by the RMI
connector server. RMI encodes "localhost" as the address instead of the machine's hostname
(this is probably due to an error in /etc/hosts).

I'm almost sure the problem will be resolved if you start your NetBeans IDE with:

-Djava.rmi.server.hostname=<hostname>

but please try to modify your /etc/hosts file to see something like this:

127.0.0.1       localhost.localdomain   localhost
129.157.209.37  myhost

Let me know if this works.

Regards,
Luis-Miguel Alventosa
JavaSE JMX/JConsole/VisualVM dev team
http://blogs.sun.com/lmalventosa
Comment 4 Marian Mirilovic 2008-07-25 14:30:37 UTC
hostname -i
127.0.1.1

I tried to run NB with 
-J-Djava.rmi.server.hostname=mylaptop
and end up with the same exception/warning ;(

/etc/hosts ...
127.0.0.1	localhost
127.0.1.1	mylaptop

Comment 5 Exceptions Reporter 2008-08-08 23:12:41 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=74173
Comment 6 Tomas Hurka 2008-08-19 14:46:01 UTC
This does not seem to be NetBeans Profiler problem. Can you try to use jconsole to attach to NetBeans?
Comment 7 mslama 2008-08-29 11:04:04 UTC
I have the same problem. Also with jconsole. Modifying /etc/hosts as suggested fixes this problem but it is not ideal
solution. We use here DHCP and I have some local hostname which was set as 
127.0.1.1	mslama-nb
in /etc/hosts. Now I changed IP to number assigned to my machine by DHCP as found from ifconfig. I am not expert in this
so it might be wrong to have local host name but I do not know how to set up this better.
Comment 8 Exceptions Reporter 2008-09-11 16:46:19 UTC
This issue has already 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=74173
Comment 9 esmithbss 2008-09-29 06:21:13 UTC
Build: NetBeans IDE Dev (Build 200809270201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28
OS: Linux, 2.6.24-21-generic, i386

User Comments: 
Attempted connecting VisualVM to the IDE for profiling.

Stacktrace: 
java.io.IOException: The server sockets created using the LocalRMIServerSocketFactory only accept connections from clients running on the host where the RMI remote objects have been exported.
        at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:71)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
        at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
        at java.lang.Thread.run(Thread.java:619)
Comment 10 esmithbss 2008-09-29 06:21:22 UTC
Created attachment 70760 [details]
stacktrace
Comment 11 Tomas Hurka 2008-09-29 08:59:59 UTC
This is Ubuntu only bug.
Comment 12 Tomas Hurka 2008-09-29 15:40:25 UTC
This a bug in JDK. I can reproduce this with Notepad and  JConsole. The problem is caused on Ubuntu, which has 
<hostname>    127.0.1.1
in /etc/hosts

Closing as WONTFIX.

Comment 13 Tomas Hurka 2008-09-29 15:40:46 UTC
The problem is fixed in JDK7.
Comment 14 Tomas Hurka 2008-10-06 12:47:09 UTC
Corresponding JDK bug is here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6754672
Comment 15 mslama 2009-01-22 11:44:07 UTC
Workaround is to modify beginning of your /etc/hosts from
127.0.0.1	localhost
127.0.1.1	mslama-nb
to
127.0.0.1	mslama-nb localhost.localdomain localhost
127.0.1.1	mslama-nb
where 'mslama-nb' is hostname of your machine. Then it works fine.
Comment 16 csrauk 2009-03-02 14:27:11 UTC
The problem is fixed in Sun JVM 1.6.0_12-b04.
Comment 17 Marian Mirilovic 2009-12-03 03:25:02 UTC
v/c