Thread: Problem establishing connection

Problem establishing connection

From
Pinki
Date:
My aplication is a simple Desktop Aplication using the Database Aplication
Wizard with NetBeans 6.0.1. i declared my db at sevices tab and worked fine,
but when i run the aplication i get this stack trace

Any help?


15/04/2008 10:59:38 AM org.jdesktop.application.Application$1 run
GRAVE: Application class monitor.MonitorApp failed to launch
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs
(09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: El intento de
conexión falló.
Error Code: 0
        at
oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
        at
oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)
        at
oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
        at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
        at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
        at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
        at

oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
        at monitor.MonitorView.initComponents(MonitorView.java:285)
        at monitor.MonitorView.<init>(MonitorView.java:35)
        at monitor.MonitorApp.startup(MonitorApp.java:19)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: org.postgresql.util.PSQLException: El intento de conexión falló.
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137)
        at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
        at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
        at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:29)
        at
org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:386)
        at org.postgresql.Driver.connect(Driver.java:260)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at
oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)
        ... 20 more
Caused by: java.net.SocketException: Malformed reply from SOCKS server
        at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
        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)
        ... 30 more
Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class
monitor.MonitorApp failed to launch
        at org.jdesktop.application.Application$1.run(Application.java:177)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build
b58g-fcs (09/07/2007))):
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: El intento de
conexión falló.
Error Code: 0
        at
oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
        at
oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)
        at
oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)
        at
oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)
        at
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)
        at
oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)
        at

oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)
        at

oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)
        at monitor.MonitorView.initComponents(MonitorView.java:285)
        at monitor.MonitorView.<init>(MonitorView.java:35)
        at monitor.MonitorApp.startup(MonitorApp.java:19)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        ... 8 more
Caused by: org.postgresql.util.PSQLException: El intento de conexión falló.
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:137)
        at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
        at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:124)
        at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
        at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:29)
        at
org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:386)
        at org.postgresql.Driver.connect(Driver.java:260)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:154)
        at
oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)
        ... 20 more
Caused by: java.net.SocketException: Malformed reply from SOCKS server
        at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
        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)
        ... 30 more
BUILD SUCCESSFUL (total time: 35 seconds)

--
View this message in context: http://www.nabble.com/Problem-establishing-connection-tp16701015p16701015.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


Re: Problem establishing connection

From
Craig Ringer
Date:
Pinki wrote:

> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs
> (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: El intento de
> conexión falló.

OK, so "The connection attempt failed" exception was thrown by ...

> Caused by: java.net.SocketException: Malformed reply from SOCKS server
....
>         at org.postgresql.core.PGStream.<init>(PGStream.java:62)

the Java networking stack because of communication problems with a SOCKS
proxy server.

Maybe your environment is different, so you're not using the proxy in
netbeans and the proxy is broken?

Does `psql' work?

--
Craig Ringer

Re: Problem establishing connection

From
Pinki
Date:
Thanks Craig for the tips, the proxy is working, also configured in netbeans.
The psql is working too, but i'm getting the same message every time. I
managed to develop another aplication in which i use hibernate and
webservices and all seams to be working quite good, but in the other hand i
can't put toghether a simple desktop aplication... is quite depressing...

Any comments are accepted..

Tks in advance

Nicolas Ribeiro


Craig Ringer wrote:
>
> Pinki wrote:
>
>> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs
>> (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException
>> Internal Exception: org.postgresql.util.PSQLException: El intento de
>> conexión falló.
>
> OK, so "The connection attempt failed" exception was thrown by ...
>
>> Caused by: java.net.SocketException: Malformed reply from SOCKS server
> ....
>>         at org.postgresql.core.PGStream.<init>(PGStream.java:62)
>
> the Java networking stack because of communication problems with a SOCKS
> proxy server.
>
> Maybe your environment is different, so you're not using the proxy in
> netbeans and the proxy is broken?
>
> Does `psql' work?
>
> --
> Craig Ringer
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>

--
View this message in context: http://www.nabble.com/Problem-establishing-connection-tp16701015p16763404.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


Re: Problem establishing connection

From
"A. Tres Finocchiaro"
Date:
Pinki,


I came across your question:
http://archives.postgresql.org/pgsql-jdbc/2008-04/msg00093.php

It may be similar to:

http://www.netbeans.org/issues/show_bug.cgi?id=134745
http://forum.java.sun.com/thread.jspa?messageID=10309943&tstart=0

If so, please post your details in bug report.  If not, please disregard.

-Tres




--
- Tres.Finocchiaro@gmail.com