[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Java 7 Problem - SocketException: Permission denied  XML
Forum Index -> Deployment
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Hi,

in one scenario we experience the problem that we receive a SocketException showing up in the client after starting.


Code:
ava.net.SocketException: Permission denied: connect
 
                 at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
 
                 at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
 
                 at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
 
                 at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
 
                 at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
 
                 at java.net.PlainSocketImpl.connect(Unknown Source)
 
                 at java.net.SocksSocketImpl.connect(Unknown Source)
 
                 at java.net.Socket.connect(Unknown Source)
 
                 at sun.net.NetworkClient.doConnect(Unknown Source)
 


The problem does not occur when setting "-Djava.net.preferIPv4Stack=true" in the VM Parameters, but we currently fail to pass these parameters as part of the JNLP file (same with HTML-applet file).

It has to do with the usage of ipV6 instead of ipV4, it only occurs in certain scenarios...

Does anyone of you already gained experience on this? Would be greeeeat to let me/us know, what you did...

Thanks + regards! Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

Some more infos about this issue - in the meantime things are clarified...:

From Java7 on Java uses by default ipV6 as communication protocol - and if not available ipV4. This should normally not be an issue at all, BUT if the network infrastructure around Java is not correctly set up then this might cause the error as shown at the beginning of this thread.

In the concrete case it was the virus checker that seems to provide an ipv6 protocol to the environment, but which did not really work. All programs using ipV6 (and one of them being Java...) failed as consequence. After disabling the network firewall of the antivirus program, everything worked fine.

You may configure Java to use the ipV4 layer by default, by specifying the Java runtime parameters java.net.preferIPv4Stack to "true". But...: the only way to do this is to add this parameters in the Java configuration as VM parameters (-Djava.net.preferIPv4Stack=true). You can NOT add the parameter e.g. as part of the applet /jnlp definition - because the parameter is so called secure parameter, which cannot be set through applet/jnlp.

Consequence:
a. if the error occurs then this seems to have ntohing to do with Java, but with the network environment in which the Java process runs.
b. you can advise java to use ipV4 but the definition needs to be explicitly done on client side, it is not possible to pass the definition in the applet/jnlp definition

Further input on this is welcome, of course!
Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Deployment
Go to:   
Powered by JForum 2.1.6 © JForum Team