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.
While trying to start a Tomcat application, I got an exception: java.net.SocketException. This may have something to do with the fact that I'm behind a wireless NAT AP that's being issued IP addresses through DHCP. When I resolve the IP address, OS X reports a different computer name than what it should be. This could be the root cause, but I'm not sure. Most other applications work just fine. The computer name is uniblab, but it resolves to carrie_2k on our office network. Not that that is important, but just in case there is a match in the log, you'll know why. (log will be attached) Stack trace is as follows: java.net.SocketException: Malformed reply from SOCKS server at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:74) at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:237) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:308) at java.net.Socket.connect(Socket.java:426) at java.net.Socket.connect(Socket.java:376) at java.net.Socket.<init>(Socket.java:291) at java.net.Socket.<init>(Socket.java:119) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Installation.testPortAvailability(Tomca t40Installation.java:755) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Installation.createNewTomcatProcess( Tomcat40Installation.java:919) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Installation.startServerInExecMode(To mcat40Installation.java:905) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Installation.synchronizeStart(Tomcat 40Installation.java:1053) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Installation.incrementalDeploy(Tomc at40Installation.java:689) at org.netbeans.modules.tomcat.tomcat40.Tomcat40Instance.deploy(Tomcat40Instance.ja va:273) at org.netbeans.modules.j2ee.impl.DefaultServerInstanceManager.doDeploy(DefaultServerI nstanceManager.java:120) at org.netbeans.modules.j2ee.impl.DefaultServerInstanceManager.startExecution(DefaultSe rverInstanceManager.java:140) at org.netbeans.modules.j2ee.impl.DefaultServerInstanceManager.serverInstanceStartExec ution(DefaultServerInstanceManager.java:85) at org.netbeans.modules.j2ee.impl.DefaultExecPerformer.startExecution(DefaultExecPerfor mer.java:67) at org.netbeans.modules.web.execution.WebDefaultExecPerformer.startExecution(WebDefa ultExecPerformer.java:238) at org.netbeans.modules.j2ee.impl.ServerExecutor.execute(ServerExecutor.java:69) at org.netbeans.modules.j2ee.impl.ExecSupport.start(ExecSupport.java:122) at org.netbeans.modules.j2ee.impl.ServerExecSupport.start(ServerExecSupport.java:140) at org.openide.actions.ExecuteAction.execute(ExecuteAction.java:140) at org.openide.actions.ExecuteAction.execute(ExecuteAction.java:217) at org.openide.actions.ExecuteAction.performAction(ExecuteAction.java:102) at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:4 31) at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:97) at org.openide.util.Task.run(Task.java:136) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)
Created attachment 10848 [details] ide.log
SocketException is thrown, when there is an error in underlying protocol, such as a TCP error. The exception is thrown from the code fraction : try { ... socket = new java.net.Socket(hostName,port); ... } catch (java.net.ConnectException ex) { // everything is OK because cannot create Socket connection }catch (java.io.IOException ex) { // Here the exception message dialog is opened // The SocketException is subclass of the IOException } I will farther investigate the Socket() constructor why the SocketException is thrown. It seems that given host is not available. Did you try to change the host ?
The exception is thrown when trying to read from the socket connection. I cannot reproduce the bug on my computer. By the way, we don't support deploying to remote Tomcat server. Could you attach the server.xml file. Is the server start/stop action working ? (From Runtime Tab -> Server Configuration -> Installed Servers -> Tomcat -> Internal Tomcat)
Well, the important thing about this code is the fact that method testPortAvailability(...) is not important for deployment functionality - it is only there in order to give a friendly error message in case the ports needed by the server are taken. If this method fails, then deployment might still succeed. So I would suggest commenting out the call of testPortAvailability(...) and giving it to our user (inertia) to test. That way we will see whether the deployment actually succeeds. It would also be interesting to put in debug messages which would tell us which host and port the IDE is trying to connect to. A possible solution could be to try to connect to localhost instead of to the actual host name (or, connect to both localhost and the actual name, and require that at least one of these two attempts succeeds). Or, we may consider in some cases to just ignore the exception, and only log it to the log file (but not to the error window). BTW, Milan, I am not surprised that you can't reproduce this on PC, socket behavior tends to be very platform specific. Or could we test it in our office on a Mac ?
Created attachment 10869 [details] patched tomcat40 module
What I was trying - was playing with different host names (even on Solaris machine) - either with available or unavailable hosts, but I was not able to provoke the SocketException. The attachment contains the tomcat40 module without testing the port availability and with DEBUG messages (host name, port number). Please put the tomcat40.jar to netbeans_home/modules directory.
> It seems that given host is not available. > Did you try to change the host ? Not that I know of. But Mac OS X is showing the wrong host name for some reason. This only happens at the office when I'm behind the wireless NAT AP. > By the way, we don't support deploying to remote Tomcat server. I am testing this locally. > Could you attach the server.xml file. Attached. > Is the server start/stop action working ? (From Runtime Tab -> Server > Configuration -> Installed Servers -> Tomcat -> Internal Tomcat) The action of start/stop goes through the motions, and localhost still cannot be accessed. > The attachment contains the tomcat40 module without testing the port > availability and with DEBUG messages (host name, port number). Thanks, I'll try it.
Created attachment 10876 [details] server.xml
Well, I tried the patched tomcat40.jar file. It did act different, but in the end, Tomcat did not start properly. It acted different in that the original exception was not shown. But port 8081 did not respond. Here is the console output in NetBeans (and ide.log will be attached): 2003-07-09 08:39:29 WebappLoader[]: Deploying class repositories to work directory / Users/anthonym/Applications/NetBeans/tomcat406_base/work/Tomcat-Internal/ localhost/_ 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/commons- collections.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/ commons-collections.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/commons-dbcp.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/commons-dbcp.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/commons-lang.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/commons-lang.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/commons-logging.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/commons-logging.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/commons-pool.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/commons-pool.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/debugstatement.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/debugstatement.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/firebirdsql.jar to / Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/firebirdsql.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/interclient.jar to / Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/interclient.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/jaas.jar to /Users/ anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/jaas.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/jcsapi.jar to /Users/ anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/jcsapi.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/jdbc2_0-stdext.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/jdbc2_0-stdext.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/log4j.jar to /Users/ anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/log4j.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/mini-concurrent.jar to /Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/mini-concurrent.jar 2003-07-09 08:39:29 WebappLoader[]: Deploy JAR /WEB-INF/lib/mini-j2ee.jar to / Users/anthonym/nbproject/cbb/context/cbb/WEB-INF/lib/mini-j2ee.jar 2003-07-09 08:39:30 StandardManager[]: Seeding random number generator class java.security.SecureRandom 2003-07-09 08:39:33 StandardManager[]: Seeding of random number generator has been completed 2003-07-09 08:39:43 ContextConfig[]: Added certificates -> request attribute Valve 2003-07-09 08:39:49 StandardWrapper[:default]: Loading container servlet default
Created attachment 10916 [details] ide.log - attempt 1) without the patched tomcat40.jar, attempt 2) with the patched tomcat40.jar
*** This issue has been marked as a duplicate of 29625 ***