You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class loading in Tomcat (and other web containers) is done by using a tree of
classloaders[1]. Higher level classloaders cannot access lower level classes as
they are invisible to them. The Tomcat distribution of Ontopia places
ontopia.jar at the 'common' level (apache-tomcat/common/lib) for all webapps to
use it. Individual webapps can contain additional classes at the 'webapp' level.
A typical usecase could be that a webapp defines classes to be used, e.g. as
web-editor actions or logic:externalFunction. The current version of Ontopia
cannot reach these implementations because it uses the wrong classloader in
Class.forName invokes.
The default implementation of Class.forName uses
this.getClass().getClassLoader() as classloader[2]. In the Ontopia Tomcat
distribution, this will be the 'common' level classloader. If the call was made
from a webapp, it cannot access classes at the 'webapp' level. The fix to this
issue is to replace Class.forName(String) occurrences with
Class.forName(String, boolean, ClassLoader) with the classloader used by the
current thread as argument. This would preserve a possible lower level
classloader from an individual webapp.
[1]: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
[2]:
http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#forName(java.l
ang.String,%20boolean,%20java.lang.ClassLoader)
Original issue reported on code.google.com by p.kruijsen on 19 Mar 2011 at 9:07
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
p.kruijsen
on 19 Mar 2011 at 9:07The text was updated successfully, but these errors were encountered: