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

OSGi Blueprint visualization

What is blueprint?Blueprint is a dependency injection framework for OSGi bundles. It could be written by hand or generated using Blueprint Maven Plugin. Blueprint file is only an XML describing beans, services and references. Each OSGi bundle could hav...

GWT Hosted mode on 64bit linux

GWT for linux is build against 32bit architecture. It contains some SWT/GTK 32bit modules. So if you try to run it with 64bit java it failsException in thread "main" java.lang.UnsatisfiedLinkError: /opt/tools/sdk/gwt/gwt-linux-1.5.3/libswt-pi-gtk-3235....