geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xh <xhsaymyn...@yahoo.co.uk>
Subject Re: G2.0.1 geronimo-javamail dependency is not loading?
Date Thu, 06 Sep 2007 15:08:15 GMT
Hi Kevan,

-----------------------------------
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...
-----------------------------------

nope, I've tried it.

-----------------------------------
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...
-----------------------------------

Linux Ubuntu
$ java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)


And now my deployment files:

geronimo-web.xml:

<?xml version="1.0" encoding="UTF-8"?>

    xmlns:naming="http://geronimo.apache.org/xml/ns/naming">
    <environment>
        <moduleId>
            <groupId>org.xh</groupId>
            <artifactId>Log4jTest</artifactId>
        </moduleId>
        <dependencies>
            <dependency>
                <groupId>org.apache.geronimo.configs</groupId>
                <artifactId>javamail</artifactId>
                <version>2.0.1</version>
                <type>car</type>
            </dependency>
            <dependency>
                <groupId>org.apache.geronimo.javamail</groupId>
                <artifactId>geronimo-javamail_1.4_mail</artifactId>
                <version>1.2</version>
                <type>jar</type>
            </dependency>
        </dependencies>
    </environment>

    <context-root>/Log4jTest</context-root>
</web-app>

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="Log4jTest" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Log4jTest</display-name>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <servlet>
        <display-name>Test</display-name>
        <servlet-name>Test</servlet-name>
        <servlet-class>org.xh.log4jtest.Test</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Test</servlet-name>
        <url-pattern>/Test</url-pattern>
    </servlet-mapping>

</web-app>

my servlet:

package org.xh.log4jtest;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.net.SMTPAppender;

public class Test extends javax.servlet.http.HttpServlet implements
        javax.servlet.Servlet {
    static final long serialVersionUID = 1L;

    public void init() {
        // throws NoDef error!
        SMTPAppender newAppender = new SMTPAppender();

        // any of the below instructions will be executed
        newAppender.setSMTPDebug(true);
        // values removed
        newAppender.setSMTPHost("");
        newAppender.setSMTPUsername("");
        newAppender.setSMTPPassword("");
        newAppender.setFrom("");
        newAppender.setTo("");
        newAppender.setSubject("Error!");
        newAppender.setThreshold(Level.INFO);
        newAppender.setLayout(new org.apache.log4j.SimpleLayout());

        Logger.getRootLogger().addAppender(newAppender);
    }
}

I have removed Log4j and its DOMConfigurator, because it raise the same error.


best regards
Ɓukasz







      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  http://uk.promotions.yahoo.com/forgood/environment.html

Mime
View raw message