Bug 83712

Summary: Project with non-ASCII pathname cannot be built on JDK 6
Product: projects Reporter: Jiri Prox <jiriprox>
Component: AntAssignee: Jesse Glick <jglick>
Status: VERIFIED WONTFIX QA Contact: issues <issues.netbeans.org>
Priority: P2 CC: kfrank, prehak
Version: 5.xKeywords: I18N, JDK_SPECIFIC, RELNOTE
Target Milestone: 6.x   
Hardware: All   
OS: All   
URL: http://wiki.netbeans.org/wiki/view/FaqAntLocale
Whiteboard:
Issue Type: DEFECT Exception Report:

Description Jiri Prox 2006-08-29 16:51:33 UTC
NB 5.5 200608260000
JDK 1.6.0 b91
locales ja_JP
pseudolocalized build
tested on Linux FC2 and WinXP

Project containing multibyte character cannot be compiled. The result window
show only message:
/home/jp159440/と粮Jot粮JavaApplication5粤ろ/build.xml:7: Cannot find
nbproject/build-impl.xml imported from
/home/jp159440/と粮Jot粮JavaApplication5粤ろ/build.xml

Running ant from commandline is ok, and the project get compiled without any errors.

This is somehow connected to JDK version, since with jdk1.60 b81 all works fine.
Comment 1 Tomas Zezula 2006-08-29 18:14:24 UTC
Not in the j2se project. The ant does not find the build-impl.xml at all.
Can you attach ant -debug output? Can you try to build it from command line?
Comment 2 Tomas Zezula 2006-08-29 18:15:01 UTC
It seems either java or ant issue.
Comment 3 Jesse Glick 2006-08-29 20:34:11 UTC
Reproducible for me on Linux FC5 w/ UTF-8 system locale and Czech national chars
in project name/path and main class name using JDK 6 b97 and a plain English dev
build.

Setting ro project property: ant.file.řehoř ->
/home/jglick/NetBeansProjects/řehoř/build.xml
Project base dir set to: /home/jglick/NetBeansProjects/řehoř
 +Target: 
Importing file nbproject/build-impl.xml from
/home/jglick/NetBeansProjects/řehoř/build.xml
/home/jglick/NetBeansProjects/řehoř/build.xml:7: Cannot find
nbproject/build-impl.xml imported from
/home/jglick/NetBeansProjects/řehoř/build.xml
        at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:128)
[....]
Comment 4 Jesse Glick 2006-08-29 20:52:37 UTC
Does not occur if you configure a separate Ant install dir in Ant Settings. Only
if you are using the default bundled Ant.
Comment 5 Jesse Glick 2006-08-29 20:53:26 UTC
Not reproducible on JDK 5.

Not a project system bug.
Comment 6 Jesse Glick 2006-08-29 21:57:32 UTC
Correction: doesn't matter whether you are using the bundled Ant vs. external.
But if your external Ant includes xercesImpl.jar then the bug will not appear.
The bug *is* specific to Ant 1.6.5 (or earlier); it does not appear with Ant
1.7.0 (currently in beta). From looking through a debugger, it seems the issue
is that

1. Newer implementations of SAX apparently escape non-ASCII characters in
org.xml.sax.Locator.getSystemId(), which I think is correct. This escaping is
done in the usual way: %xx encoding of bytes of the UTF-8 representation.

2. org.apache.tools.ant.launch.Locator.decodeUri is broken in Ant 1.6.5; it uses
ISO-8859-1 encoding for unescaped URIs, which is wrong.

In fact the bug is reproducible from the command line if you run Ant 1.6.5 with
lib/xercesImpl.jar deleted under JDK 6.

Ant 1.7.0 corrects Locator.decodeUri to use UTF-8 after unescaping:

http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/launch/Locator.java?r1=278497&r2=349552

So suggested release notes entry:

---%<---
If you are running the IDE on JDK 1.6 (regardless of what Java version you use
to build your projects), and the file path to your project contains national
characters (not in the ASCII character set), you may encounter an error when
building or running your project:

<<some garbage>>/build.xml:7: Cannot find
nbproject/build-impl.xml imported from
<<some garbage>>/build.xml

This is a bug in Ant 1.6.5 triggered by newer XML parsers. If this occurs, you
may use any of the following workarounds:

1. Place your project in a folder which does not use such characters. (Rename
Project in the project's context menu.)

2. Run the IDE under JDK 5.

3. Download Ant 1.7.0. In Tools | Options | Miscellaneous | Ant, switch Ant Home
to be this Ant installation.

4. In Tools | Options | Miscellaneous | Ant, click Manage Classpath. Click Add
JAR/ZIP. Select the file xerces-<<version>>.jar from the directory
ide<<number>>/modules/ext in your NetBeans installation.
---%<---

Thanks for catching this.
Comment 7 Jesse Glick 2006-11-09 17:12:15 UTC
*** Issue 88913 has been marked as a duplicate of this issue. ***
Comment 8 Jiri Prox 2006-12-01 17:03:27 UTC
v.
Comment 9 Ken Frank 2007-01-04 15:52:51 UTC
I don't see the workaround mentioned below in nb55 rel notes.

What is the best way to get this info to netbeans.org so its seen
by most people ?  I can pursue that.

I did the 2 workarounds about ant using 1.7 or adding xerces to its cp
and it works.

BTW will ant 1.7 be in nb6 ?  I hope so since don't think users
should be required to do these workarounds just because they
want to use national characters.

ken.frank@sun,com


ken.frank@sun.com
Comment 10 Jesse Glick 2007-01-05 23:44:32 UTC
I have no control over the contents of the release notes for 5.5 other than
adding the RELNOTE keyword.

NB 6 dev builds already bundle Ant 1.7.0.
Comment 11 Max Sauer 2007-04-18 11:23:09 UTC
*** Issue 100503 has been marked as a duplicate of this issue. ***
Comment 12 Jesse Glick 2007-07-31 19:14:36 UTC
*** Issue 111468 has been marked as a duplicate of this issue. ***
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo