users@glassfish.java.net

Classloading issue: filter class in domain1/lib/applibs/*.jar not loaded

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Nov 2007 19:14:26 PST

A user at Glassfish Chinese forum reported this problem:

http://gceclub.sun.com.cn/NASApp/sme/jive/thread.jsp?forum=22&thread=46965

When a servlet filter class is packaged in a jar in domain1/lib/applibs/ directory, this filter class is not accessible, and the webapp failed to load. He also reported that placing the jar in domain1/lib didn't work either.

I wrote a simple webapp, and my finding is putting the jar in domain1/lib works, but in lib/applibs does NOT work, i.e., the webapp failed to start because the filter class is not accessible. So a reproducible issue.

Is this a bug or by design?

Since it works when the jar is in domain/lib, so I think the app is properly coded and configured.

I explained the the user that since the web container needs to manage the lifecycle of the filter, the jar needs to reside in domain1/lib so the container code can access it, rather than applibs/, which is used by apps. I find it hard to swallow and can't even convince myself this is a valid answer.

How do you think? Appreciate your opinion.

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=243988