You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Emma Sesmero <em...@gmail.com> on 2014/06/17 21:51:32 UTC

Re: James deployment

Hi all,

I am trying to implement a bundle with James and Bond and I am a little
stuck. So I am going to explain the situation just in case someone can give
me some guidance.

The Bond application is developed in GWT using Maven and currently has an
embedded Jetty. So that the pom.xml creates a war that can be deployed
directly.

I have seen that James uses Spring to create the ApplicationContext
injecting the necessary beans. So I believe that I have to make the
following changes in both applications:

- Bond: I have to modify the application so that it uses Spring and it
creates a jar instead of a war, similarly to this example [1].

- James:


* For Maven: I have to add the Bond module and dependency in james/pom.xml,
the dependency in james/app/pom.xml and the dependency
in james/container/spring/pom.xml


* For Spring: I have to import the bond-context.xml (the Bond Spring
configuration file)
into james/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
and I might have to add a new BeanFactory in the package
org.apache.james.container.spring.bean.factory and in the file
james/container/spring/src/main/resources/META-INF/spring/loaders-context.xml,
if necessary.


Currently, when I add the next line to the spring-server.xml:

<import resource="classpath:META-INF/webapp/WEB-INF/bond-context.xml"/>


I obtain a BeanCreationException creating the
Bean org.apache.james.mailbox.MailboxManager in the wrapper.log. So
obviously I am missing something, but, since the log catches the Exception
in a completely different part of the code, I do not know how to continue.

Like I said, I am stuck. So I was wondering if any of you could help me, or
at least tell me if I am in the right track or there is a simpler way to
approach this.

Thank you in advance.


[1]
http://steveliles.github.io/setting_up_embedded_jetty_8_and_spring_mvc_with_maven.html



2014-04-29 12:36 GMT+02:00 Emma Sesmero <em...@gmail.com>:

> Thank you very much, Eric.
> I'll get right on it.
>
>
> 2014-04-29 5:53 GMT+02:00 Eric Charles <er...@apache.org>:
>
> Hi Emma,
>>
>> This is how it works.
>>
>> You will need also to look at the different spring files spread in the
>> other modules. These are responsible to inject the beans.
>>
>> Load the all the server module in your favorite IDE
>> http://james.apache.org/server/3/dev-build.html
>>
>> The modules are usually built upon a api/library/impl pattern.
>>
>> The unit tests are also a great place to start. Have a look for example
>> at the data-file: try to understand how the injection is made and run
>> the tests.
>>
>> You will also need to understand the difference between the mailbox
>> persistence and the mail repository (that's something we need to remove,
>> but we have to live with it for now)
>> http://james.apache.org/server/3/feature-persistence.html
>>
>> Hope this helps,
>>
>> Eric
>>
>>
>> On 04/25/2014 05:29 PM, Emma Sesmero wrote:
>> > Hi all,
>> >
>> > Currently I am studying how james is run, how it starts, to be able to
>> add
>> > Bond in the process, so it can start at the same time when it deploys.
>> >
>> > I have checked the class JamesAppSpringMain, that, if I am not
>> mistaken, is
>> > the start point, and seen the
>> > file META-INF/org/apache/james/spring-server.xml with the files imported
>> > for each server that start with james.
>> > I have seen that it uses the Spring framework, so I am working on
>> becoming
>> > familiar with it to be able to understand better how it works to be
>> able to
>> > modify it and add the Bond deployment to it.
>> >
>> > I was wondering if any of you has a better understanding of how this
>> works
>> > exactly and might be able to give me a hand.
>> >
>> > Thank you very much in advance.
>> > Kind regards.
>> >
>> > Emma
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
>

Re: James deployment

Posted by Eric Charles <er...@apache.org>.
Hi Emma,

I would declare in the GWT app (Bond) the james sever dependencies and
create the james context on GWT init.

The jars contain the spring definitions and are loaded via classpath, so
it should work well.

If it doesn't, you may miss some dependencies (check you have them all)
- use also the latest trunk (hopefully will gain soon more activies).

