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 Jerry Malcolm <te...@malcolms.com> on 2021/10/03 18:54:50 UTC

Spring --> Guice Migration

I've been on the spring builds for many years.  I'm starting to migrate 
to the latest James technologies.  But I'm going to do it in small 
steps.  First step is to move to Guice from spring.  When I'm 
comfortable with that I'll start looking into taking the plunge to 
Cassandra.

I'm building from a fairly recent git source tree.  A couple of questions...

- In the docs I believe I want the jpa-guice build.  But in the 
server/apps folder there is a spring-app and a jpa-app.  I believe that 
is a new name for jpa-guice, correct?

- In the read-me file, it says the command to start it up is:

$ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar 
-Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048 
-Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-app.jar

However, the lib file in the main directory is 
james-server-jpa-app.lib.  Pretty sure that is just an update that was 
missed in the readme file.  But this command as-is fails. Changing the 
command to use the lib file name in the directory succeeds.

- What is the correct way to launch james as a service with the guice 
implementation?  There is no longer a run.sh, wrapper, etc.

thx


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


Re: Spring --> Guice Migration

Posted by "btellier@apache.org" <bt...@apache.org>.
Regarding James plugins they could be loaded from the extensions-jars
folder.

Regards.

Benoit

On 04/10/2021 11:35, Jerry Malcolm wrote:
>
> On 10/3/2021 10:02 PM, Tung Tran Van wrote:
>> Hello,
>>
>>>   I believe that is a new name for jpa-guice, correct?
>> Correct, You can see this commit:
>> https://github.com/apache/james-project/pull/487/commits/84dde0c0c4343c2149c3fd6a6664b75a1ac0d082
>>
>>
>>> There is no longer a run.sh, wrapper, etc.
>> The classpath embedded in the jar specified by the command line tells
>> where
>> the libs are so you do not need to specify the JAR.
>> We do not have so far a wrapper for Guice applications.
>>
>> Cheer
>> Tung, Tran Van
>>
> Tung, thanks for the quick response.  I definitely like the cleaner
> approach with the embedded classpath, etc.  But I have quite a few
> rather complex mailets that call out other jar files that are not part
> of james.  Where is the recommended place to put those jar files, and
> should I just add a -classpath statement to the java command to define
> the jar location to the jvm?
>
>
>> On Mon, Oct 4, 2021 at 1:55 AM Jerry Malcolm <te...@malcolms.com>
>> wrote:
>>
>>> I've been on the spring builds for many years.  I'm starting to migrate
>>> to the latest James technologies.  But I'm going to do it in small
>>> steps.  First step is to move to Guice from spring.  When I'm
>>> comfortable with that I'll start looking into taking the plunge to
>>> Cassandra.
>>>
>>> I'm building from a fairly recent git source tree.  A couple of
>>> questions...
>>>
>>> - In the docs I believe I want the jpa-guice build.  But in the
>>> server/apps folder there is a spring-app and a jpa-app.  I believe that
>>> is a new name for jpa-guice, correct?
>>>
>>> - In the read-me file, it says the command to start it up is:
>>>
>>> $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar
>>> -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048
>>> -Dlogback.configurationFile=conf/logback.xml -jar
>>> james-server-jpa-app.jar
>>>
>>> However, the lib file in the main directory is
>>> james-server-jpa-app.lib.  Pretty sure that is just an update that was
>>> missed in the readme file.  But this command as-is fails. Changing the
>>> command to use the lib file name in the directory succeeds.
>>>
>>> - What is the correct way to launch james as a service with the guice
>>> implementation?  There is no longer a run.sh, wrapper, etc.
>>>
>>> thx
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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


Re: Spring --> Guice Migration

Posted by Jerry Malcolm <te...@malcolms.com>.
On 10/3/2021 10:02 PM, Tung Tran Van wrote:
> Hello,
>
>>   I believe that is a new name for jpa-guice, correct?
> Correct, You can see this commit:
> https://github.com/apache/james-project/pull/487/commits/84dde0c0c4343c2149c3fd6a6664b75a1ac0d082 
>
>
>> There is no longer a run.sh, wrapper, etc.
> The classpath embedded in the jar specified by the command line tells 
> where
> the libs are so you do not need to specify the JAR.
> We do not have so far a wrapper for Guice applications.
>
> Cheer
> Tung, Tran Van
>
Tung, thanks for the quick response.  I definitely like the cleaner 
approach with the embedded classpath, etc.  But I have quite a few 
rather complex mailets that call out other jar files that are not part 
of james.  Where is the recommended place to put those jar files, and 
should I just add a -classpath statement to the java command to define 
the jar location to the jvm?


> On Mon, Oct 4, 2021 at 1:55 AM Jerry Malcolm <te...@malcolms.com> 
> wrote:
>
>> I've been on the spring builds for many years.  I'm starting to migrate
>> to the latest James technologies.  But I'm going to do it in small
>> steps.  First step is to move to Guice from spring.  When I'm
>> comfortable with that I'll start looking into taking the plunge to
>> Cassandra.
>>
>> I'm building from a fairly recent git source tree.  A couple of
>> questions...
>>
>> - In the docs I believe I want the jpa-guice build.  But in the
>> server/apps folder there is a spring-app and a jpa-app.  I believe that
>> is a new name for jpa-guice, correct?
>>
>> - In the read-me file, it says the command to start it up is:
>>
>> $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar
>> -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048
>> -Dlogback.configurationFile=conf/logback.xml -jar 
>> james-server-jpa-app.jar
>>
>> However, the lib file in the main directory is
>> james-server-jpa-app.lib.  Pretty sure that is just an update that was
>> missed in the readme file.  But this command as-is fails. Changing the
>> command to use the lib file name in the directory succeeds.
>>
>> - What is the correct way to launch james as a service with the guice
>> implementation?  There is no longer a run.sh, wrapper, etc.
>>
>> thx
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>

