I recently migrated an application for JBoss AS 5 to Wildfly 8, and as such had to move from Java 6 to Java 8.
I'm now encountering a problem when running one of my unit tests through Ant:
[javac] C:\Users\test\JAXBClassTest.java:123: error: unmappable character for encoding UTF8
Line 123 of the test class is:
Assert.assertEquals("Jµhn", JAXBClass.getValue());
This test is in place specifically to ensure that the JAXB marshaller can handle UTF-8 characters, which I believe µ
is. I have added a property onto the JAXB marshaller to ensure that these characters are allowed:
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
I've seen multiple questions (1, 2, 3) on Stack Overflow which seem to be similar but their answers wither explain why invalid characters which were previously decoded one way are now decoded in another or don't appear to actually have the same issue as me.
If all the characters are valid should this cause an issue? I know I must be missing something but I can't see what.