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.

Bug 270654

Summary: Build fails because of Resources generated with JAXB Binding (unmappable character for encoding UTF-8)
Product: xml Reporter: HarleyDavidson
Component: JAXBAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: XSD File I am using in my project

Description HarleyDavidson 2017-05-16 08:57:38 UTC
Created attachment 164327 [details]
XSD File I am using in my project

There are similar other issues older than 4 years, but the error still exist.

I am using Netbeans 8.0.2 on a german machine, but the language is set on english.

Project Settings:
- Java Project
- Sources
  - JDK7
  - Encoding: UTF-8

Following steps to reproduce:

- Right Click on project >> New >> JAXB Binding
- In this dialog:
  - Select attached xsd File in section "Schema File:"
  - Binding Name "Mandanten"
  - Click on "Finish"

- Rightclick on project "Clean and Build" >> you get this output:

ant -f C:\\Users\\admin\\Documents\\NetBeansProjects\\storopack\\Storopack_EmailLite_Importer -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\built-clean.properties
Deleting directory C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build
clean:
init:
deps-jar:
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build
Updating property file: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\built-jar.properties
xjc-typedef-target:
jaxb-code-generation:
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated\jaxbCache
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated\jaxbCache\Mandanten
Compiling file:/C:/Users/admin/Documents/NetBeansProjects/storopack/Storopack_EmailLite_Importer/xml-resources/jaxb/Mandanten/Mandanten.xsd
Writing output to C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated\jaxbCache\Mandanten
Copying 3 files to C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\classes
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\empty
Created dir: C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\ap-source-output
Compiling 8 source files to C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\classes
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb\generated\Mandant.java:4: error: unmappable character for encoding UTF-8
// ?nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. 
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb\generated\Mandant.java:20: error: unmappable character for encoding UTF-8
 * <p>Java-Klasse f?r anonymous complex type.
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb\generated\Mandanten.java:4: error: unmappable character for encoding UTF-8
// ?nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. 
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb\generated\Mandanten.java:21: error: unmappable character for encoding UTF-8
 * <p>Java-Klasse f?r anonymous complex type.
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\build\generated-sources\jaxb\generated\ObjectFactory.java:4: error: unmappable character for encoding UTF-8
// ?nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. 
5 errors
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\nbproject\build-impl.xml:924: The following error occurred while executing this line:
C:\Users\admin\Documents\NetBeansProjects\storopack\Storopack_EmailLite_Importer\nbproject\build-impl.xml:264: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)

The generated java classes themselves are fully correct. The error is produced by the comment-section at the very top of each generated class:

//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 generiert 
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// ´┐Żnderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. 
// Generiert: 2017.05.16 um 10:44:37 AM CEST 
//

When I generate these classes by command-line ("xjc Mandanten.xsd"), the header looks like this:

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2017.05.16 at 10:54:36 AM CEST 
//

Maybe the solution could be to tell JAXB using english Javadoc-language?


The workaround of 
https://netbeans.org/bugzilla/show_bug.cgi?id=216526#c33
(Comment #33) 
does help, but maybe there should be a general solution, because there a several developers working on this project and not all of them can edit their "netbeans.conf" file.