-->
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.  [ 2 posts ] 
Author Message
 Post subject: Eclipse Tools, SessionFactory error: INSTANCE
PostPosted: Wed Jun 08, 2011 4:22 am 
Newbie

Joined: Wed Jun 08, 2011 4:04 am
Posts: 1
Hi, I’m relatively new to hibernate and trying to get the tools to work in eclipse so I can generate DB schema from my POJOs.

Despite my project building and running fine, I’m getting a SessionFactory error: INSTANCE when I try to expand the SessionFactory item in the Hibernate Configuration. I’ve read http://stackoverflow.com/questions/5106 ... h-struts-1 that this can be caused by several version of the hibernate jar on the class path. I’ve checked my build path and I can’t think how this could be the case.

Code:
java.lang.NoSuchFieldError: INSTANCE
at gemcattle.db.hibernate.CoordsCompositeType.getPropertyTypes(CoordsCompositeType.java:50)
at org.hibernate.type.CompositeCustomType.getColumnSpan(CompositeCustomType.java:183)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:275)
at org.hibernate.mapping.Property.isValid(Property.java:217)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.hibernate.console.ConsoleConfiguration$4.execute(ConsoleConfiguration.java:241)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:72)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:236)
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)


The offending line in CoordsCompositeType is the return line here (you can see I’ve tried various options)
Code:
   
@Override
   public Type[] getPropertyTypes() {
      return new Type[]{IntegerType.INSTANCE, IntegerType.INSTANCE};
//      return new Type[]{StandardBasicTypes.INTEGER, StandardBasicTypes.INTEGER};
//      return new Type[]{Hibernate.INTEGER, Hibernate.INTEGER};
//      return new Type[]{Hibernate.BIG_DECIMAL, Hibernate.BIG_DECIMAL};
   }


I notice that it works fine when I remove my CoordsCompositeType from my hibernate.cfg.xml mapping

Would really appreciate some pointers. I’m using eclipse Helios SR2 and hibernate tools 3.4.0, and can post more conde/config if necessary.

Thanks


Top
 Profile  
 
 Post subject: Re: Eclipse Tools, SessionFactory error: INSTANCE
PostPosted: Tue Jun 21, 2011 3:44 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
There are built in hibernate libraries in hibernate tools plugins. When user don't provide some required jar it gets the jar from built in jars. Make sure you have all the required libraries into your project classpath.


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