[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2317) CGLIB unable to lazy load classes in diff. classloader than hibernate jars
Jason Novotny (JIRA)
noreply at atlassian.com
Wed Dec 20 04:29:04 EST 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2317?page=comments#action_25688 ]
Jason Novotny commented on HHH-2317:
------------------------------------
I don't think I explained well enough-- here's the actual structure
webappA/WEB-INF/lib
+ hibernate-3.2.jar, cglib-x.jar, asm-*.jar, etc
+ PersistenceServiceImpl which acts as a wrapper around hibernate-- responsible for loading in mapping files
webappB/
+ contains hibernate mapping files (no other jars)
shared/lib
+ PersistenceService interface
So webappB has access to the PersistenceService interface since it's in shared/lib, but the actual impl is in webappA and has webapp A's classloader. To recap, if lazy is false,then webappB can use the concrete PersistenceServiceImpl to load in the mapping files in B. However, if lazy is true, then the proxies need to be created.
I then tried experimenting with Configuration.addResource(mappingFile, classLoader) in the PersistenceServiceImpl so that it could use webapp B's classloader to locate its mapping file and was greeted with this error:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
which seems in line with the reporter of http://opensource.atlassian.com/projects/hibernate/browse/HHH-2318
In a nutshell I am trying to figure out any possible way where the hibernate and co. jars do not need to be placed in every single webapp.
Thanks, Jason
> CGLIB unable to lazy load classes in diff. classloader than hibernate jars
> ---------------------------------------------------------------------------
>
> Key: HHH-2317
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2317
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.2.1
> Reporter: Jason Novotny
>
>
> Please see http://forum.hibernate.org/viewtopic.php?p=2334617#2334617 for more details and possible fix
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list