geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@alumni.princeton.edu>
Subject Re: class loading issue
Date Mon, 23 Jan 2006 14:16:26 GMT
Tyler,

You shouldn't need any code changes for this.  If you want to hide
classes on the server class path from your application, just add
<hidden-classes> elements to your web plan listing the packages you
want to hide.  e.g.:

<hidden-classes><filter>org.apache.log4j</filter></hidden-classes>
<hidden-classes><filter>org.apache.axis</filter></hidden-classes>
...

See also http://chariotsolutions.com/geronimo/web-plan.html#web-plan-libs

You will still need the files in your WEB-INF/lib, but if you hide all
the versions from the server, it shouldn't even matter how the
context-priority-classloader is set.

Thanks,
    Aaron

On 1/23/06, tbot55@yahoo.com <tbot55@yahoo.com> wrote:
> I must be misunderstanding something. Here's my
> problem. I'm trying to use an application that
> requires a different version of jdom.jar and axis.jar,
> and it also uses commons-httpclient.jar, which isn't
> found in the geronimo repository.
>
> It does some webservices stuff. So I replace the
> jdom.jar in the repository directory and I bypass one
> of my problems. Then I have to somewhat merge the
> axis.jar it comes with and the one in the geronimo
> repository, and I overcome another problem (though now
> the daytrader example is breaking). After this, I'm
> getting a commons-httpclient class-not-found error,
> even though I've manually added it to the repository.
>
> So, I figure out another workaround: I set the
> context-priority-classloader variable to true in the
> geronimo-web.xml, and I modify the
> TomcatClassLoader.java file to this (full modified
> TomcatClassLoader.java file attached):
> ------------------------------------------------------
> TomcatClassLoader.ResourceClassLoader.getResource:----
> ------------------------------------------------------
>            if ((contextPriorityClassLoader &&
>                 name.startsWith("org/apache/axis")) ||
>                (contextPriorityClassLoader &&
>
> name.startsWith("org/apache/commons/httpclient"))){
>            }
>            else if (true
> ||//!contextPriorityClassLoader ||
> ...
>            return super.loadClass(name);
>        }
> ------------------------------------------------------
> TomcatClassLoader.loadClass: -------------------------
> ------------------------------------------------------
>            if ((contextPriorityClassLoader &&
>                 name.startsWith("org.apache.axis")) ||
>                (contextPriorityClassLoader &&
>
> name.startsWith("org.apache.commons.httpclient"))){
>            }
>            else if (true
> ||//!contextPriorityClassLoader ||
> ...
>                return super.loadClass(name);
>            }
> -----------------------------------------------------------
> -----------------------------------------------------------
>
> This makes the application work. Now, I did try just
> setting context-priority-classloader to true without
> doing these modifications, and I got errors about not
> initializing log4j properly. Is there a better way to
> make the class loader do what I want to do?
>
> Tyler
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>

Mime
View raw message