You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by nodje <no...@gmail.com> on 2008/06/04 06:14:59 UTC

Embedding James in a Java application

Hi,

I'm trying to find a way to embed an SMTP server in our Java application.
It's ALWAYS a problem to get access to an SMTP server where we install our
Java applications.

If we could get James to run within a Spring context, it'd be absolutly
brilliant.
(found this mentioned in
http://www.nabble.com/Embedding-James-to9169298.html#a9169298)

What is the status of this now? Can anyone tell me if there are other links
to look at? 
Or is this
http://svn.apache.org/repos/asf/james/server/sandbox/spring-integration/
still the reference?

-nodje
-- 
View this message in context: http://www.nabble.com/Embedding-James-in-a-Java-application-tp17638835p17638835.html
Sent from the James - Users mailing list archive at Nabble.com.


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


Re: Embedding James in a Java application

Posted by xc...@allette.com.au.
Anyone could help, please?

>
> Hi all,
>
> I am trying to do the same thing - embedded James into our Java
> Application
> for sending emails only purpose. I am following this thread and check out
> the spring-deployment and build-tool project, then try to build it with
> ant
> (in Eclipse). I got the following errors. Could you please help? If you
> need
> more information, please let me know. Appreciated!
>
> Many thanks,
> tim
>
> Buildfile: E:\Job\spring-deployment\build.xml
> compile:
>     [javac] Compiling 4 source files to
> E:\Job\spring-deployment\build\classes
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\adaptor\FileSystemBridge.java:21:
> package org.apache.james.services does not exist
>     [javac] import org.apache.james.services.FileSystem;
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\adaptor\FileSystemBridge.java:30:
> cannot find symbol
>     [javac] symbol: class FileSystem
>     [javac] public class FileSystemBridge implements FileSystem,
> ResourceLoaderAware {
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:32:
> cannot find symbol
>     [javac] symbol: class AvalonApplicationContext
>     [javac] public class JamesApplicationContext extends
> AvalonApplicationContext {
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\AvalonWebApplicationContext.java:44:
> cannot find symbol
>     [javac] symbol  : variable AvalonApplicationContext
>     [javac] location: class
> org.apache.james.container.spring.beanfactory.AvalonWebApplicationContext
>     [javac]
> AvalonApplicationContext.loadAvalonBasedBeanDefinitions(defaultListableBeanFactory,
> springBeanResource, jamesAssemblyResource);
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:45:
> cannot find symbol
>     [javac] symbol  : variable SPRING_BEANS_CONF
>     [javac] location: class
> org.apache.james.container.spring.beanfactory.JamesApplicationContext
>     [javac] return newJamesApplicationContext(SPRING_BEANS_CONF,
> JAMES_ASSEMBLY_CONF);
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:56:
> cannot find symbol
>     [javac] symbol  : method refresh()
>     [javac] location: class
> org.apache.james.container.spring.beanfactory.JamesApplicationContext
>     [javac] result.refresh();
>     [javac] ^
>     [javac]
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:87:
> cannot find symbol
>     [javac] symbol  : variable super
>     [javac] location: class
> org.apache.james.container.spring.beanfactory.JamesApplicationContext
>     [javac] r = super.getResource(fileURL);
>     [javac] ^
>     [javac] Note:
> E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\AvalonWebApplicationContext.java
> uses unchecked or unsafe operations.
>     [javac] Note: Recompile with -Xlint:unchecked for details.
>     [javac] 7 errors
>
> BUILD FAILED
> E:\Job\spring-deployment\build.xml:266: Compile failed; see the compiler
> error output for details.
>
> Total time: 12 seconds
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Embedding-James-in-a-Java-application-tp17638835p20403953.html
> Sent from the James - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


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


Re: Embedding James in a Java application

Posted by xin <xc...@allette.com.au>.
Hi all,

I am trying to do the same thing - embedded James into our Java Application
for sending emails only purpose. I am following this thread and check out
the spring-deployment and build-tool project, then try to build it with ant
(in Eclipse). I got the following errors. Could you please help? If you need
more information, please let me know. Appreciated!

Many thanks,
tim

Buildfile: E:\Job\spring-deployment\build.xml
compile:
    [javac] Compiling 4 source files to
E:\Job\spring-deployment\build\classes
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\adaptor\FileSystemBridge.java:21:
package org.apache.james.services does not exist
    [javac] import org.apache.james.services.FileSystem;
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\adaptor\FileSystemBridge.java:30:
cannot find symbol
    [javac] symbol: class FileSystem
    [javac] public class FileSystemBridge implements FileSystem,
ResourceLoaderAware {
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:32:
cannot find symbol
    [javac] symbol: class AvalonApplicationContext
    [javac] public class JamesApplicationContext extends
AvalonApplicationContext {
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\AvalonWebApplicationContext.java:44:
cannot find symbol
    [javac] symbol  : variable AvalonApplicationContext
    [javac] location: class
org.apache.james.container.spring.beanfactory.AvalonWebApplicationContext
    [javac]
AvalonApplicationContext.loadAvalonBasedBeanDefinitions(defaultListableBeanFactory,
springBeanResource, jamesAssemblyResource);
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:45:
cannot find symbol
    [javac] symbol  : variable SPRING_BEANS_CONF
    [javac] location: class
org.apache.james.container.spring.beanfactory.JamesApplicationContext
    [javac] return newJamesApplicationContext(SPRING_BEANS_CONF,
JAMES_ASSEMBLY_CONF);
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:56:
cannot find symbol
    [javac] symbol  : method refresh()
    [javac] location: class
org.apache.james.container.spring.beanfactory.JamesApplicationContext
    [javac] result.refresh();
    [javac] ^
    [javac]
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\JamesApplicationContext.java:87:
cannot find symbol
    [javac] symbol  : variable super
    [javac] location: class
org.apache.james.container.spring.beanfactory.JamesApplicationContext
    [javac] r = super.getResource(fileURL);
    [javac] ^
    [javac] Note:
E:\Job\spring-deployment\src\main\java\org\apache\james\container\spring\beanfactory\AvalonWebApplicationContext.java
uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 7 errors

BUILD FAILED
E:\Job\spring-deployment\build.xml:266: Compile failed; see the compiler
error output for details.

Total time: 12 seconds



-- 
View this message in context: http://www.nabble.com/Embedding-James-in-a-Java-application-tp17638835p20403953.html
Sent from the James - Users mailing list archive at Nabble.com.


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


Re: Embedding James in a Java application

Posted by Stefano Bagnara <ap...@bago.org>.
Bernd Fondermann ha scritto:
> On Thu, Jun 5, 2008 at 10:05 AM, Stefano Bagnara <ap...@bago.org> wrote:
>> nodje ha scritto:
>>> hey thanks
>>>
>>> I haven't open the documentation yet but thanks to Maven I  have been able
>>> to compile the whole stuff.
>>> spring-integration wouldn't compile on it's own though. Some missing
>>> dependencies - or repository issue.
>> I committed fix to poms yesterday, please try again with the latest version.
> 
> We are going long ways to maintain two build tools. I'd suggest we
> better point our users to the ant build and not turn people away early
> because they try to use maven and fail.
> 
>   Bernd

If you look at the thread I already suggested him to use ANT but he 
decided to use maven anyway. So I preferred to take the opportunity to 
fix the maven build (we needed this action anyway for our website build).

In my answer I never used the maven word and here is a quote from what I 
suggested him:
 > If you checkout the whole sources for trunk and run "ant" on the root
 > it will build also the spring-deployment packages.

Stefano


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


Re: Embedding James in a Java application

Posted by Bernd Fondermann <be...@googlemail.com>.
On Thu, Jun 5, 2008 at 10:05 AM, Stefano Bagnara <ap...@bago.org> wrote:
> nodje ha scritto:
>>
>> hey thanks
>>
>> I haven't open the documentation yet but thanks to Maven I  have been able
>> to compile the whole stuff.
>> spring-integration wouldn't compile on it's own though. Some missing
>> dependencies - or repository issue.
>
> I committed fix to poms yesterday, please try again with the latest version.

We are going long ways to maintain two build tools. I'd suggest we
better point our users to the ant build and not turn people away early
because they try to use maven and fail.

  Bernd

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


Re: Embedding James in a Java application

Posted by Stefano Bagnara <ap...@bago.org>.
nodje ha scritto:
> hey thanks
> 
> I haven't open the documentation yet but thanks to Maven I  have been able
> to compile the whole stuff.
> spring-integration wouldn't compile on it's own though. Some missing
> dependencies - or repository issue.

I committed fix to poms yesterday, please try again with the latest version.

> So I had to 'mvn package' on the trunk.
> One test fails, over 732:
> org.apache.james.experimental.imapserver.ExperimentalSelectedInboxTest
> Seems to be linked to an experimental IMAP server. Not needed for me anyway.

This fails to me too under maven, but it pass under ant, I never had 
enough cycles to check why.
I use -Dmaven.test.failure.ignore=true now when I have to run mvn.

> I'll package without the test and try to use it (that's probably where I'll
> have to open the documentation!)

Unfortunately I have to say you that maven poms are there mainly to 
build our website and our build tool is still ant. In practice the 
deployment modules do not really create usable packages because I never 
took care of doing this (no assembly descriptor). I just took care that 
maven was compiling all the classes, creating every jar and running 
tests. So I suggest you to build the deployment module with ant, so you 
will find a more complete resulting package for spring-deployment and 
not only a simple jar.

> I'm wondering how to integrate James librairies within our own repository
> and how to make it part of our build process for the time being (I mean
> until a stable 3.0 is released).

If you need stable releases you will have to mark your own. JAMES 
snapshots are not published in maven repositories, so you will have to 
install them (mvn:install) in your local repository and use it as a 
dependency.

> I should probably add a <distributionManagement> section to the pom and
> deploy the artifacts to our local repository.
> 
> I'll hopefully post my tryout results soon.

I suggest you to try first the ant generated package so you understand 
how to use it. Once you understand how to use the spring based 
deployment you probably can move to depend only on the maven generated 
jars via direct maven dependencies: if not I would be glad to help and 
fix what is wrong in our poms.

Stefano


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


Re: Embedding James in a Java application

Posted by nodje <no...@gmail.com>.
hey thanks

I haven't open the documentation yet but thanks to Maven I  have been able
to compile the whole stuff.
spring-integration wouldn't compile on it's own though. Some missing
dependencies - or repository issue.
So I had to 'mvn package' on the trunk.
One test fails, over 732:
org.apache.james.experimental.imapserver.ExperimentalSelectedInboxTest
Seems to be linked to an experimental IMAP server. Not needed for me anyway.

I'll package without the test and try to use it (that's probably where I'll
have to open the documentation!)

I'm wondering how to integrate James librairies within our own repository
and how to make it part of our build process for the time being (I mean
until a stable 3.0 is released).

I should probably add a <distributionManagement> section to the pom and
deploy the artifacts to our local repository.

I'll hopefully post my tryout results soon.

-nodje


Stefano Bagnara-2 wrote:
> 
> nodje ha scritto:
>> Hi,
>> 
>> I'm trying to find a way to embed an SMTP server in our Java application.
>> It's ALWAYS a problem to get access to an SMTP server where we install
>> our
>> Java applications.
>> 
>> If we could get James to run within a Spring context, it'd be absolutly
>> brilliant.
>> (found this mentioned in
>> http://www.nabble.com/Embedding-James-to9169298.html#a9169298)
>> 
>> What is the status of this now? Can anyone tell me if there are other
>> links
>> to look at? 
>> Or is this
>> http://svn.apache.org/repos/asf/james/server/sandbox/spring-integration/
>> still the reference?
>> 
>> -nodje
> 
> spring-deployment has been integrated in trunk:
> http://svn.apache.org/repos/asf/james/server/trunk/
> http://svn.apache.org/repos/asf/james/server/trunk/spring-deployment/
> 
> Unfortunately the HOW-TO.txt has not been updated yet (since the code 
> has been moved from sandbox to trunk), but it should be even simpler 
> now. If you give it a try and you're successfull you could help us fix 
> the documentation issues! Otherwise if you find problems you can ask.
> 
> If you checkout the whole sources for trunk and run "ant" on the root it 
> will build also the spring-deployment packages.
> 
> If you don't want to compile it yourself, you can try one of our nighly 
> builds: http://people.apache.org/builds/james/nightly/bin/
> You can find there a  james-server-spring-deployment-3.0-SNAPSHOT.zip
> 
> I just fixed a java1.4 compatibility issue in that deployment, so if you 
> need java 1.4 compatibility you will have to wait tomorrow's build.
> 
> Stefano
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Embedding-James-in-a-Java-application-tp17638835p17660945.html
Sent from the James - Users mailing list archive at Nabble.com.


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


Re: Embedding James in a Java application

Posted by Stefano Bagnara <ap...@bago.org>.
nodje ha scritto:
> Hi,
> 
> I'm trying to find a way to embed an SMTP server in our Java application.
> It's ALWAYS a problem to get access to an SMTP server where we install our
> Java applications.
> 
> If we could get James to run within a Spring context, it'd be absolutly
> brilliant.
> (found this mentioned in
> http://www.nabble.com/Embedding-James-to9169298.html#a9169298)
> 
> What is the status of this now? Can anyone tell me if there are other links
> to look at? 
> Or is this
> http://svn.apache.org/repos/asf/james/server/sandbox/spring-integration/
> still the reference?
> 
> -nodje

spring-deployment has been integrated in trunk:
http://svn.apache.org/repos/asf/james/server/trunk/
http://svn.apache.org/repos/asf/james/server/trunk/spring-deployment/

Unfortunately the HOW-TO.txt has not been updated yet (since the code 
has been moved from sandbox to trunk), but it should be even simpler 
now. If you give it a try and you're successfull you could help us fix 
the documentation issues! Otherwise if you find problems you can ask.

If you checkout the whole sources for trunk and run "ant" on the root it 
will build also the spring-deployment packages.

If you don't want to compile it yourself, you can try one of our nighly 
builds: http://people.apache.org/builds/james/nightly/bin/
You can find there a  james-server-spring-deployment-3.0-SNAPSHOT.zip

I just fixed a java1.4 compatibility issue in that deployment, so if you 
need java 1.4 compatibility you will have to wait tomorrow's build.

Stefano



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