On 06/17/2014 09:51 PM, Emma Sesmero wrote:
> Hi all,
> 
> I am trying to implement a bundle with James and Bond and I am a little
> stuck. So I am going to explain the situation just in case someone can
> give me some guidance.
> 
> The Bond application is developed in GWT using Maven and currently has
> an embedded Jetty. So that the pom.xml creates a war that can be
> deployed directly.
> 
> I have seen that James uses Spring to create the ApplicationContext
> injecting the necessary beans. So I believe that I have to make the
> following changes in both applications:
> 
>     - Bond: I have to modify the application so that it uses Spring and
>     it creates a jar instead of a war, similarly to this example [1].
> 
>     - James: 
> 
> 
>         * For Maven: I have to add the Bond module and dependency in
>         james/pom.xml, the dependency in james/app/pom.xml and the
>         dependency in james/container/spring/pom.xml
> 
> 
>         * For Spring: I have to import the bond-context.xml (the Bond
>         Spring configuration file)
>         into james/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml
>         and I might have to add a new BeanFactory in the package
>         org.apache.james.container.spring.bean.factory and in the file
>         james/container/spring/src/main/resources/META-INF/spring/loaders-context.xml,
>         if necessary.
> 
> 
> Currently, when I add the next line to the spring-server.xml:
> 
>         <import
>         resource="classpath:META-INF/webapp/WEB-INF/bond-context.xml"/>
> 
> 
> I obtain a BeanCreationException creating the
> Bean org.apache.james.mailbox.MailboxManager in the wrapper.log. So
> obviously I am missing something, but, since the log catches the
> Exception in a completely different part of the code, I do not know how
> to continue.
> 
> Like I said, I am stuck. So I was wondering if any of you could help me,
> or at least tell me if I am in the right track or there is a simpler way
> to approach this.
> 
> Thank you in advance.
> 
> 
> [1]
> http://steveliles.github.io/setting_up_embedded_jetty_8_and_spring_mvc_with_maven.html
> 
> 
> 
> 2014-04-29 12:36 GMT+02:00 Emma Sesmero <emmasesmero@gmail.com
> <ma...@gmail.com>>:
> 
>     Thank you very much, Eric.
>     I'll get right on it.
> 
> 
>     2014-04-29 5:53 GMT+02:00 Eric Charles <eric@apache.org
>     <ma...@apache.org>>:
> 
>         Hi Emma,
> 
>         This is how it works.
> 
>         You will need also to look at the different spring files spread
>         in the
>         other modules. These are responsible to inject the beans.
> 
>         Load the all the server module in your favorite IDE
>         http://james.apache.org/server/3/dev-build.html
> 
>         The modules are usually built upon a api/library/impl pattern.
> 
>         The unit tests are also a great place to start. Have a look for
>         example
>         at the data-file: try to understand how the injection is made
>         and run
>         the tests.
> 
>         You will also need to understand the difference between the mailbox
>         persistence and the mail repository (that's something we need to
>         remove,
>         but we have to live with it for now)
>         http://james.apache.org/server/3/feature-persistence.html
> 
>         Hope this helps,
> 
>         Eric
> 
> 
>         On 04/25/2014 05:29 PM, Emma Sesmero wrote:
>         > Hi all,
>         >
>         > Currently I am studying how james is run, how it starts, to be
>         able to add
>         > Bond in the process, so it can start at the same time when it
>         deploys.
>         >
>         > I have checked the class JamesAppSpringMain, that, if I am not
>         mistaken, is
>         > the start point, and seen the
>         > file META-INF/org/apache/james/spring-server.xml with the
>         files imported
>         > for each server that start with james.
>         > I have seen that it uses the Spring framework, so I am working
>         on becoming
>         > familiar with it to be able to understand better how it works
>         to be able to
>         > modify it and add the Bond deployment to it.
>         >
>         > I was wondering if any of you has a better understanding of
>         how this works
>         > exactly and might be able to give me a hand.
>         >
>         > Thank you very much in advance.
>         > Kind regards.
>         >
>         > Emma
>         >
> 
>         ---------------------------------------------------------------------
>         To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>         <ma...@james.apache.org>
>         For additional commands, e-mail:
>         server-dev-help@james.apache.org
>         <ma...@james.apache.org>
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org