| As the stack trace shows,
some code within Hibernate has done a Class.forName() to look up
com.MyClass. Of course in a modular world, just a class name is not
enough to find a class; you also have to know which module has that
class. In this case it looks like Hibernate has guessed that it can just
call Class.forName() with one argument, which causes it to use its own
classloader, which then delegates up to the surrounding web container. In other words, Hibernate is stupid, and breaks modularity! It's well known to OSGi programmers as a "difficult" library to use. If Hibernate could import the package containing the domain class, then all would be well. Since you don't want to rebuild Hibernate for every possible domain package, you could look at creating a fragment with Hibernate as its host and adding the Import-Package for the domain. Regards Neil
|
- ClassNotFoundException Chad.Davis
- Re: ClassNotFoundException Neil Bartlett
- RE: ClassNotFoundException Chad.Davis
- Re: ClassNotFoundException Holger Hoffstätte


