-->
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.  [ 6 posts ] 
Author Message
 Post subject: class path issues in eclipse console configuration
PostPosted: Wed Jan 17, 2007 12:18 pm 
Newbie

Joined: Wed Jan 17, 2007 11:58 am
Posts: 6
I am using the JBoss-IDE version of the Hibernate plugin for eclipse to connect to a oracle database and produce Java and hibernate mapping files. After sorting out some problems with my configuration I have got this stage to work and now have a large directory of Java and associated mapping files. Thanks this has saved me loads of work :)

Eclipse version: 3.2.1
Hibernate eclipse plugin version: 3.1.0.beta5
JBoss IDE plugin version: 1.6.0.GA
Name and version of the database you are using: Oracle 10.2.0

My problem is when attempting to expand the view of the mappings in the console configuration browser in eclipse. With the class path of the console configuration set just to include the directory containing the java/hbm.xml files I can expand the 'Database' part of the tree, but the 'Configuration' branch gives the following exception.

Error
Wed Jan 17 12:00:22 GMT 2007
Problems while creating sessionfactory

Quote:
org.hibernate.MappingException: component class not found: ccdc.classie.persistence.CommunicationEntryMapId
at org.hibernate.mapping.Component.getComponentClass(Component.java:105)
at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:123)
at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:39)
at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:32)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:126)
at org.hibernate.mapping.Component.buildType(Component.java:170)
at org.hibernate.mapping.Component.getType(Component.java:146)
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:988)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1173)
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:69)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.ClassNotFoundException: ccdc.classie.persistence.CommunicationEntryMapId
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
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:102)
at org.hibernate.mapping.Component.getComponentClass(Component.java:102)
... 18 more


The obvious thought was to add more paths to the class path of the console configuration. If I do this so that the project directory (i.e. that above 'ccdc') is present and ccdc.classie.persistence.CommunicationEntryMapId should be mapped properly I get a different exception. My problem is in working out what this one means and what I can do about it.

Quote:
Error
Wed Jan 17 16:15:37 GMT 2007
java.lang.NullPointerException

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:69)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)



Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 17, 2007 1:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
beta5 is an *ooold* version ;)

why don't you use b9a ?

(and with respect to jboss ide 1.6.x that shouldn't even work on eclipse 3.2...)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 8:03 am 
Newbie

Joined: Wed Jan 17, 2007 11:58 am
Posts: 6
Well I followed the jboss plugin instructions and that was the latest 'stable' version obtained by the eclipse plugin update system. I realise this is JBoss' problem, but having stable releases at the top of the download page seems a bit useless if 'stable' means 'so old it's broken'.

Anyhow, after much downloading I now have 3.2.0beta8, and the behaviour is better but fairly similar. It is better in that I can now open the 'Configuration' branch of my console configuration. But if I try to use the entities by right clicking and selecting "HQL editor" I get the following error:

Quote:
eclipse.buildId=M20060921-0945
java.version=1.5.0_10
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86

Error
Thu Jan 18 11:56:17 GMT 2007
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".

java.lang.NullPointerException
at java.util.TreeMap.compare(Unknown Source)
at java.util.TreeMap.getEntry(Unknown Source)
at java.util.TreeMap.get(Unknown Source)
at org.hibernate.console.KnownConfigurations.find(KnownConfigurations.java:225)
at org.hibernate.eclipse.console.AbstractQueryEditor.getConsoleConfiguration(AbstractQueryEditor.java:51)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.updateText(DynamicSQLPreviewView.java:137)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.setCurrentEditor(DynamicSQLPreviewView.java:130)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.hookIntoEditor(DynamicSQLPreviewView.java:114)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView.access$2(DynamicSQLPreviewView.java:107)
at org.hibernate.eclipse.console.views.DynamicSQLPreviewView$1.partBroughtToTop(DynamicSQLPreviewView.java:92)
at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:83)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53)
at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(PartListenerList2.java:81)
at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:90)
at org.eclipse.ui.internal.WWinPartService$1.partBroughtToTop(WWinPartService.java:40)
at org.eclipse.ui.internal.PartListenerList2$2.run(PartListenerList2.java:83)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.PartListenerList2.fireEvent(PartListenerList2.java:53)
at org.eclipse.ui.internal.PartListenerList2.firePartBroughtToTop(PartListenerList2.java:81)
at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:90)
at org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(WorkbenchPagePartList.java:75)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(WorkbenchPagePartList.java:51)
at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:152)
at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1181)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3200)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2485)
at org.hibernate.eclipse.console.HibernateConsolePlugin.openScratchHQLEditor(HibernateConsolePlugin.java:284)
at org.hibernate.eclipse.console.actions.HQLScratchpadAction.openQueryEditor(HQLScratchpadAction.java:38)
at org.hibernate.eclipse.console.actions.OpenQueryEditorAction.doRun(OpenQueryEditorAction.java:37)
at org.hibernate.eclipse.console.actions.OpenQueryEditorAction.runWithEvent(OpenQueryEditorAction.java:18)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)



And if I try to run a query (which I realise is probably futile given the above I get similar errors due to classes not being found. I have tried adding the source paths to both the main java project and the console configuration.

Quote:
eclipse.buildId=M20060921-0945
java.version=1.5.0_10
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Command-line arguments: -os win32 -ws win32 -arch x86

Error
Thu Jan 18 11:41:57 GMT 2007
entity class not found: ccdc.classie.persistence.PublicationMismatchMap

org.hibernate.MappingException: entity class not found: ccdc.classie.persistence.PublicationMismatchMap
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:99)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:168)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:118)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:425)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:68)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:52)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:56)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.ClassNotFoundException: ccdc.classie.persistence.PublicationMismatchMap
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
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:100)
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:96)
... 41 more



I do realise you are now on Beta9. Is it safe to try and install the beta9 code over the beta8 version I have as part of the latest JBossIDE?
Failing that I think I may just use the reverse engineering tools on their own and disregard the IDE.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 8:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi M Towler,

Well b5 does work; but of course there are some bugs and you apperently bumped into one and I just wanted you to try and and use the latest release of Hibernate Tools (not to confuse with what is considered the stable and supported verson of the complete JBoss IDE release).

The latest release (beta9a) has major fixes done with respect to classpath and thus it should be this one we try and replicate (and consequently) fix the issue in.

b9a is fully compatiable with jboss ide 2.x, but I have seent that eclipse for some reason can refuse to use the beta9a feature and instead uses a mix of beta8 and beta9. To circumvent this delete the directory called feature/org.hibernate.eclipse-3.2.0.beta8 and eclipse should gets its act together.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 9:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. i just noticed you said you tried to add some source paths to the console configuration; that won't help you since its the *class* path that hibernate needs to load the classes.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 18, 2007 9:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and a final note on b9a is that it automatically picks up a project classpaths (if you tell it which project it should use) removing the whole requirement for managing a seperate classpath.

_________________
Max
Don't forget to rate


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