geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: G2.0.1 geronimo-javamail dependency is not loading?
Date Thu, 06 Sep 2007 00:25:03 GMT
1. you should use:

<dependency>
   <groupId>org.apache.geronimo.configs</groupId>
   <artifactId>javamail</artifactId>
   <type>car</type>
</dependency>

to minimize the chances of ClassCastException due to loading javamail  
in the wrong classloader

2. this still won't work unless log4j is using the
     public static Class<?> forName(String name, boolean initialize,
				   ClassLoader loader)
method with the ThreadContextClassLoader.  Can you construct the  
appender yourself in your servlet init method, where you _can_ access  
javamail classes via the above dependency, and register it with log4j  
in code?

thanks
david jencks

On Sep 5, 2007, at 4:22 PM, Xh wrote:

> Hi All!
>
> I have very strange problem.
>
> In my geronimo-web.xml I wrote:
>
> <dependency>
>                 <groupId>repository.org.apache.geronimo.javamail</ 
> groupId>
>                 <artifactId>geronimo-javamail_1.4_mail</artifactId>
>                 <version>1.2</version>
>                 <type>jar</type>
> </dependency>
>
> but when SMTPAppender for Log4j is being loaded I get:
>
> java.lang.NoClassDefFoundError: javax/mail/Multipart
> 	java.lang.Class.getDeclaredConstructors0(Native Method)
> 	java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
> 	java.lang.Class.getConstructor0(Class.java:2699)
> 	java.lang.Class.newInstance0(Class.java:326)
> 	java.lang.Class.newInstance(Class.java:308)
> 	org.apache.log4j.xml.DOMConfigurator.parseAppender 
> (DOMConfigurator.java:174)
> 	org.apache.log4j.xml.DOMConfigurator.findAppenderByName 
> (DOMConfigurator.java:150)
> 	org.apache.log4j.xml.DOMConfigurator.findAppenderByReference 
> (DOMConfigurator.java:163)
> 	org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement 
> (DOMConfigurator.java:425)
> 	org.apache.log4j.xml.DOMConfigurator.parseRoot 
> (DOMConfigurator.java:394)
> 	org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
> 	org.apache.log4j.xml.DOMConfigurator.doConfigure 
> (DOMConfigurator.java:712)
> 	org.apache.log4j.xml.DOMConfigurator.doConfigure 
> (DOMConfigurator.java:604)
> 	org.apache.log4j.xml.DOMConfigurator.configure 
> (DOMConfigurator.java:733)
> 	org.xh.log4jtest.Test.init(Test.java:21)
>
> I've looked the repository/org/apache/geronimo/javamail/geronimo- 
> javamail_1.4_mail/1.2/geronimo-javamail_1.4_mail-1.2.jar file
> and I can see that there is javax/mail/Multipart.class file.
>
> Is geronimo not loading my dependency or is it something else?
>
> best regards
> Ɓukasz
>
>
>
>
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the  
> answer. Try it
> now.
> http://uk.answers.yahoo.com/


Mime
View raw message