A
Albretch
I am using Apache Tomcat/4.1.18 and need for a class to be accessed
across all web app contexts.
The class is read-only (no update of any kinds), singleton type of
class that is (as all singletons should) NOT lazy loaded, but all its
members are set via static initialization. (kind of a global
reference)
Now, how/where do you deploy/place this class for it to be accessed
by all
servlets?
I have tried a number of places inside Tomcat, but I have always
gotten
java.lang.IllegalAccessError or java.lang.NoClassDefFoundError
while trying to access this class.
I could imagine this was a common need and did online searches which
answers could be basically reduced to:
. putting the classes in shared/classes/ or common/classes/ or
. putting the jars in common/lib or shared/lib
. store the singleton instance in the system properties
The first two options did not work and the third one I find
unnatural. Since there are libraries and clasees that are used across
webapps, I think there must be a natural way to do this.
What am I missing here?
across all web app contexts.
The class is read-only (no update of any kinds), singleton type of
class that is (as all singletons should) NOT lazy loaded, but all its
members are set via static initialization. (kind of a global
reference)
Now, how/where do you deploy/place this class for it to be accessed
by all
servlets?
I have tried a number of places inside Tomcat, but I have always
gotten
java.lang.IllegalAccessError or java.lang.NoClassDefFoundError
while trying to access this class.
I could imagine this was a common need and did online searches which
answers could be basically reduced to:
. putting the classes in shared/classes/ or common/classes/ or
. putting the jars in common/lib or shared/lib
. store the singleton instance in the system properties
The first two options did not work and the third one I find
unnatural. Since there are libraries and clasees that are used across
webapps, I think there must be a natural way to do this.
What am I missing here?