james-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Fondermann <bf_...@brainlounge.de>
Subject Re: lauch james from java application
Date Wed, 30 Jan 2008 07:45:52 GMT
Robert Burrell Donkin wrote:
> On Jan 29, 2008 2:11 PM, Eduardo Luque Sola <eluque@aplicatec.com> wrote:
>> Hi, i am trying to launch james as a service in my java application but
>> i don't know how to embbebed it (do not run with run.sh). I need to run
>> it from a main java class.
> 
> if you're using the latest code then the spring deployment is probably
> the way to go

and in this case it would be required to put all libraries onto your 
classpath which after build have landed in 
spring-deployment/target/james-server*/lib

To launch James the Spring-way, just put into your main method

         Resource containerResource = new 
ClassPathResource("beans-base-config.xml");
         Resource applicationResource = new 
ClassPathResource("james-assembly.xml");
         AvalonApplicationContext context = new 
AvalonApplicationContext(containerResource, applicationResource);

and put the xml files onto the classpath.

but please note, this code is not contained in an official release yet 
and not heavily tested.

   Bernd


Mime
View raw message