CXF
  1. CXF
  2. CXF-4739

build failure: error: unmappable character for encoding UTF-8

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: 2.7.2
    • Fix Version/s: None
    • Component/s: Build system
    • Labels:
      None
    • Environment:
    • Estimated Complexity:
      Unknown

      Description

      I couldn't build generated sources.

      \api\target\generated\src\main\java\org\apache\cxf\configuration\security\ObjectFactory.java:[5,40] error: unmappable character for encoding UTF-8

      Each generated sources has something like

      //
      // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-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: 2013.01.09 at 01:19:13 오후 KST
      //

      Which contains some Korean characters.

      $ file target/generated/src/main/java/org/apache/cxf/configuration/security/ObjectFactory.java
      target/generated/src/main/java/org/apache/cxf/configuration/security/ObjectFactory.java: HTML document, ISO-8859 text, with CRLF line terminators

        Activity

        Hide
        Freeman Fang added a comment - - edited

        Hi,

        If your default encoding isn't UTF8, you can specify system property file.encoding as UTF8. Something like
        "mvn clean install -Dfile.encoding=UTF8" to let maven to pick up your encoding. You can also configure it in MAVEN_OPTS like MAVEN_OPTS=-Dfile.encoding=UTF8

        Freeman

        Show
        Freeman Fang added a comment - - edited Hi, If your default encoding isn't UTF8, you can specify system property file.encoding as UTF8. Something like "mvn clean install -Dfile.encoding=UTF8" to let maven to pick up your encoding. You can also configure it in MAVEN_OPTS like MAVEN_OPTS=-Dfile.encoding=UTF8 Freeman
        Hide
        Jin Kwon added a comment - - edited

        Thanks for the tip.

        I succeeded with -Dfile.encoding=iso8859 flag.
        I also succeeded with -Dfile.encoding=cp-949 flag.

        I'm just curious.
        My OS is Windows(Korean) which has MS949(CP949) and files are generated with ISO 8859-1(or native MS949) encoded.
        I don't know where this problem came from. Is it CXF's pom problem? or WSDL/JAXB-scoped problem?

        I've never relied on the 'file.encoding' for any maven project which contains multiple languages in it.

        Regards.

        Show
        Jin Kwon added a comment - - edited Thanks for the tip. I succeeded with -Dfile.encoding=iso8859 flag. I also succeeded with -Dfile.encoding=cp-949 flag. I'm just curious. My OS is Windows(Korean) which has MS949(CP949) and files are generated with ISO 8859-1(or native MS949) encoded. I don't know where this problem came from. Is it CXF's pom problem? or WSDL/JAXB-scoped problem? I've never relied on the 'file.encoding' for any maven project which contains multiple languages in it. Regards.
        Hide
        Freeman Fang added a comment -

        Hi,

        As far as I can tell, it's a jaxb-scope problem under the hood.

        Freeman

        Show
        Freeman Fang added a comment - Hi, As far as I can tell, it's a jaxb-scope problem under the hood. Freeman
        Hide
        Willem Jiang added a comment -

        current CXF is setting to use UTF-8 to read the source file, if you don't specify the -Dfile.encoding, it will use the UTF-8 by default.
        As the ObjectFactory.java is encoded with MS949, the compile will complain about it.

        If you can let the JAXB to generate the file which is encoded with UTF-8, it will resolved the issue peacefully.

        Show
        Willem Jiang added a comment - current CXF is setting to use UTF-8 to read the source file, if you don't specify the -Dfile.encoding, it will use the UTF-8 by default. As the ObjectFactory.java is encoded with MS949, the compile will complain about it. If you can let the JAXB to generate the file which is encoded with UTF-8, it will resolved the issue peacefully.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jin Kwon
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development