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 216899 - Build fails at jaxb xjc-model-generation because of generated umlauts in non-UTF-8-environments
Summary: Build fails at jaxb xjc-model-generation because of generated umlauts in non-...
Status: RESOLVED DUPLICATE of bug 182984
Alias: None
Product: webservices
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-15 07:23 UTC by markiewb
Modified: 2012-08-29 19:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2012-08-15 07:23:12 UTC
Error message in console
{code}
   [repeat] D:\workspace\nb72-src\main\websvc.saas.api\src\org\netbeans\modules\websvc\saas\model\wadl\ResourceType.java:4: unmappable character for encoding UTF-8
   [repeat] // ?nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
   [repeat]    ^
   [repeat] D:\workspace\nb72-src\main\websvc.saas.api\src\org\netbeans\modules\websvc\saas\model\wadl\ResourceType.java:32: unmappable character for encoding UTF-8
   [repeat]  * <p>Java-Klasse f?r anonymous complex type.
   [repeat]                    ^
   [repeat] 100 errors
  [nbmerge] Failed to build target: all-websvc.saas.api

BUILD FAILED
D:\workspace\nb72-src\main\nbbuild\build.xml:414: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:409: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:444: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:427: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:409: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:444: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:427: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:409: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\build.xml:456: The following error occurred while executing this line:
D:\workspace\nb72-src\main\nbbuild\templates\common.xml:218: Compile failed; see the compiler error output for details.
{code}

I investigated the build error and it is related to http://java.net/jira/browse/JAXB-701.

You have to add the encoding parameter 'encoding="UTF-8"' to ...\nb72-src\main\websvc.saas.api\build.xml to produce a system-locale independent build. 

So it would look like
<code>
    <target name="model-gen" depends="xjc-init">
    <echo>java.version=${java.version}, ant.version=${ant.version}</echo>
        <xjc schema="${saas.service.xsd}"      
            package="org.netbeans.modules.websvc.saas.model.jaxb"
            target="2.1"
            destdir="src"
            encoding="UTF-8"
            >
            <depends file="${saas-service.xsd}"/>
            <produces dir="${saas.model.jaxb}"/>
        </xjc>
        <xjc schema="src/org/netbeans/modules/websvc/saas/model/wadl20061109.xsd"
            package="org.netbeans.modules.websvc.saas.model.wadl"
            target="2.1"
            destdir="src"
            encoding="UTF-8"
            >
            <depends file="${wadl.xsd}"/>
            <produces dir="${saas.model.wadl}"/>
        </xjc>
        <xjc schema="src/org/netbeans/modules/websvc/saas/model/oauth-metadata.xsd"
            package="org.netbeans.modules.websvc.saas.model.oauth"
            target="2.1"
            destdir="src"
            encoding="UTF-8"
            >
            <depends file="${oauth.xsd}"/>
            <produces dir="${oauth.model}"/>
        </xjc>
    </target>
</code>

Note my system configuration - it is not UTF-8-based.
<code>
Java: 1.6.0_30; Java HotSpot(TM) 64-Bit Server VM 20.5-b03
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
<code>
Comment 1 markiewb 2012-08-15 07:28:26 UTC
Correction because of typo:

From 

You have to add the encoding parameter 'encoding="UTF-8"' to
...\nb72-src\main\websvc.saas.api\build.xml to produce a system-locale
independent build. 

to

You have to add the encoding parameter 'encoding="UTF-8"' to
...\nb72-src\main\websvc.saas.api\build.xml to produce a system-encoding
independent build.
Comment 2 markiewb 2012-08-29 19:11:14 UTC

*** This bug has been marked as a duplicate of bug 182984 ***