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 170437 - Database Application Shell problem
Summary: Database Application Shell problem
Status: RESOLVED DUPLICATE of bug 134745
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-17 00:02 UTC by neil_hawkes
Modified: 2009-09-17 00:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description neil_hawkes 2009-08-17 00:02:29 UTC
I am trying to use the database application shell to connect to a database on a Microsoft SQL Server 2000 server, using 
local authentication..

I have been coding for some 20 years and I am comfortable in Visual studio, but I am new to Java and Netbeans.

I know the database is available via local authentication and the user details I am using, since I can access it that 
way using other tools.

I can access the tables in the database by using Services/connection/database/schema/table/View Data options from the 
Services window but when I use the same connection/database/schema/table within the database application shell, then 
run the resulting project, Output shows the following errors (for example):
run:
[TopLink Info]: 2009.08.17 10:05:31.614--ServerSession(798709)--TopLink, version: Oracle TopLink Essentials - 2.0.1 
(Build b09d-fcs (12/06/2007))
17/08/2009 10:07:32 AM org.jdesktop.application.Application$1 run
SEVERE: Application class odbctest1.ODBCtest1App failed to launch
Local Exception Stack: 
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): 
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Network error IOException: Malformed reply from SOCKS server
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 odbctest1.ODBCtest1View.initComponents(ODBCtest1View.java:305)
        at odbctest1.ODBCtest1View.<init>(ODBCtest1View.java:36)
        at odbctest1.ODBCtest1App.startup(ODBCtest1App.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:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.sql.SQLException: Network error IOException: Malformed reply from SOCKS server
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:385)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:304)
        at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:255)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:310)
        ... 25 more
Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class odbctest1.ODBCtest1App 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:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): 
oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Network error IOException: Malformed reply from SOCKS server
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 odbctest1.ODBCtest1View.initComponents(ODBCtest1View.java:305)
        at odbctest1.ODBCtest1View.<init>(ODBCtest1View.java:36)
        at odbctest1.ODBCtest1App.startup(ODBCtest1App.java:19)
        at org.jdesktop.application.Application$1.run(Application.java:171)
        ... 8 more
Caused by: java.sql.SQLException: Network error IOException: Malformed reply from SOCKS server
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:385)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:304)
        at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:255)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:310)
        ... 25 more

The same behaviour occurs using the MS SQL Server 2.0 driver and the jTDS driver

I have removed and reinstalled Netbeans and its associated programs, but the problem persists.
Comment 1 Jiri Prox 2009-08-17 13:43:16 UTC
Seems like problem in network, do you connect to the db on local machine or remotely? 
Comment 2 neil_hawkes 2009-08-17 21:25:44 UTC
Hi jiriprox - thanks for your time.

Remotely.

I have tested a login using local authentication on the server by using it with two other SQL report tools and that 
works OK.

Using that login creates a connection OK and that connection can be used via the View Data option to create a SQL 
Command window, which works as expected - the data is available.

But nonetheless the project won't run.

I have since tested a database application shell project using the derby local host connection and that does work.

I will try installing NetBeans 'fresh' on another PC and see if it does the same thing?

Comment 3 neil_hawkes 2009-08-24 23:04:45 UTC
The problem turned out to be that netBeans hadn't completely copied the system proxy settings - specifically, it didn't 
pick up to use the same proxy for all protocols.

Once I set the IDE proxy options manually, the problem disappeared.
Comment 4 Sergey Petrov 2009-09-09 11:10:27 UTC
looks like I miss something,

what is Database application shell? Also if you run project and it fails to run I'm not sure how it's related to
netbeans (except case  if something is generated wrongly). can you run this application outside of nb? can you provide
sample code?
Comment 5 neil_hawkes 2009-09-09 22:19:42 UTC
Hi Sergeyp

Thanks for your time.

The problem seems to be that the Toplink persistence object is not able to access the database and is reporting a 
malformed SOCKS response.

The project is automatically generated from New Project/Java Desktop/Database Application and is reading an existing 
database that runs on MS SQL 2000.

The SOCKS request shouldn't be going via proxy - it should be connecting straight to the server.  I have played with 
the proxy settings (No proxy, system settings, manual settings) in NetBeans and on one occasion it worked, but then 
stopped working for no obvious reason.

I have tried using two different MS db drivers and the jTDS db driver and that made no difference.

I tried installing a later MS SQL engine and using that to access the database - all good, but the same story within 
NetBeans.

I have logged a maintenance ticket with our network security people and they don't see why there is a problem.

I am the system owner for the databases and I have tested the local authentication loggin I am using using a variety of 
other environments and that works OK 

It is a bit of a mystery to me.  As a NetBeans/JAVA neophyte, I am feeling rather discouraged!  Maybe I should go back 
to VStudio...

Comment 6 neil_hawkes 2009-09-17 00:52:03 UTC
It seems the Swing Application Framework sets a SystemProxy property, so one needs to set it appropriately in the main 
class.

See 134745

Thanks for your time guys.

*** This issue has been marked as a duplicate of 134745 ***