-->
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.  [ 8 posts ] 
Author Message
 Post subject: Dialect Class Loading issue with Hibernate Tool
PostPosted: Mon Jun 18, 2012 3:13 pm 
Newbie

Joined: Mon Jun 18, 2012 3:00 pm
Posts: 3
Hi!

I am using SQLiteDialect from code.google.com/p/hibernate-sqlite/.
This works perfectly from within the project. However when I use the Hibernate Tools I get

Code:
java.lang.NoSuchFieldError: INSTANCE
   at org.hibernate.type.StandardBasicTypes.<clinit>(StandardBasicTypes.java:54)
   at com.customlbs.persistence.SQLiteDialect.<init>(SQLiteDialect.java:47)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at java.lang.Class.newInstance0(Class.java:372)
   at java.lang.Class.newInstance(Class.java:325)
   at org.hibernate.dialect.resolver.DialectFactory.constructDialect(DialectFactory.java:157)
   at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:109)
   at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:146)
   at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
   at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
   at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:278)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:273)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)
   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)


I checked that the maven dependencies are added to the classpath of the "Console Configuration".

I see that there is in fact a " INSTANCE = new BooleanType();" in the BooleanType class in hibernate-core-4.1.4.Final.jar so I don't understand why it won't find that field. As far as I can tell there is no other hibernate-core jar.

Could this be a bug in Hibernate Tools?

Cheers, Markus

PS: Please be aware that I also posted this question at Stack Overflow http://stackoverflow.com/questions/11089609/dialect-class-loading-issue-with-hibernate-tool


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Fri Jun 22, 2012 9:14 am 
Newbie

Joined: Mon Jun 18, 2012 3:00 pm
Posts: 3
anyone?


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Wed Aug 01, 2012 9:14 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Hibernate tools were tested with maximum Hibernate-core4.0. And if you use hiberante-core4.0 you also have to choose "4.0" version in console configuration.
Hibernate tools have other hibernate-core and other jars in plugins that is why you have versions conflict.


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Thu Aug 02, 2012 10:00 am 
Newbie

Joined: Thu Aug 02, 2012 9:56 am
Posts: 2
I think this is not the issue.
I copied the jars from the eclispe plugin (seems to be the version 4.0.0.CR6 for Indigo) and I still got the same error.
Any idea.


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Thu Aug 02, 2012 10:30 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
I have just checked: StandardBasicType class which is referenced from your dialect class doesn't have the INSTANCE field. So the dialect was compiled with some other Hibernate version.


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Thu Aug 02, 2012 10:51 am 
Newbie

Joined: Thu Aug 02, 2012 9:56 am
Posts: 2
OK after a bit of investigation the issue seems to be that when selecting the 4.0 version of hibernate in the console configuration it does not actually use the 4.00 version in the plugin org.jboss.tools.hibernate4_0_3.5.1.v20120715-0252-H98-Final but rather the hibernate version 3 jars org.hibernate.eclipse.libs_3.5.1.v20120715-0252-H18-Final.

So as a summary, its buggy !
I don't see how to use Hibernate tools with Hibernate 4.1.


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Fri Aug 03, 2012 4:28 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
Do you have this problem when just expand console configuration tree?


Top
 Profile  
 
 Post subject: Re: Dialect Class Loading issue with Hibernate Tool
PostPosted: Mon Feb 11, 2013 12:35 pm 
Newbie

Joined: Mon Feb 11, 2013 12:31 pm
Posts: 4
Hello everbody,

I have a similar problem.

Is there a solution for this problem?


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