-->
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.  [ 5 posts ] 
Author Message
 Post subject: eclipse rcp + hibernate
PostPosted: Thu Mar 23, 2006 7:53 am 
Newbie

Joined: Thu Mar 23, 2006 7:27 am
Posts: 2
Hi,

i'm trying to use a working hibernate configuration under a simple eclipse rcp application. While it loads the configuration and mapping files and tries to create the sessionfactory, it throws a mapping exception for java.lang.String with message "persistent class not know".

Any idea?

Thanks in advance.
KL


Hibernate:3.1.2

Eclipse: 3.2.0, I20060223-1656

Stack trace:
Code:
org.hibernate.MappingException: persistent class not known: java.lang.String
   at org.hibernate.cfg.Configuration$1.getIdentifierType(Configuration.java:1917)
   at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:226)
   at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:236)
   at org.hibernate.type.SpecialOneToOneType.getColumnSpan(SpecialOneToOneType.java:45)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.ToOne.isValid(ToOne.java:82)
   at org.hibernate.mapping.Property.isValid(Property.java:185)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:395)
   at org.hibernate.mapping.SingleTableSubclass.validate(SingleTableSubclass.java:43)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:984)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1169)
   at foo.editor.utils.HibernateUtil.<clinit>(HibernateUtil.java:21)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at foo_editor.Activator.start(Activator.java:26)
   at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:994)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:988)
   at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:969)
   at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:314)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:256)
   at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.preFindLocalClass(EclipseLazyStarter.java:83)
   at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:402)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:186)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:338)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:390)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:351)
   at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:81)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:276)
   at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
   at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1245)
   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:138)
   at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
   at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
   at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:95)
   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:374)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
   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:338)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
   at org.eclipse.core.launcher.Main.run(Main.java:977)
   at org.eclipse.core.launcher.Main.main(Main.java:952)


database: MySQL 5.0.16


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 9:05 am 
Beginner
Beginner

Joined: Thu Nov 11, 2004 12:18 pm
Posts: 37
Location: Baltimore, MD
This isn't an RCP related problem, but rather a mapping issue. I can't tell exactly what's wrong, but it looks like you need to take a look at any one-to-one mappings that you have. Make sure that the associated class in these mappings are set correctly in the .hbm.xml files.

_________________
-Chris


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 9:36 am 
Newbie

Joined: Thu Mar 23, 2006 7:27 am
Posts: 2
When i'm doing the same thing from not the RCP plug-in, but from a simple class it's works fine...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 12:04 pm 
Beginner
Beginner

Joined: Thu Nov 11, 2004 12:18 pm
Posts: 37
Location: Baltimore, MD
Hibernate doesn't perform any differently from within RCP, Swing, or no UI. I've used hibernate on a few different RCP Applications, and never had any issues different from what our unit tests would show.

The only thing I can think that could be different is the classpath. I know RCP has some funky classpath usage, but I'm not sure if that would explain why you get an error about java.lang.String.

Also, make sure your RCP has the most up-to-date code/mappings.

_________________
-Chris


Top
 Profile  
 
 Post subject: Buddy System
PostPosted: Fri Mar 24, 2006 9:52 am 
Beginner
Beginner

Joined: Fri Mar 04, 2005 7:12 pm
Posts: 34
You need to use buddy registration. The Hibernate classes do not know about your RCP classes in advance. See:

http://www.hibernate.org/311.html

_________________
J. Michael Dean, MD


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