JAXB and unmappable character for encoding UTF-8

Using locale specific characters in schema or wsdl (i.e. for documentation purpose) is still quite problematic. Especially if you are using JAXB to generate wsdl2java java classes. Because JAXB uses default system encoding and classes are usually compiled in UTF-8 special chars in java comments resolves in compilations error:

/url/to/file/SomeFile.java:[11,12] unmappable character for encoding UTF-8 A workaround to this problem is to isolate wsdl2java code generation in a dedicated maven module and to configure the compiler plugin to use OS dependant encoding:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <encoding>${file.encoding}</encoding>
        </configuration>
</plugin>

More info related to this topic:

here

You May Also Like

Turing completeness II

Well, as I wrote in the previous post, sed is a Turing complete language. We can use it to implement some simple algorithms, or even a dc interpreter. But what does it really mean? How complex tasks may we achieve using plain sed?What about writin...Well, as I wrote in the previous post, sed is a Turing complete language. We can use it to implement some simple algorithms, or even a dc interpreter. But what does it really mean? How complex tasks may we achieve using plain sed?What about writin...

Touki na Confiturze 2013 – ciąg dalszy

Kolejna partia nagrań z konferencji została udostępniona. Wśród nich m.in. prezentacja Michała Trzaskowskiego o rozpoznawaniu oczekiwań klienta podczas prowadzenia projektu z wykorzystaniem ”zwinnych” metodyk projektowych oraz wystąpienie Macieja Próchniaka o możliwościach Slick, jednej z bibliotek w Scali.