-->
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.  [ 3 posts ] 
Author Message
 Post subject: Q: how to set classpath for Tools eclipse plugin?
PostPosted: Fri Apr 07, 2006 4:28 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 9:00 pm
Posts: 37
Hello,

In my previous post, I thought I only have problem with composite-id. it turns out when I try on the simplest standalone table

create table Language
( languageCode char(2) not null)

I have the same problem that sessionFactory complains cannot find the generated and compiled class Language.java sitting in my top dir /testHib. Here is the stacktrace:

java.lang.ClassNotFoundException: Language
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:96)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:166)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:115)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:265)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:260)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:24)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


When I add /testHib onto plugin's Console Configuration's class path then refresh, I got NPE with following stack trace:

java.lang.NullPointerException
at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91)
at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83)
at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117)
at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


How to do it properly for the tool's eclipse plugin?

Thx
Chuck


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 4:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...I thought we had fixed rooted class dirs - but apparently not.

Report it in jira with a ref to this thread.

btw. I *strongly* encourage you to use separate src and class directories! (not just because of the hibernate tools assuming it)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 5:05 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 9:00 pm
Posts: 37
Thx a lot, Max. Your advise helped me again.

I will log it with JIRA soon


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