-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Error creating SQL Model Connection connection
PostPosted: Thu Jul 16, 2009 10:59 am 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
I just installed eclipse 3.5 platform and Hibernate Tools 3.3.0.M2-N200907092133-H355 from JBoss developer update site (as well as a few other plug-ins). Now I have an error when I try to connect to my MS SQL database through Hibernate tools.

I have a project dependant on hibernate-annotations 3.4.0 GA (from pom.xml). (Maven thus adds hibernate-core 3.3.0 SP1 and other required dependencies on the build path). The MS SQL driver is also on that project build path. I have configured a MS SQL JDBC driver in eclipse, Preferences / Data management / Connectivity / Driver Definitions, where I added sqljdbc4.jar from sqljdbc_2.0. Then I created a Hibernate console configuration, type JPA, referencing the project, created a new Database connection referencing the MS SQL JDBC driver (the ping test works), referenced my property file, and referenced the persistence unit defined in that property file.

Now when I trigger a 'create connection' in Hibernate tools by expanding the console configuration node, it says after a few seconds that it couldn't connect. The node opens anyway, and I can navigate the database and run queries, but still I wonder why this error happens and what it means.

Here is the stack trace as found in eclipse error log.

!ENTRY org.eclipse.datatools.connectivity 4 -1 2009-07-16 16:53:49.959
!MESSAGE Error creating SQL Model Connection connection to eXactoSrv. (Error: null)
!STACK 0
java.lang.NullPointerException
at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.getCatalogDatabase(DatabaseProviderHelper.java:37)
at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.setDatabase(DatabaseProviderHelper.java:47)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionInfoImpl.initializeJDBCConnection(ConnectionInfoImpl.java:672)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionInfoImpl.<init>(ConnectionInfoImpl.java:644)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionFactory.createConnection(ConnectionFactory.java:38)
at org.eclipse.datatools.connectivity.sqm.core.SQMConnectionFactory.createConnection(SQMConnectionFactory.java:45)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionFactory.createConnection(ConnectionFactory.java:59)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryAdapterProvider.createConnection(ConnectionFactoryAdapterProvider.java:114)
at org.eclipse.datatools.connectivity.internal.ManagedConnection.createConnection(ManagedConnection.java:163)
at org.eclipse.datatools.connectivity.internal.CreateConnectionJob.run(CreateConnectionJob.java:56)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.datatools.connectivity 4 -1 2009-07-16 16:53:50.143
!MESSAGE Could not connect to eXactoSrv.
!SUBENTRY 1 org.eclipse.datatools.connectivity 4 -1 2009-07-16 16:53:50.143
!MESSAGE Error creating SQL Model Connection connection to eXactoSrv. (Error: null)
!STACK 0
java.lang.NullPointerException
at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.getCatalogDatabase(DatabaseProviderHelper.java:37)
at org.eclipse.datatools.connectivity.sqm.internal.core.util.DatabaseProviderHelper.setDatabase(DatabaseProviderHelper.java:47)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionInfoImpl.initializeJDBCConnection(ConnectionInfoImpl.java:672)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionInfoImpl.<init>(ConnectionInfoImpl.java:644)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionFactory.createConnection(ConnectionFactory.java:38)
at org.eclipse.datatools.connectivity.sqm.core.SQMConnectionFactory.createConnection(SQMConnectionFactory.java:45)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.ConnectionFactory.createConnection(ConnectionFactory.java:59)
at org.eclipse.datatools.connectivity.internal.ConnectionFactoryAdapterProvider.createConnection(ConnectionFactoryAdapterProvider.java:114)
at org.eclipse.datatools.connectivity.internal.ManagedConnection.createConnection(ManagedConnection.java:163)
at org.eclipse.datatools.connectivity.internal.CreateConnectionJob.run(CreateConnectionJob.java:56)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.core.runtime 0 0 2009-07-16 16:53:50.144
!MESSAGE OK


Thanks for any help.

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Sun Aug 02, 2009 10:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
OlivierMiR wrote:
I just installed eclipse 3.5 platform and Hibernate Tools 3.3.0.M2-N200907092133-H355 from JBoss developer update site (as well as a few other plug-ins). Now I have an error when I try to connect to my MS SQL database through Hibernate tools.


The exception does not contain any hibernate tools related classes/methods, only Eclipse DTP. Can you create a connection via the DTP views ?

Quote:
Now when I trigger a 'create connection' in Hibernate tools by expanding the console configuration node, it says after a few seconds that it couldn't connect. The node opens anyway, and I can navigate the database and run queries, but still I wonder why this error happens and what it means.


How does it say "couldn't connect" ? screenshot, error log, dialog text, anything ?

And if it says you can navigate and connect the db it sounds like Hibernate Tools connect ok ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Mon Aug 03, 2009 5:28 am 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
max wrote:
OlivierMiR wrote:
I just installed eclipse 3.5 platform and Hibernate Tools 3.3.0.M2-N200907092133-H355 from JBoss developer update site (as well as a few other plug-ins). Now I have an error when I try to connect to my MS SQL database through Hibernate tools.


The exception does not contain any hibernate tools related classes/methods, only Eclipse DTP. Can you create a connection via the DTP views ?


