-->
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: Problem configuring after adding annotated class
PostPosted: Thu Apr 14, 2011 6:09 pm 
Newbie

Joined: Thu Apr 14, 2011 6:03 pm
Posts: 3
I get a ClassNotFoundException when I try to configure after adding an annotated class from a jar that is not on the classpath.

I am able to create the Class object from the class file in this external jar (meaning it isn't on the runtime classpath).

I use this object as the parameter call to .addAnnotatedClass()

The configuration fails with a ClassNotFoundException, it looks as if internally Hibernate is attempting to load this class from the runtime classpath and it isn't there so an AssertionException is raised.

Any ideas on how to resolve this?


Top
 Profile  
 
 Post subject: Re: Problem configuring after adding annotated class
PostPosted: Mon Apr 18, 2011 8:31 am 
Newbie

Joined: Wed Mar 23, 2011 2:47 am
Posts: 8
problem might be in .hbm file class path shoud not be mentoned.


Top
 Profile  
 
 Post subject: Re: Problem configuring after adding annotated class
PostPosted: Mon Apr 18, 2011 7:24 pm 
Newbie

Joined: Thu Apr 14, 2011 6:03 pm
Posts: 3
I am not using a .hbm file. I am adding an annotated class by a code call.

Is an .hbm file required when adding an annotated class?


Top
 Profile  
 
 Post subject: Re: Problem configuring after adding annotated class
PostPosted: Fri Apr 29, 2011 6:47 pm 
Newbie

Joined: Thu Apr 14, 2011 6:03 pm
Posts: 3
Here is the root exception I am encountering:

Caused by: java.lang.ClassNotFoundException: ELenderCDO
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
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:677)
... 55 more

It appears that hibernate is internally using the system class loader, which will not be able to find this class.
Is there anyway to configure hibernate to use a custom class loader?


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.