Hibernate Books

All times are UTC - 5 hours [ DST ]

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Any way to solve adding classes from java-reflected classes?
PostPosted: Mon Nov 28, 2011 6:34 pm 

Joined: Mon Nov 28, 2011 6:30 pm
Posts: 2
So anyways, trying to use hibernate within an application that is plugin based, and when I load the plugins it goes

-> Load Plugin
-> Register Commands
-> Register Database Classes (Using a remote call to annotationconfiguration.addAnnotatedClass() it throws a fit and spews massive errors.

Exception in thread "main" org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
   at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:684)
   at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1942)
   at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:765)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:684)
   at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3395)
   at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3349)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1323)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1713)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1764)
   at base.database.RequiemDB.initializeConfiguration(RequiemDB.java:132)
   at base.Requiem.start(Requiem.java:128)
   at base.RequiemLoader.main(RequiemLoader.java:17)
Caused by: java.lang.ClassNotFoundException: database.User
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at org.hibernate.annotations.common.util.ReflectHelper.classForName(ReflectHelper.java:143)
   at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.classForName(JavaReflectionManager.java:117)
   at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:680)
   ... 11 more

Does anyone know a way around this in that I would be able to properly add new classes?

Okay so I managed to get around this by using

http://www.soapui.org/xref/com/eviware/ ... acker.html

In order to force the plugin's jar file onto the classpath.

 Post subject: Re: Any way to solve adding classes from java-reflected classes?
PostPosted: Wed Aug 22, 2012 8:19 pm 

Joined: Sun Jul 15, 2012 7:57 am
Posts: 5
Hey, can you elaborate how to use the solution provided in the link.

I am a beginner, and have no idea how to add plugin's jar files in classpath.

Would really appreciate any help.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.