-->
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.  [ 12 posts ] 
Author Message
 Post subject: Eclipse Helios troubles: Error fetching children of database
PostPosted: Thu Jan 27, 2011 12:18 pm 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
I'm trying without success to use the Hibernate tools for a Spring Roo-based project within SpringSource Tool Suite 2.5.x (based on Eclipse 3.6.1). This is my first time trying to use the tools.

Environment: Windows 7 64-bit, MySQL 5.1, Java SE 6.

I've set up the configuration as a JPA type. The driver properties allow me to successfully ping the server.

In the Hibernate Configurations tool tab the classpath is correct, I believe: I can successfully list the classes under Configuration and Sesssion Factory.

But when I attempt to open the Database, I get this:

Code:

'Fetching children of Database' has encountered a problem.

An internal error occurred during: "Fetching children of Database".
org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V


And when I try to run a query I get: "org.hibernate.exception.GenericJDBCException: could not execute query".

I've fiddled around with various settings and tried to find any solutions, but I'm stuck.

Any guidance is much appreciated.

--Greg


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Fri Jan 28, 2011 9:50 pm 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
You are absolutely correct. My apologies.

Code:
eclipse.buildId=2.5.0.201010241000-RELEASE
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product com.springsource.sts.ide
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product com.springsource.sts.ide

!ENTRY org.eclipse.core.jobs 4 2 2011-01-28 20:44:06.897
!MESSAGE An internal error occurred during: "Fetching children of Database".
!STACK 0
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
   at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:26)
   at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:116)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:107)
   at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:63)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Sat Jan 29, 2011 12:34 am 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
Is there any way I can turn off the logging?


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Sun Jan 30, 2011 8:15 pm 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
OK. Great. Thank you for that insight.

Here's a snippet of the trace:

Code:
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
   at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
   at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:26)

Line 26 in JDBCMetaDataDialect.getTables is simply

Code:
log.debug("getTables(" + catalog + "." + schema + "." + table + ")");

After digging through all the jars in the project classpath and Eclipse, it appears that this

Code:
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)

is from a jar in my classpath. But the org.slf4j.spi.LocationAwareLogger class it is calling is not the version 1.6.1 in the project classpath, whose log method arguments looks like this:

Code:
Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;

But rather the org.slf4j.spi.LocationAwareLogger in the org.hibernate.eclipse_3.3.1.*\lib\hibernate Eclipse plugin directory, which is version 1.5.8 and whose log method lacks the Object argument:

Code:
Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;

So it would seem that either the class used in the Apache logging implementation needs to change from SLF4JLocationAwareLog to something else, or the jar used containing the LocationAwareLogger class needs to be the one in the project classpath.

How does that happen? Do I need to manually build the classpath used by Hibernate Tools by deleting the project classpath and adding the jars individually?

--Greg


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Sun Jan 30, 2011 8:33 pm 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
Incidentally, SpringSource Tool Suite had it's own org.slf4j.spi.LocationAwareLogger class in com.springsource.slf4j.api_1.5.10.jar. To take this out of the mix I did my troubleshooting in Eclipse 3.5.2 (Galileo).

FWIW.


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Mon Jan 31, 2011 4:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ggd380 wrote:
Incidentally, SpringSource Tool Suite had it's own org.slf4j.spi.LocationAwareLogger class in com.springsource.slf4j.api_1.5.10.jar. To take this out of the mix I did my troubleshooting in Eclipse 3.5.2 (Galileo).

FWIW.


Ah good to know - not sure why that class is being exposed/injected into our osgi bundle classloader ;(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Mon Jan 31, 2011 11:16 am 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
If by "exposed/injected into our osgi bundle classloader" you mean that the STS LocationAwareLogger class is exposed to (or within the scope of) the Hibernate Tools "environment" and, as a result, could be part of the problem, well, I have no idea if that's happening. Since I barely understand which classes are loaded, and have no idea how or in what order they are loaded, I'm just trying to eliminate any potential conflict, no matter how remote.

I suspect the solution to my problem involves isolating which classes from my class path are loaded.


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Tue Feb 01, 2011 7:59 am 
Senior
Senior

Joined: Fri May 08, 2009 12:27 pm
Posts: 168
I hit the same problem. Eliminating all logging classes from the project's build path while running reverse engineering fixed the problem for me - the build path classes get injected into Reveng's classes.

I think you could run into different troubles if your user types call logging functions, since then they'll expect the version you have in your build path.

Also, note that Hibernate Tools will load the jars the first time your run Reveng, and keep them loaded. It won't help to change the project build path after you hit the crash, you need to restart Eclipse, remove logging from your build path, then run Reveng.
After that, you can revert the change to the .classpath file and even restart the Reveng tool without modifying the classpath again, until you restart Eclipse.

As for why the user classpath is injected: I suspect Hibernate Tools tries to load user type code, and with that code pulls in the project class path.


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Tue Feb 01, 2011 12:02 pm 
Newbie

Joined: Thu Jan 27, 2011 11:56 am
Posts: 7
Thank you, Joachim! That's exactly the help I needed.

My initial attempts to tweak the .classpath file actually gave me different errors, which is encouraging.

I need to experiment with this a little. I'll report back if I have anything useful to contribute.


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Fri Nov 18, 2011 8:58 am 
Newbie

Joined: Sat Oct 01, 2011 8:21 am
Posts: 2
Hi,

Indeed, this is due to a problem of versions of the Slf4J... In my project there was a particular jar that was causing the conflict, the jcl-over-slf4j-1.6.1.jar... so, after removing it I managed to keep on using hibernate tools as I used to do. Now I have to see if this does not break any other thing, apparently it does not...

...Furthermore, like Joachim says, always restart eclipse if you change the libraries on your classpath!

Cheers!


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Fri Nov 18, 2011 9:21 am 
Senior
Senior

Joined: Fri May 08, 2009 12:27 pm
Posts: 168
Well, the combination of Eclipse Helios and Hibernate Tools 3.4.0 does not require an Eclipse restart.
I don't know about other combinations.
(Check the version number inside Eclipse's About page. The version numbers on web pages, plugin packages and included jar files can all disagree; also, the public SVN seems to have no version that contains the actually published plugin. Not sure about today's status, but it used to be an unholy mess a year ago.)


Top
 Profile  
 
 Post subject: Re: Eclipse Helios troubles: Error fetching children of database
PostPosted: Mon Jan 23, 2012 12:14 pm 
Newbie

Joined: Mon Jan 23, 2012 12:09 pm
Posts: 1
Check this isinstalled class wsdetect.dll article... :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.