I don't have a full DTP installed in my eclipse installation. I installed eclipse platform, then JDT and a few things like subversive plug-in, then hibernate tools and I installed only the plug-ins required by hibernate (automatically discovered through the automatic install feature). Maybe the problem comes from a missing plug-in then? Note that with my previous eclipse and hibernate tools installations I never had such problem although dealing with identical sql driver and database, so the difference might be in the eclipse version or the way I installed eclipse previously.

It seems to me likely now that installing the full DTP would solve my problem. But I wanted to avoid unneeded plug-ins to have a 'minimal' eclipse installation, as much as possible. And that would only hide the problem, not really solve it for future users... Do you want me to try to install DTP?

max wrote:
OlivierMiR wrote:
Now when I trigger a 'create connection' in Hibernate tools by expanding the console configuration node, it says after a few seconds that it couldn't connect. The node opens anyway, and I can navigate the database and run queries, but still I wonder why this error happens and what it means.


How does it say "couldn't connect" ? screenshot, error log, dialog text, anything ?

And if it says you can navigate and connect the db it sounds like Hibernate Tools connect ok ?


A pop-up window appears titled "Multiple problems have occurred", with a "stop" icon. It contains 4 items in a list box, these are the exceptions seen afterwards in the eclipse error log. There is a "detail" and an "ok" button. Please see the screenshot. ("eXactoSrv" in the screenshot refers to the "database connection" name, in the hibernate configuration properties.)

As you point out, this seems indeed to be a DTP error, and indeed it does not stop Hibernate tools to connect (I can indeed connect and navigate the db afterwards). But it is an error triggered when using Hibernate tools and it is a bit annoying to have to click ok and not knowing if something is wrong and if it could lead to other problems, so this problem might be worth investigating for other Hibernate tools users...

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Mon Aug 03, 2009 5:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Well, it should just work ;)

But yes, try installing full DTP to see if that makes a difference.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Mon Aug 03, 2009 10:57 am 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
After installing the full DTP through galileo update site, the error does not appear any more.

According to the eclipse install history, here is the difference between "before" installing the full DTP (error appeared) and now, "after" installing the full DTP.

BEFORE
Eclipse Java Development Tools 3.5.0.v20090527-2000-7r88FEeFJePyvYeA33DjZ_c1
Eclipse Platform 3.5.0.I20090611-1540
Hibernate Tools 3.3.0.M2-N200907092133-H355
Maven Central repository index (Optional) 0.9.7.200902090947
Maven Embedder 2.1.0.20080530-2300
Maven Integration for Eclipse (Required) 0.9.8.200905041414
Maven POM Editor (Optional) 0.9.8.200905041414
Maven POM XML Editor (Optional) 0.9.8.200905041414
Maven SCM Integration (Optional) 0.9.8.200905041414
Maven: The Definitive Guide book (Optional) 0.9.8.200905041414
Subversive SVN Connectors 2.2.0.I20090505-1500
Subversive SVN Team Provider (Incubation) 0.7.8.I20090506-1500
SVNKit 1.3.0 Implementation (Optional) 2.2.0.I20090505-1500

AFTER
Data Tools Platform Enablement Extender SDK 1.7.0.v200906050400-7I8r-FE9JfFkjWT8qt6UI5jX2laJ
Data Tools Platform Extender SDK 1.7.0.v200906050400-7O9H-FD0IVEH6AsdTaISiFGNkk6p
Eclipse Java Development Tools 3.5.0.v20090527-2000-7r88FEeFJePyvYeA33DjZ_c1
Eclipse Platform 3.5.0.I20090611-1540
Hibernate Tools 3.3.0.M2-N200907092133-H355
Maven Central repository index (Optional) 0.9.7.200902090947
Maven Embedder 2.1.0.20080530-2300
Maven Integration for Eclipse (Required) 0.9.8.200905041414
Maven POM Editor (Optional) 0.9.8.200905041414
Maven POM XML Editor (Optional) 0.9.8.200905041414
Maven SCM Integration (Optional) 0.9.8.200905041414
Maven: The Definitive Guide book (Optional) 0.9.8.200905041414
Subversive SVN Connectors 2.2.0.I20090505-1500
Subversive SVN Team Provider (Incubation) 0.7.8.I20090506-1500
SVNKit 1.3.0 Implementation (Optional) 2.2.0.I20090505-1500

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Mon Aug 03, 2009 11:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Could you report this in Eclipse DTP ? They must be missing some dependency since for this bug to happen.

Since there is no hibernate code in the stacktrace I don't actually know what is causing it to happen.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Mon Aug 03, 2009 11:21 am 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
Ok, I'll do that soon...

How can I rate the answer? I can't find that function any more.

_________________
Olivier


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Fri Aug 07, 2009 5:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the rating unfortunately disappeared with the latest update.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Error creating SQL Model Connection connection
PostPosted: Sat Aug 08, 2009 5:36 pm 
Newbie

Joined: Mon Jan 12, 2009 4:38 pm
Posts: 19
Ok. FYI, the bug has been posted to https://bugs.eclipse.org/bugs/show_bug.cgi?id=285461. Please add any details you feel relevant if you want, that I might have forgotten.

Thank you for the help.

_________________
Olivier


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.