Kevan Miller wrote:

On Sep 6, 2007, at 7:15 AM, Rick McGuire wrote:

Could you post a stack trace for this new failure?
Are you able to instantiate an instance of javax.mail.Multipart in your code?

I have a suspicion that the problem is with the classloader used to load the SMTPAppender class, not the classloader configuration of your app itself.

Rick

Xh wrote:
Hi David!

Now I use both org.apache.geronimo.configs/javamail and org.apache.geronimo.javamail/geronimo-javamail_1.4_mail dependencies.

I did just like You asked, I've configured my SMTPAppender programmatically (in servlet's init method):

SMTPAppender newAppender = new SMTPAppender();
        newAppender.setSMTPDebug(true);
        newAppender.setSMTPHost("HOST.pl");
        newAppender.setSMTPUsername("USERXX");
        newAppender.setSMTPPassword("****");
        newAppender.setFrom("[EMAIL PROTECTED]");
        newAppender.setTo("[EMAIL PROTECTED]");
        newAppender.setSubject("Test!");
        newAppender.setThreshold(Level.INFO);
        newAppender.setLayout(new org.apache.log4j.SimpleLayout());
                Logger.getRootLogger().addAppender(newAppender);

The result is still the same:

java.lang.NoClassDefFoundError: javax/mail/Multipart
    org.xh.log4jtest.Test.init(Test.java:25)
what should I do now?

Hi Lukasz,
NoClassDefFoundError means that the Multipart class is being found, but some dependent class is not being located. We need to find out what that class is...

This appears to be a problem with the classes visible from the classloader used to load the log4j classses, not with the application dependencies. Since the SMTPAppender does not have the javamail api classes (or possibly, the activation classes), it's not able to be instantiated.

One quick solution would be to drop the javamail jar into the JVM ext directory.

Rick

One possibility is the the activation spec (e.g. org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.0/geronimo-activation_1.1_spec-1.0.jar), but that's not making a lot of sense, ATM...

What JRE are you running on? Can you share your test app/deployment plans with us? Alternatively, you'll need to debug the class loading to figure out what isn't being found...

--kevan





Reply via email to