socket connection problem in web start 6

hello,

my client-server program which uses socket and rmi communication was working perfectly with java 5. it seems broken with java 6 on some machines (it works fine on my machine so i cannot inspect it in detail)

rmi and socket communications works well within standalone applications. problem arises with java web start. below is the stack trace of an unsuccesfull socket creation attempt. rmi fails with similar stack trace

that machine has a new java6 installation and known to run the application without problems with java 5. any ideas ?

java.net.MalformedURLException: unknown protocol: socket

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URI.toURL(Unknown Source)

at com.sun.deploy.net.proxy.DeployProxySelector.connectFailed(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at NetTest.connect(NetTest.java:7)

at NetTest.main(NetTest.java:16)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.sun.javaws.Launcher.executeApplication(Unknown Source)

at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

for the curious the program may be found at http://www.aptalkarga.com/en

r a f t

[1919 byte] By [r_a_f_ta] at [2007-11-26 13:56:33]
# 1

hello,

this seems to be a proxy related problem. we have made some more tests and find out the following. command line and web start ProxySelector's returns different proxies for the same URI on the same machine

i guess this may be a bug. i dont know much about proxies, so can anyone please comment on the output below:

ProxySelector selector = ProxySelector.getDefault();

System.out.println("selector: " + selector);

URI uri = new URI("socket://www.aptalkarga.com:9998");

for (Proxy p : list = selector.select(uri)) {

System.out.println(p.type() + ": " + p + ": " + p.getClass() + ", address: " + p.address());

}

command line output

selector: sun.net.spi.DefaultProxySelector@141d683

DIRECT: DIRECT: class java.net.Proxy, address: null

web start output

selector: com.sun.deploy.net.proxy.DeployProxySelector@1faba46

SOCKS: SOCKS @ /10.10.10.18:8080: class java.net.Proxy, address: /10.10.10.18:8080

r a f t

r_a_f_ta at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 2

Hello Raft,

I have same problem like you.

My application cannot run in java web start 6, but it run in java web start 1.5

Nothing problem when I compiled & run for test. Just cannot run di java web start.

java.net.MalformedURLException: unknown protocol: socket

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URI.toURL(Unknown Source)

at com.sun.deploy.net.proxy.DeployProxySelector.connectFailed(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:147)

at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)

at com.mysql.jdbc.Connection.<init>(Connection.java:1531)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at cku.project.ProjectControlDB.<init>(ProjectControlDB.java:49)

at cku.order.OrderProc.<init>(OrderProc.java:340)

at cku.order.OrderControl.openDB(OrderControl.java:22)

at cku.order.OrderControl.main(OrderControl.java:33)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.sun.javaws.Launcher.executeApplication(Unknown Source)

at com.sun.javaws.Launcher.executeMainClass(Unknown Source)

at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)

at com.sun.javaws.Launcher.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Is there any suggestion about it?

Do you has fixed the problem?

thx,

cikcik

Message was edited by:

cikciks

cikciksa at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 3

hi cikciks,

nope, i cant reproduce the problem on my box, so there's no progress on my side. i believe this is a proxy related java bug but i'm not sure exactly what it's

if you still have both web start 5 and 6, and the problem persist with web start 6,

can you please run the following program with both and post the output here. i hope this may clearify things

http://www.aptalkarga.com/jws/socks.jnlp

r a f t

r_a_f_ta at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 4

With Java 6 I get the same error:

java.net.MalformedURLException: unknown protocol: socket

...from your SOCKS test application as well as from my own.

Java Web Start works fine when I run my application from my local Tomcat, but not when I want to connect to the Tomcat on my web-server.

Are there any news on this issues? Any workaround? Anything I can tell my users besides "Don't use Java 6!"? :-)

Does anyone know if this has been submitted as a bug? How can bugs to Java be submitted anyways?

Hope to get a quick anser on this - I feel kinda stranded!

Alex

P.S. - My application is xinco DMS: http://www.xinco.org

To see the error, try the demo system: http://xinco.org:8080/xinco_demo/

alexmanesa at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 5

Tried it on my machine and it throws the exception when I have my Java 1.6 Network Settings set to Use Browser Settings.

It even shows some bogus ip ip in the console.

However if I set it to direct connection, the problem goes away.

My browser settings are set to direct connection so obviously Java 1.6 Webstart is picking up the values wrongly.

The_SaiNta at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 6

it seems to be a bug. i've reported it but my report is rejected since it's relevant with: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6484949

problem arises if there is a disabled proxy setting in browser.

there are two solutions/workarounds: you may either set web start to use direct connection or clean that disabled proxy setting from browser

if there's no disabled proxy setting than it's possibly another case related to this bug

hope this helps

r a f t

r_a_f_ta at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...
# 7

I have the same problem with my web start app in Win Xp, default browser FireFox 2.0 and the setting "Direct connection to the internet". I get an exception that I can't catch myself:

Java.net.MalformedURLException: unknown protocol: socket

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URL.<init>(Unknown Source)

at java.net.URI.toURL(Unknown Source)

at com.sun.deploy.net.proxy.DeployProxySelector.connectFailed(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at java.net.Socket.<init>(Unknown Source)

at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)

at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:90)

at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:157)

at java.lang.Thread.run(Unknown Source)

This happens when the software tries a connection to a ssh tunnel that is not up at the time. I guess it has something to do with the fact that I loaded a new version of the JNLP file with the browser proxy turned on, since the app worked before (even with Java 6) with no problems.

The problem disappears, if I open the ssh tunnel. I still have to check, if it disappears if I load the JNLP file using a direct connection.

Karria at 2007-7-8 1:36:07 > top of Java-index,Core,Core APIs...