JWebmail compiled error in build.xml.

S

sam

Hi,

Does anyone know how to fix the following error? I try to install
JWebmail in FreeBSD 5.2 Current.

Thanks
sam

Please see attached message below:
........
compile:
[javac] Compiling 87 source files to
/usr/local/jwebmail-0.7/build/classes
[javac] Note: sun.tools.javac.Main has been deprecated.
[javac]
/usr/local/jwebmail-0.7/build/src/net/wastl/webmail/xml/XMLCommon.java:61:
Ambiguous class: java.lang.CharacterData and org.w3c.dom.CharacterData
[javac] if(nl.item(i) instanceof CharacterData) {
[javac] ^
[javac]
/usr/local/jwebmail-0.7/build/src/net/wastl/webmail/xml/XMLCommon.java:85:
Ambiguous class: java.lang.CharacterData and org.w3c.dom.CharacterData
[javac] if(nl.item(i) instanceof CharacterData) {
[javac] ^
[javac]
/usr/local/jwebmail-0.7/build/src/net/wastl/webmail/server/WebMailSession.java:979:
Note: The method java.lang.String encode(java.lang.String) in class
java.net.URLEncoder has been deprecated.
[javac] xml_part.setAttribute("hrefFileName",
URLEncoder.encode(new String(name.getBytes("UTF-8"), "ISO8859_1")));
[javac] ^
[javac]
/usr/local/jwebmail-0.7/build/src/net/wastl/webmail/server/http/HTTPRequestHeader.java:44:
Note: The method java.lang.String decode(java.lang.String) in class
java.net.URLDecoder has been deprecated.
[javac] setHeader("PATH",URLDecoder.decode(s));
[javac] ^
[javac] Note: 2 files use or override a deprecated API. Please
consult the documentation for a better alternative in each case.
[javac] 2 errors, 2 warnings

BUILD FAILED

/usr/local/jwebmail-0.7/build.xml:191: Compile failed, messages should
have been provided.

Total time: 2 minutes 2 seconds
root@fbsd [3:03am] [...local/jwebmail-0.7]#
 
R

Roedy Green

Ambiguous class: java.lang.CharacterData and org.w3c.dom.CharacterData
[javac] if(nl.item(i) instanceof CharacterData) {

Which class did you mean? Since the goofs reused the class name, you
must spell it out longhand:

instanceof org.w3c.dom.CharaterData
or
instanceof java.lang.CharacterData
 
R

Roedy Green

URLEncoder.encode(new String(name.getBytes("UTF-8"), "ISO8859_1")));

URLEncoder is for Strings with few awkward chars. To send arbitrary
bytes you need something a bit more heavy duty. See
http://mindprod.com/jgloss/armouring.html

Further, URLEncoder should always be used with UTF-8. You have tried
to use it with ISO8859_1.

if name is a String, what you should have written is:

String send = URLEncoder.encode( name, "UTF-8" );

if name is a byte array, you should have written:

String send = URLEncoder.encode( new String( name, "UTF-8" ),
"UTF-8");


if name is something else that can be converted to byte array you
should have written.


String send = URLEncoder.encode( new String( name.toBytes(), "UTF-8"
), "UTF-8");

But this is not what URLEncoder is for. Try the Base64u or the
Wrapper, both described at http://mindprod.com/jgloss/armouring.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,184
Latest member
ZNOChrista

Latest Threads

Top