Hi Grégory!


I think it follows from the Servlet Spec: (see Section 9.7.2 Servlet Spec v2.4, 
for example at: 
http://cds-esd.sun.com/ESD6/JSCDL/servlet/2.4-fr/servlet-2_4-fr-spec.pdf?AuthParam=1280739593_47a007e1dead3e4cc15170d915266791&TicketId=B%2Fw4kR6CRVtKTxRKPl9SnA7j&GroupName=CDS&FilePath=/ESD6/JSCDL/servlet/2.4-fr/servlet-2_4-fr-spec.pdf&File=servlet-2_4-fr-spec.pdf

This is also mentioned in: 
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html)





The Spec says: "... As described in the J2EE license agreement, servlet 
containers that are not part of a J2EE product should not allow the application 
to override J2SE platform classes, such as those in the java.* and javax.* 
namespaces, that J2SE does not allow to be modified. Also, servlet containers 
that are part of a J2EE product should not allow the application to override 
J2SE or J2EE platform classes, such as those in java.* and javax.*

namespaces, that either J2SE or J2EE do not allow to be modified. The container 
should not allow applications to override or access the container's 
implementation classes. ..."



The important passage is the one I marked in orange.



I was using Tomcat 5.5.27, as provided in the Magnolia EE Bundle 4.3.2, under 
Windows Vista and JRE 1.6.0.20-b2.



Tomcat 6 includes the same warnings 
(http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html), so without 
having checked, I imagine the same restrictions apply.



Other Servlet Containers will most likely ship with mail.jar, but as Mr Kanti 
points out, Tomcat likes to keep things simple, and mail.jar is not included.



I have no explanation as to why you could use mail.jar via the Webapp 
Classloader under Tomcat 6 - as far as I can tell, it should not work. Are you 
sure the mail.jar was not also hiding in another location?



>From my point of view it is not simply a matter of preference (do I prefer the 
>mail.jar in the webapp or in the container), but it is in error to place 
>mail.jar in your webapp, as the Servlet spec forbids overriding these classes 
>at the webapp level.

mail.jar and activation.jar should be in the common/lib directory in tomcat. 
Also, I am surprised that jstl-1.1.2.jar is working from it's current location, 
if we take the docs to be true.



Regards from Vienna,

Richard





















-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Grégory Joseph
Gesendet: Donnerstag, 29. Juli 2010 16:41
An: Magnolia User-List
Betreff: Re: [magnolia-user] mail.jar and Axis SOAP clients = Problems







On Jul 29, 2010, at 16:16, Unger, Richard wrote:



> Hello Everyone!

>

> I was just trying to integrate a (Axis-1.4 based) SOAP client into my 
> TemplateModel class, and was having problems with ClassNotFoundExceptions for 
> javax.mail.* classes.

>

> The reason is that magnolia includes "mail-1.4.1.jar" in the WEB-INF/lib 
> Directory of the magnolia webapps.

> However, recent versions of Tomcat will refuse to load classes coming from 
> the packages java.* or javax.* via the webapp classloader. JARs including 
> such classes must be placed in $CATALINA_HOME/common/lib to avoid problems.



Do you know since which version this is the case ? I've deployed quite a few 
Magnolia instances under Tomcat 6 instances without issues. AFAIK (but I might 
be outdated), the only forbidden packages in webapps are the servlet and jsp 
ones.



-g





>

> Moving mail-1.4.1.jar from the WEB-INF/lib to common/lib solves the problem.

>

> I don't know whether this is really a bug (since other Servlet Containers may 
> not have this restriction), but perhaps it would be better to move the 
> mail.jar in the magnolia-tomcat-bundle release...

>

> Regards from Vienna,

>

> Richard Unger

>

>

>

>

> ----------------------------------------------------------------

> For list details see

> http://www.magnolia-cms.com/home/community/mailing-lists.html

> To unsubscribe, E-mail to: <[email protected]>

> ----------------------------------------------------------------





----------------------------------------------------------------

For list details see

http://www.magnolia-cms.com/home/community/mailing-lists.html

To unsubscribe, E-mail to: <[email protected]>

----------------------------------------------------------------





----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to