JWebmail compiled error in build.xml.

Discussion in 'Java' started by sam, Jun 21, 2004.

  1. sam

    sam Guest

    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]#
     
    sam, Jun 21, 2004
    #1
    1. Advertising

  2. sam

    Roedy Green Guest

    On Tue, 22 Jun 2004 03:31:26 +0800, sam <>
    wrote or quoted :

    >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


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 21, 2004
    #2
    1. Advertising

  3. sam

    Roedy Green Guest

    On Tue, 22 Jun 2004 03:31:26 +0800, sam <>
    wrote or quoted :

    >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
    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 22, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vagif Abilov
    Replies:
    2
    Views:
    601
    Vagif Abilov
    Jul 7, 2004
  2. Klaus Schneider
    Replies:
    1
    Views:
    584
    Rolf Magnus
    Dec 2, 2004
  3. Pedro Mir
    Replies:
    2
    Views:
    463
    Winista
    Jun 20, 2006
  4. Nicolas Lehuen
    Replies:
    3
    Views:
    751
    Nicolas Lehuen
    Jan 28, 2004
  5. lander
    Replies:
    5
    Views:
    627
    bruce barker
    Mar 5, 2008
Loading...

Share This Page