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.
1. Add PostgreSQL connection and check "Remember password" for it. 2. Click "New > New Project". 3. Choose "Java" and "Java Desktop Application". Click "Next". 4. Choose "Database Application". Click "Next". 5. Choose added PostgreSQL connection, some column and add some fields from this column. Click "Next". 6. Click "Finish" 7. Run application. Result: BUILD SUCCESSFUL message appears at the bottom of output in Output window, but also exception is reported in output. I use bundled PostgreSQL driver and connection is established during project creation and run.
Created attachment 71739 [details] Full text from Output window.
Take a look at this part of the stack trace: Caused by: java.net.SocketException: Reply from SOCKS server has bad version at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:269) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:437) at java.net.Socket.connect(Socket.java:519) at java.net.Socket.connect(Socket.java:469) at java.net.Socket.<init>(Socket.java:366) at java.net.Socket.<init>(Socket.java:180) at org.postgresql.core.PGStream.<init>(PGStream.java:62) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77) This makes me suspect you may have a proxy configured for NetBeans. Can you go to the NetBeans preferences/options panel and make sure you don't have proxies turned on? The other potential issue is that you don't have a valid version of the driver for the server. Please make sure the JDBC driver version is compatible with the version of your PostgreSQL version. Once you have checked that, either please close the issue if that solves your problem or remove the INCOMPLETE keyword and add a comment with any new information you have for us. Thanks!
I didn't configure proxy. I started NetBeans with fresh userdir and tried to create and run Database Java Desktop application. Main point is that when I added new connection with bundled PostgreSQL driver, it is successfully established and I can view data for this connection and work with this connection. But when I created simple application with wizard (which also uses established connection) for this connection, I can't run it. Looks like everything is fine for DB explorer, but doesn't work for an application.
I am not sure what is happening here. The error definitely has to do with using a SOCKS proxy. See http://lists.apple.com/archives/java-dev/2001/Oct/msg01231.html for one tip on how to fix this. But the fact that it works fine for the explorer stumps me. All I can think of is that the way the connection is used in the application is different. Note that when you create a Java Desktop Database Application, it copies the connection information from the Database Explorer connection and creates its own connection - it doesn't use the connection directly. I am passing this to the team responsible for the Java Desktop application for evaluation. If you feel this belongs in the db modules, please assign it back to us, but I would appreciate you investigating what you might be doing when creating the project that could potentially cause this.
It seems to be a duplicate of issue 134745. See my comment (Jul 28 13:10:10) in this issue for an explanation and a workaround. *** This issue has been marked as a duplicate of 134745 ***
*** Issue 149591 has been marked as a duplicate of this issue. ***