I'm currently spring from within my own Mailet as well, in my instance I
have the mailet initializing its own context (I only have the one mailet) :

    public void init(MailetConfig mailetConfig) throws MessagingException {
        super.init(mailetConfig);

        if (LoggingUtils.noAppendersConfigured()) { // is has logging been
initialised already?
            PropertyConfigurator.configureAndWatch(new
LoggingUtils().getPropertiesFile().getPath(), LOG4J_TIMEOUT);
        }

        XmlBeanFactory springContext = new XmlBeanFactory(
                new ClassPathResource("/rmi-service-context.xml"));

        try {
            PropertyPlaceholderConfigurer ppc = new
PropertyPlaceholderConfigurer();
            Properties props = new Properties();
            props.load(new
FileInputStream("/etc/bulletinwireless/bulletinmail/bulletinmail.properties"));
            ppc.setProperties(props);
            ppc.postProcessBeanFactory(springContext);
        } catch (IOException e) {
            throw new MessagingException(e.getMessage());
        }

        springContext.autowireBeanProperties(this,
AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true);
    }

Seems to work for me...

On 2/28/08, Guido Franz <[EMAIL PROTECTED]> wrote:
>
> Hello
>
> Yesterday I tried to integrate a Spring application context into James,
> that can be used within Mailets. It succeeded only halfway. My custom
> component will be loaded during startup (I print out some loading
>
>
-- 
"The L in LAMP stands for Linux, not Looney" - Jonathan Schwartz, Sun
Microsystems, Inc.

Reply via email to