Hi,
I'm trying to install a custom CharsetProvider (UTF7) with my web
application (i.e. deliver a JAR with a
META-/services/java.nio.charset.spi.CharsetProvider entry in WEB-INF/lib)
However the CharsetProvider isn't recognized when it comes to parsing
(i.e. calling javax.mail.Part.getContent())
If I place the JAR into <JRE>/lib/ext it works.
The API of CharsetProvider
(http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/spi/CharsetProvider.html)
says:
"Charset providers may be installed in an instance of the Java platform
as extensions, that is, jar files placed into any of the usual extension
directories. Providers may also be made available by adding them to the
applet or application class path or by some other platform-specific
means. Charset providers are looked up via the current thread's context
class loader."
I interpret it this way:
If the JAR is in the classpath (specifically: if it is found by the
current context class loader) the Charsetprovider should be
automatically recognized.
I checked that the context classloader immediately before calling
Part.getContent() is the webapp-classloader, so the JARs in WEB-INF/lib
should be visible.
So is there any solution to this other than placing the JAR in an
extension directory?
Could this be a Tomcat bug or is this expected behaviour due to the
speciality of the webapp classloaders? (I tried to understand the
implifications of Tomcats classloading at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html
but couldn't figure it out by myself)
Thank you,
Christoph
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]