You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <vg...@hns.com> on 2001/04/23 17:55:07 UTC
[C2] Failed to build
Hi,
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\SendmailActio
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?
PS I tried to compile with WebLogic 6 in classpath.
Vadim
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [C2] Failed to build
Posted by Vadim Gritsenko <vg...@hns.com>.
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
>
>
Re: [C2] Failed to build
Posted by Donald Ball <ba...@webslingerZ.com>.
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\SendmailActio
> 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