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.

Bug 150057 - Exception arises for PostgreSQL by attempt to run Java Desktop Application
Summary: Exception arises for PostgreSQL by attempt to run Java Desktop Application
Status: RESOLVED DUPLICATE of bug 134745
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
: 149591 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-14 10:53 UTC by Roman Mostyka
Modified: 2008-11-25 01:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full text from Output window. (8.99 KB, text/plain)
2008-10-14 10:53 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-10-14 10:53:05 UTC
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.
Comment 1 Roman Mostyka 2008-10-14 10:53:58 UTC
Created attachment 71739 [details]
Full text from Output window.
Comment 2 David Vancouvering 2008-10-15 01:00:26 UTC
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!
Comment 3 Roman Mostyka 2008-10-15 12:10:20 UTC
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.
Comment 4 David Vancouvering 2008-10-15 18:13:37 UTC
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.
Comment 5 Jan Stola 2008-10-24 10:10:55 UTC
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 ***
Comment 6 alanluayon 2008-11-25 01:07:54 UTC
*** Issue 149591 has been marked as a duplicate of this issue. ***