cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: [C2] Failed to build
Date Mon, 23 Apr 2001 19:22:55 GMT
Donald,

Here is the diff.

Added smptport parameter, username, password. Username and password is
optional, and if not specified then null authenticator will be used (it
works for me). Otherwise, authenticator will be created.

Please note that username / password can be overriden by action's
parameters. In this case, instead of calling getDefaultInstance, getInstance
method will be used.

Also, I see a potential problem with getDefaultInstance: if someone creates
more then one instance of action (or someone uses JavaMail from any other
place), it will not work: getDefaultInstance may be used only with the same
authenticator, i.e. from one action in our case. May be you want to use
getInstance instead - then pls modify line 90 and 97 of the diff file so
they read:
+      Authenticator authenticator = default_authenticator;
and
+      Session session = Session.getInstance(properties, authenticator);

PS: Donald, I did not tested functionality (do not have a sample), but it
compiles.

Thanks,
Vadim

> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Monday, April 23, 2001 12:43
> To: Cocoon Developers
> Subject: Re: [C2] Failed to build
>
>
> On Mon, 23 Apr 2001, Vadim Gritsenko wrote:
>
> > I have got build error; Cocoon 2 just from CVS:
> > -------------------------------------------------------------
> > compile:
> >      [copy] Copying 12 files to
> C:\Apache\xml-cocoon\build\cocoon\classes
> >     [javac] Compiling 224 source files to
> > C:\Apache\xml-cocoon\build\cocoon\classes
> >     [javac]
> >
> C:\Apache\xml-cocoon\build\cocoon\src\org\apache\cocoon\acting\Sen
> dmailActio
> > n.java:83: Wrong number of arguments in method.
> >     [javac]       Session session =
> Session.getDefaultInstance(properties);
> >     [javac]                                                   ^
> >     [javac] Note: 5 files use or override a deprecated API.
> Recompile with
> > "-deprecation" for details.
> >     [javac] 1 error, 1 warning
> >
> > BUILD FAILED
> > -------------------------------------------------------------
> > The problem is that javax.mail.Session does have this method only from
> > JavaMail version 1.2 (and up), and existing implementations
> (weblogic up to
> > 6.0sp1, j2sdkee1.2) of JavaMail have another method:
> >   public static Session getDefaultInstance(java.util.Properties props,
> > Authenticator authenticator)
> >
> > So, the question is:
> > What everybody uses this class with?
>
> if you compile c2 with an empty classpath, it will ignore the
> SendmailAction class. if you want to compile it, download the mailapi.jar
> from sun and put it in your classpath (or cocoon's lib directory). if you
> want to flip me a patch to add the Authenticator object, that'd be swell.
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>

Mime
View raw message