Loopback connection fail
Asked Answered
M

4

6

I have probably one of the weirdest problems with Java ever. I tried to start some application say Wrapper (i.e. I2P router) and got the following:

-piece of the router log-

03.12.12 21:07:31 ERROR [JobQueue 1/1] p.router.transport.UPnPManager: UPnP start failed - port   conflict?

03.12.12 21:07:31 CRIT  [JobQueue 1/1] ter.transport.ntcp.EventPumper: Error opening the NTCP selector
java.io.IOException: Unable to establish loopback connection
Caused by: java.net.SocketException: Permission denied: listen

-piece of the wrapper log-

2012/12/02 14:28:29 | Unable to bind routerconsole to 127.0.0.1 port 7657: java.net.SocketException: Permission denied: listen failed
2012/12/02 14:28:29 | You may ignore this warning if the console is still available at http://localhost:7657
2012/12/02 14:28:30 | WARNING: Error starting SelectChannelConnector@::1:7657: java.io.IOException: Unable to establish loopback connection
2012/12/02 14:28:30 | java.io.IOException: Unable to establish loopback connection
2012/12/02 14:28:30 | WARNING: Error starting one or more listeners of the Router Console server.
2012/12/02 14:36:41 | CRIT  [istener:7654] er.client.ClientListenerRunner: I2CP error listening to port 7654 - is another I2P instance running? Resolve conflicts and restart

On the developers forum I was told that it could be possibbly that I hadnt a loopback address at all. Which is unlikely to be. I have other application which work with the loopback address, also I switched off the IPv6, put all the neccessary options to ignore IPv6 in wrapper. Next I tried to start wrapper under the admin aacount, tried to install all the stuff including Java under the admin account - completelly useless.

I didnt find any reasonable answer on any foruma. Always it was about the firewall. But I turned it off, I deinstalled it, switched Windows firewall off under the admin account.

And also I opened all the necessary ports on my wi-fi router. Other programs like Privoxy work well with loopback connection and ports, but if I check online ofcourse I get a message that all my ports blocked, which I consider as to be wrong.

My operating system is Windows 7 64bit, my wi-fi router is Speedport 723v.

I thank everybody in advance for answers.

Marrissa answered 4/12, 2012 at 7:45 Comment(1)
I forgot to say -Djava.net.preferIPv4Stack=true didnt help either.Marrissa
A
4

It was the same problem with I2P and jre7u25

Fixed editing wrapper.config by adding -Djava.net.preferIPv4Stack=true to jawa paramenters:

wrapper.java.additional.5=-Di2p.dir.config="C:\ProgramData\Application Data\i2p" -Djava.net.preferIPv4Stack=true
Amenable answered 21/7, 2013 at 11:58 Comment(0)
S
1
2012/12/02 14:28:29 | Unable to bind routerconsole to 127.0.0.1 port 7657: java.net.SocketException: Permission denied: listen failed
2012/12/02 14:28:29 | You may ignore this warning if the console is still available at http://localhost:7657

The problem is not that you don't have a loopback address. You have it, but your Java process is not allowed to create a socket connection. You get a Permission denied exception, which means that your policy file doesn't allow your class to bind a socket to local port 7657.

Did you try looking at your JRE's policy file?

Try running your program (or wrapper; not sure exactly what you're running...) with the java.security.debug system property: http://docs.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/debugger.html#jsdp

Suttle answered 4/12, 2012 at 7:52 Comment(13)
At least JRE's policy wasnt changed. I'll try to look later at this file according to ccts.ascc.net/download/java_policy.pdf.Marrissa
See my edited answer for explanation how to trace Java security issues.Suttle
For example here forums.oracle.com/forums/thread.jspa?threadID=2091510 was one in some sense similar to my problem and the answer was > Nothing to do with the firewall. > It is a Java security issue. See java.net.SocketPermission. You need to grant yourself this permission in the applicable .policy file.Marrissa
Exactly as I wrote above. Indeed. When you install a standalone JRE, typically the policy file is such that it allows (almost) everything. However, very often, containers (or wrappers) provide their own replacement policy files that are rather restrictive, for security purposes. You should find which policy file is being used, and adjust it accordingly. The trace instructions I outlined in my (edited) answer could help.Suttle
But then: > I'm sorry I was dead wrong. It is an O/S access control or firewall problem, nothing to do with Java permissions.Marrissa
I don't think that a firewall issue would result in a SecurityException; typically you'd get a different kind of error (such as a generic "failure" sort of error), because a firewall might not reply with "sorry, you're not allowed to open this port"; it might simply fail the request with no explanation. If it's not a policy file problem, then it's likelier to be an OS access control issue than a firewall issue.Suttle
Thanx for the answer, Sorry, I'm new to this forum so where to find Yout edited answer ?Marrissa
It appears in place of the previous answer. You could notice that I edited it and added some info at the end.Suttle
I dont think I2P router was bult so stupid that it replaces default policy file with its own blocking its own permissions. Sorry, just my guessMarrissa
Ah, Ok I just gotta renew the pageMarrissa
Well, the java.security.debug trace should be able to reveal exactly where the problem originates.Suttle
Found some stuff for Windows 7 Home for some service: Click on the "Access Control" tab. Under "Loopback Connections" check the option "Allow loopback connections". Press "OK" to save. Will try, but not sure. Yes, it's about OS access control which is at least for now the most likely to beMarrissa
Unfortunatelly I cant modify this program. I dont know how to debug itMarrissa
M
0

Ok, I think a t least the step with establishing a loopback connection resolved.

I guess this could be useful for further users who would like to suppot I2P project.

So, I downgraded JDK to 1.6, reinstalled everything and deleted completelly every entry of the firewall software (in my case Agnitum).

After that the console was able to start.

Marrissa answered 4/12, 2012 at 19:1 Comment(0)
S
0

In windows, try restarting the pc, it worked for me. This error occurs when the application is trying to connect to a remote database and internet connection is lost (this is one of the reason).

Sixtieth answered 11/10, 2018 at 8:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.