This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Model files generated by xjc contain localized generating timestamps, like a Chinese word indicating AM/PM is used on a Chinese environment. // Generated on: 2010.03.27 at 09:18:24 上午 CST Encodings of the generated files will be the default system locale, and It's known that the default locale is localized-specified on Windows, so the characters above are GB2312/GBK (cp936) characters but UTF-8. If you compiles the files in UTF-8, you might get an error complaining about the unmappable character encountered. It will stop a build on a cp936 Windows system, and actually it causes me failed to build the websvc.saas.api module. compile target in websvc.saas.api simply calls a global compile target in nbbuild/templates/common.xml. This compile target prefers UTF-8 in general <target name="compile" depends="init,up-to-date" unless="is.jar.uptodate"> <mkdir dir="${build.classes.dir}"/> ... <nb-javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${build.compiler.debug}" debuglevel="${build.compiler.debuglevel}" encoding="UTF-8" deprecation="${build.compiler.deprecation}" optimize="${build.compiler.optimize}" source="${javac.source}" target="${javac.target}" includeantruntime="false"> <classpath refid="cp"/> <compilerarg line="${javac.compilerargs}"/> <processorpath refid="processor.cp"/> </nb-javac> ... </target> which will cause the compile error. This problem can be solved in two ways - to change the generated file's encoding to UTF-8, or simply compile the file in the default encoding but UTF-8. Since xjc doesn't provide a way to modify the encoding (I searched online and got nothing about this), I think it is better and much simplier to define a target to compile files in default encoding. I will be working on this issue if this solution has been approved.
I added a macrodef javac-compile to handle all java file compling invocations in template/common.xml. The current compile and compile-single target is changed to call the javac-compile macro to perform a compile task in UTF-8 encoding. Then two new target compile-file-encoding and compile-single-file-encoding added to perform the same thing except that in the system encoding (${file.encoding}). In websvc.saas.api module, the compile target depends on compile-file-encoding instead of compile target.
Created attachment 96241 [details] Patch for nbbuild ant script (resolving build error on cp936 windows)
Do not use nbbuild for product bugs.
Martin, is there any way to specify encoding of generated classes for xjc?
Hi, JAXB does not have an encoding attribute for xjc specifically. Feel free to file RFE for JAXB at jaxb.dev.java.net.
I've reported JAXB bug: https://jaxb.dev.java.net/issues/show_bug.cgi?id=747 As far as websvc.saas.api module, I doubt we can do anything unless xjc supports the encoding.
As already discussed xjc is external utility and xjc is the source of the issue.
Created attachment 121666 [details] Fix for build script
The bug is fixed in JAXB: the xjc task now supports the encoding attribute. I modified the build script to use the encoding attribute.
*** Bug 216899 has been marked as a duplicate of this bug. ***
(In reply to comment #9) > I modified the build script to use the encoding attribute. @ramis: Is it already committed? If done, please set the target version and this issue to resolved.
web-main#b73c2b941746
*** Bug 214830 has been marked as a duplicate of this bug. ***
Integrated into 'main-golden', will be available in build *201209040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b73c2b941746 User: Denis Anisimov <ads@netbeans.org> Log: Fix for BZ#182984 - Model files generated by xjc stop a build on cp936 locale Windows
We still have problem with NetBeans 7.3 Beta 2 : Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211062253) Java: 1.7.0_09; Java HotSpot(TM) Client VM 23.5-b02 Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05 System: Windows 7 version 6.1 running on x86; Cp1252; fr_FR (nb) User directory: C:\Work-SVN\HEAD3\JAVA\netbeans Cache directory: C:\Work-SVN\HEAD3\JAVA\netbeans\var\cache Here the output trace : wsimport-client-generate: Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\empty Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\ap-source-output Compiling 199 source files to C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:15: error: unmappable character for encoding UTF-8 * <p>Le fragment de sch?ma suivant indique le contenu attendu figurant dans cette classe. C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: error: unmappable character for encoding UTF-8 * Obtient la valeur de la propri?t? id. C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: error: unmappable character for encoding UTF-8
(In reply to comment #15) > We still have problem with NetBeans 7.3 Beta 2 : > > Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211062253) > Java: 1.7.0_09; Java HotSpot(TM) Client VM 23.5-b02 > Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05 > System: Windows 7 version 6.1 running on x86; Cp1252; fr_FR (nb) > User directory: C:\Work-SVN\HEAD3\JAVA\netbeans > Cache directory: C:\Work-SVN\HEAD3\JAVA\netbeans\var\cache > > Here the output trace : > wsimport-client-generate: > Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes > Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\empty > Created dir: > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\ap-source-output > Compiling 199 source files to > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:15: > error: unmappable character for encoding UTF-8 > * <p>Le fragment de sch?ma suivant indique le contenu attendu figurant dans > cette classe. > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: > error: unmappable character for encoding UTF-8 > * Obtient la valeur de la propri?t? id. > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: > error: unmappable character for encoding UTF-8 What kind of problem do you have exactly ? The original issue is about NB build procedure. Exact module with the issue is websvc.saas.api. I don't see from your description how it relates to NB build procedure.
(In reply to comment #16) > (In reply to comment #15) > > We still have problem with NetBeans 7.3 Beta 2 : > > > > Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211062253) > > Java: 1.7.0_09; Java HotSpot(TM) Client VM 23.5-b02 > > Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05 > > System: Windows 7 version 6.1 running on x86; Cp1252; fr_FR (nb) > > User directory: C:\Work-SVN\HEAD3\JAVA\netbeans > > Cache directory: C:\Work-SVN\HEAD3\JAVA\netbeans\var\cache > > > > Here the output trace : > > wsimport-client-generate: > > Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes > > Created dir: C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\empty > > Created dir: > > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\ap-source-output > > Compiling 199 source files to > > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\classes > > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:15: > > error: unmappable character for encoding UTF-8 > > * <p>Le fragment de sch?ma suivant indique le contenu attendu figurant dans > > cette classe. > > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: > > error: unmappable character for encoding UTF-8 > > * Obtient la valeur de la propri?t? id. > > C:\Checkout-SVN\HEAD3\java\RCSDMTestWebServices\build\generated-sources\jax-ws\com\cadwin\service\rcsdm\Accessory.java:78: > > error: unmappable character for encoding UTF-8 > > What kind of problem do you have exactly ? > The original issue is about NB build procedure. Exact module with the issue is > websvc.saas.api. > I don't see from your description how it relates to NB build procedure. We have the same problem as origin, nb build crash because of "unmappable character for encoding UTF-8" when build execute "wsimport-client-generate" task
(In reply to comment #17) > > We have the same problem as origin, nb build crash because of "unmappable > character for encoding UTF-8" when build execute "wsimport-client-generate" > task What sources do you use ? The bug is fixed in the 7.3 dev version. Have you checked the issue with recent state of the source/build procedure ?
(In reply to comment #18) > (In reply to comment #17) > > > > > We have the same problem as origin, nb build crash because of "unmappable > > character for encoding UTF-8" when build execute "wsimport-client-generate" > > task > > What sources do you use ? > The bug is fixed in the 7.3 dev version. > Have you checked the issue with recent state of the source/build procedure ? As we said we use NetBeans IDE 7.3 Beta 2 (Build 201211062253), that we download from http://download.netbeans.org/netbeans/7.3/beta2/ it is the dev version you are speaking about?
(In reply to comment #19) > > As we said we use NetBeans IDE 7.3 Beta 2 (Build 201211062253), that we > download from http://download.netbeans.org/netbeans/7.3/beta2/ it is the dev > version you are speaking about? I don't understand how do you use binary NB 7.3 beta but are speaking about nb build crash ? How do you get an issue ? What is your usecase ? What is the steps ti reproduce ? It seems you mixes two different issues.
(In reply to comment #20) > (In reply to comment #19) > > > > As we said we use NetBeans IDE 7.3 Beta 2 (Build 201211062253), that we > > download from http://download.netbeans.org/netbeans/7.3/beta2/ it is the dev > > version you are speaking about? > > I don't understand how do you use binary NB 7.3 beta but are speaking about > nb build crash ? > > How do you get an issue ? What is your usecase ? What is the steps ti reproduce > ? > It seems you mixes two different issues. We installed 'NetBeans IDE 7.3 Beta 2 (Build 201211062253)' to check if the error that we have with Netbeans IDE 7.2.1 is corrected. So the error, when we build Java project (swing or fx), who use webservices when ant task named 'wsimport-client-generate' is played(generation of java sources classes from wsdl file) we have this error : 'error: unmappable character for encoding UTF-8'.
(In reply to comment #21) > > We installed 'NetBeans IDE 7.3 Beta 2 (Build 201211062253)' to check if the > error that we have with Netbeans IDE 7.2.1 is corrected. > > So the error, when we build Java project (swing or fx), who use webservices > when ant task named 'wsimport-client-generate' is played(generation of java > sources classes from wsdl file) we have this error : 'error: unmappable > character for encoding UTF-8'. Once again : THIS BUG is about NB build procedure. More precisely NB module "websvc.saas.api" which have had the issue. Your case doesn't relate to NB sources/build procedure. It is about user project. Please read carefully issue before comment/update/reopen. You issue is duplicate of issue #216526, which is also fixed in the 7.3 dev branch but 7.3 beta doesn't contain the fix I suppose.
ok thanks, sorry for the mistake.