Re: Spring --> Guice Migration

Posted by "btellier@apache.org" <bt...@apache.org>.
Hi Jerry,

On 04/10/2021 10:02, Tung Tran Van wrote:
> Hello,
>
>>  I believe that is a new name for jpa-guice, correct?
> Correct, You can see this commit:
> https://github.com/apache/james-project/pull/487/commits/84dde0c0c4343c2149c3fd6a6664b75a1ac0d082
>
>> There is no longer a run.sh, wrapper, etc.
> The classpath embedded in the jar specified by the command line tells where
> the libs are so you do not need to specify the JAR.
> We do not have so far a wrapper for Guice applications.
>
> Cheer
> Tung, Tran Van
>
>
> On Mon, Oct 4, 2021 at 1:55 AM Jerry Malcolm <te...@malcolms.com> wrote:
>
>> I've been on the spring builds for many years.  I'm starting to migrate
>> to the latest James technologies.  But I'm going to do it in small
>> steps.  First step is to move to Guice from spring.  When I'm
>> comfortable with that I'll start looking into taking the plunge to
>> Cassandra.
>>
>> I'm building from a fairly recent git source tree.  A couple of
>> questions...
>>
>> - In the docs I believe I want the jpa-guice build.  But in the
>> server/apps folder there is a spring-app and a jpa-app.  I believe that
>> is a new name for jpa-guice, correct?
>>
>> - In the read-me file, it says the command to start it up is:
>>
>> $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar
>> -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048
>> -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-app.jar

Any error when you run the Java command?


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


Re: Spring --> Guice Migration

Posted by Jerry Malcolm <te...@malcolms.com>.
On 10/3/2021 10:08 PM, btellier@apache.org wrote:
> Hi Jerry,
>
> On 04/10/2021 10:02, Tung Tran Van wrote:
>> Hello,
>>
>>>   I believe that is a new name for jpa-guice, correct?
>> Correct, You can see this commit:
>> https://github.com/apache/james-project/pull/487/commits/84dde0c0c4343c2149c3fd6a6664b75a1ac0d082 
>>
>>
>>> There is no longer a run.sh, wrapper, etc.
>> The classpath embedded in the jar specified by the command line tells 
>> where
>> the libs are so you do not need to specify the JAR.
>> We do not have so far a wrapper for Guice applications.
>>
>> Cheer
>> Tung, Tran Van
>>
>>
>> On Mon, Oct 4, 2021 at 1:55 AM Jerry Malcolm <te...@malcolms.com> 
>> wrote:
>>
>>> I've been on the spring builds for many years.  I'm starting to migrate
>>> to the latest James technologies.  But I'm going to do it in small
>>> steps.  First step is to move to Guice from spring.  When I'm
>>> comfortable with that I'll start looking into taking the plunge to
>>> Cassandra.
>>>
>>> I'm building from a fairly recent git source tree.  A couple of
>>> questions...
>>>
>>> - In the docs I believe I want the jpa-guice build.  But in the
>>> server/apps folder there is a spring-app and a jpa-app.  I believe that
>>> is a new name for jpa-guice, correct?
>>>
>>> - In the read-me file, it says the command to start it up is:
>>>
>>> $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar
>>> -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048
>>> -Dlogback.configurationFile=conf/logback.xml -jar 
>>> james-server-jpa-app.jar
> Any error when you run the Java command?
>
Yes... the lib folder as specified in the readme command above is not 
the name of the folder in the build.  So when I run the command, it 
can't find the folder.

Readme:  james-server-jpa-guice.lib

Build: james-server-jpa.lib

Not a big deal.  I changed the command to match the folder name and it 
worked fine.  Just wanted to point out the incorrect lib folder name in 
the readme.

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

Re: Spring --> Guice Migration

Posted by Tung Tran Van <tu...@gmail.com>.
Hello,

>  I believe that is a new name for jpa-guice, correct?

Correct, You can see this commit:
https://github.com/apache/james-project/pull/487/commits/84dde0c0c4343c2149c3fd6a6664b75a1ac0d082

> There is no longer a run.sh, wrapper, etc.

The classpath embedded in the jar specified by the command line tells where
the libs are so you do not need to specify the JAR.
We do not have so far a wrapper for Guice applications.

Cheer
Tung, Tran Van


On Mon, Oct 4, 2021 at 1:55 AM Jerry Malcolm <te...@malcolms.com> wrote:

> I've been on the spring builds for many years.  I'm starting to migrate
> to the latest James technologies.  But I'm going to do it in small
> steps.  First step is to move to Guice from spring.  When I'm
> comfortable with that I'll start looking into taking the plunge to
> Cassandra.
>
> I'm building from a fairly recent git source tree.  A couple of
> questions...
>
> - In the docs I believe I want the jpa-guice build.  But in the
> server/apps folder there is a spring-app and a jpa-app.  I believe that
> is a new name for jpa-guice, correct?
>
> - In the read-me file, it says the command to start it up is:
>
> $ java -javaagent:james-server-jpa-guice.lib/openjpa-3.1.2.jar
> -Dworking.directory=. -Djdk.tls.ephemeralDHKeySize=2048
> -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-app.jar
>
> However, the lib file in the main directory is
> james-server-jpa-app.lib.  Pretty sure that is just an update that was
> missed in the readme file.  But this command as-is fails. Changing the
> command to use the lib file name in the directory succeeds.
>
> - What is the correct way to launch james as a service with the guice
> implementation?  There is no longer a run.sh, wrapper, etc.
>
> thx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

-- 
Tung, Tran Van
*Phone:* (+84) 35 757 6258
*Skype:* tung.tv202