Problem with DB Browser and Hibernate perspective/HQL Editor

Home Forums Archived Forums MyEclipse Archived Database Tools (DB Explorer, Hibernate, etc.) Problem with DB Browser and Hibernate perspective/HQL Editor

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Riyad Kalla Riyad Kalla 8 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #273247
    Profile photo of ernestz
    ernestz
    Member

    I’m using MyEclipse 5.5, Eclipse 3.2, SQL Server and using the jDTS (http://jtds.sourceforge.net) driver.

    Installation Details:

    *** Date: 
    Friday, July 27, 2007 1:41:01 PM CDT
    
    ** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_11
    
    
    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.5.1 GA
    Build id: 20070521-5.5.1-GA
    
    
    *** Eclipse details:
    Eclipse SDK
    
    Version: 3.2.2
    Build id: M20070212-1330
    
    
    
    
    Eclipse Platform
    
    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330
    
    
    Eclipse Java Development Tools
    
    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20070212-1330
    
    
    Eclipse Project SDK
    
    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330
    
    
    Eclipse RCP
    
    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20070212-1330
    
    
    Eclipse Plug-in Development Environment
    
    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20070212-1330
    
    
    Eclipse Graphical Editing Framework
    
    Version: 3.2.2.v20070208
    Build id: 20070208-1315
    
    
    
    
    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    11c_74
    -vm
    C:\WINDOWS\system32\javaw.exe
    
    

    I have a simple project with Hibernate capabilities. The database is MS SQL Server 2000 and I’m using the Single SignOn capability of the jDTS driver. I can connect to the database and run some simple tests using the project, so the configuration seems to be correct and valid.

    If I initially go into the Database Explorer and connect to my Database, I am unable to use the HQL Editor. I can open an HQL Editor window, but all queries return the message “org.hibernate.exception.JDBCConnectionException: Cannot open connection”, and the following appears in the eclipse .log file:

    
    
    !ENTRY com.genuitec.org.hibernate.eclipse.console 4 150 2007-07-27 13:47:48.339
    !MESSAGE Exception while executing HQL Query
    !SUBENTRY 1 com.genuitec.org.hibernate.eclipse.console 4 150 2007-07-27 13:47:48.339
    !MESSAGE org.hibernate.exception.JDBCConnectionException: Cannot open connection
    !STACK 0
    org.hibernate.exception.JDBCConnectionException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2144)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
        at org.hibernate.loader.Loader.list(Loader.java:2023)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:48)
        at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:320)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
        at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:309)
        at com.genuitec.eclipse.hibernate.action.MEExecuteHQLAction$ExecuteHQLJob.run(MEExecuteHQLAction.java:91)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
    Caused by: java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:40)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        ... 19 more
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1889)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
        ... 27 more
    !SUBENTRY 2 com.genuitec.org.hibernate.eclipse.console 4 150 2007-07-27 13:47:48.339
    !MESSAGE org.hibernate.exception.JDBCConnectionException: Cannot open connection
    !STACK 0
    org.hibernate.exception.JDBCConnectionException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2144)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
        at org.hibernate.loader.Loader.list(Loader.java:2023)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:48)
        at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:320)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
        at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:309)
        at com.genuitec.eclipse.hibernate.action.MEExecuteHQLAction$ExecuteHQLJob.run(MEExecuteHQLAction.java:91)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
    Caused by: java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:40)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        ... 19 more
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1889)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
        ... 27 more
    !SUBENTRY 2 com.genuitec.org.hibernate.eclipse.console 4 150 2007-07-27 13:47:48.339
    !MESSAGE java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
    !STACK 0
    java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:614)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:40)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2144)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
        at org.hibernate.loader.Loader.list(Loader.java:2023)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:48)
        at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:320)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
        at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:309)
        at com.genuitec.eclipse.hibernate.action.MEExecuteHQLAction$ExecuteHQLJob.run(MEExecuteHQLAction.java:91)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1889)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
        ... 27 more
    !SUBENTRY 2 com.genuitec.org.hibernate.eclipse.console 4 150 2007-07-27 13:47:48.339
    !MESSAGE java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
    !STACK 0
    java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1889)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:344)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
        at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:40)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2144)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
        at org.hibernate.loader.Loader.list(Loader.java:2023)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:48)
        at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:320)
        at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
        at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:309)
        at com.genuitec.eclipse.hibernate.action.MEExecuteHQLAction$ExecuteHQLJob.run(MEExecuteHQLAction.java:91)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
    

    .

    If I exit Eclipse and restart, and go immediately into the HQL Editor, everything works as expected. But, I can no longer connect to the database from within the Database Explorer. I get an error message about being unable to connect to the database and the following is logged to the Eclipse .log file

    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2007-07-27 13:50:33.388
    !MESSAGE Error while performing database login with the localhost driver
    !STACK 0
    java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:611)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
        at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
        at com.genuitec.eclipse.sqlexplorer.actions.LoginProgress$Login.run(LoginProgress.java:43)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1894)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:584)
        ... 6 more
    
    !ENTRY com.genuitec.eclipse.sqlexplorer 4 4 2007-07-27 13:51:34.076
    !MESSAGE Error while performing database login with the localhost driver
    !STACK 0
    java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:611)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:331)
        at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
        at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
        at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:99)
        at com.genuitec.eclipse.sqlexplorer.actions.LoginProgress$Login.run(LoginProgress.java:43)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
        at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1894)
        at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:584)
        ... 6 more
    

    It appears that a connection established in Database Explorer prevents the connection in the HQL Editor, and vice-versa, and the only way to switch tasks is to exit Eclipse and restart.

    The jDTS driver uses a file called NTLMAUTH.DLL, which is in my path. It almost appears as if the two views/perspectives try to load the DLL twice or something. The errors report “Native SSPI library not loaded.”, but I know the DLL is in the path.

    Am I doing something wrong, or is there something I haven’t configured correctly?

    #273310
    Profile photo of Riyad Kalla
    Riyad Kalla
    Member

    ernestz,
    You are doing everything correctly *and* pegged the problem on the head. A VM can only load a native resource (DLL) once… and it looks like depending on which function you use first, it loads the DLL, then the second one invokes the driver which tries to load it *again*.

    This could most likely be a driver issue trying to reload the library each time it’s requested, as you can see from where the exception is occuring:

    Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
    at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1894)

    which is probably something the jTDS developers didn’t run into before because as a single-threaded web app the JDBC driver works fine, but when used from within an IDE that may load it’s classes multiple times and make calls into it, it’s dying.

    I don’t have a workaround for you at this time unfortunately… I suppose you could not use the functionality from the driver that requires SSPI, then the JDBC driver should work just fine for the HQL Editor and DB Explorer.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Database Tools (DB Explorer, Hibernate, etc.)’ is closed to new topics and replies.