-->
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.  [ 4 posts ] 
Author Message
 Post subject: tools in existing hibernate project -session factory error
PostPosted: Wed May 13, 2009 3:12 pm 
Newbie

Joined: Tue May 06, 2008 3:35 pm
Posts: 7
When I try to setup hibernate tools in eclipse I am unable to get the Session Factory to behave. I have an existing hibernate.cfg.xml I am using from the webapp, it has the existing hbm files defined but no db info (using spring). I made a hibernate.properties with the database info inside it for the eclipse tool. I can view my existing beans/hbm's and I can walk the db from the hibernate view.
What I cannot do is use the session factory, when I click the session factory tree I get the following error:

Code:
!ENTRY org.hibernate.eclipse.console 4 4 2009-05-13 19:06:15.984
!MESSAGE Problems while creating sessionfactory
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2009-05-13 19:06:15.984
!MESSAGE org.hibernate.MappingException: Could not determine type for: dao.StringToCharUserType, for columns: [org.hibernate.mapping.Column(purpose_code)]
!STACK 0
org.hibernate.MappingException: Could not determine type for: dao.StringToCharUserType, for columns: [org.hibernate.mapping.Column(purpose_code)]
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:193)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:395)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:93)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:390)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2009-05-13 19:06:15.984
!MESSAGE org.hibernate.MappingException: Could not determine type for: dao.StringToCharUserType, for columns: [org.hibernate.mapping.Column(purpose_code)]
!STACK 0
org.hibernate.MappingException: Could not determine type for: dao.StringToCharUserType, for columns: [org.hibernate.mapping.Column(purpose_code)]
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:193)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:395)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:93)
   at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:390)
   at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:99)
   at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:105)
   at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


I am on a sybase legacy db and have a working UserType dao.StringToCharUserType that converts db char to a java String. Why is this erroring and stopping the session factory from being used?

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: tools in existing hibernate project -session factory error
PostPosted: Thu May 14, 2009 9:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if the usertype is not in the classpath it can't instantiate it - that will result in such an error.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: tools in existing hibernate project -session factory error
PostPosted: Fri Oct 09, 2009 12:35 am 
Newbie

Joined: Tue Oct 17, 2006 11:32 pm
Posts: 3
I have exactly same problem and the user type is definitely in the classpath. This is a class in the actual project! What else can I do to debug the isssue?


Top
 Profile  
 
 Post subject: Re: tools in existing hibernate project -session factory error
PostPosted: Fri Oct 09, 2009 3:15 am 
Newbie

Joined: Tue Oct 17, 2006 11:32 pm
Posts: 3
Turned out this was happening because I had a project with Java 1.6 setting while my Eclipse was running in 1.5 (this was a mac machine). The resolution was to switch to the latest Galileo SR1 64bit version of Eclipse that can actually run on top of the 1.6 64bit Java on a Mac.


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