You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Mads Jensen (JIRA)" <ji...@apache.org> on 2009/09/28 10:15:15 UTC

[jira] Created: (CXF-2450) WSDL2java uses system encoding when generating java classes

WSDL2java uses system encoding when generating java classes
-----------------------------------------------------------

                 Key: CXF-2450
                 URL: https://issues.apache.org/jira/browse/CXF-2450
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.1.3
            Reporter: Mads Jensen


When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error

[INFO] Compilation failure

/url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8


We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "nicolas de loof (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768235#action_12768235 ] 

nicolas de loof commented on CXF-2450:
--------------------------------------

This also affect CXF generated classes as they can derive method / parameter names from the WSDL (operation and message), potentialy including some non ASCII characters

The maven convention is to set encoding to ${project.build.sourceEncoding}, most plugins (including compiler) allready follow this best practice



> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "nicolas de loof (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841755#action_12841755 ] 

nicolas de loof commented on CXF-2450:
--------------------------------------

A workaround is to isolate wsdl2java code generation in a dedicated maven module and to configure the compiler plugin to use OS dependant encoding (that is not recommended in other cases) :

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

> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-2450:
-----------------------------

    CXF Fields: [Blocked on External]

> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765078#action_12765078 ] 

Daniel Kulp commented on CXF-2450:
----------------------------------


Nicolas - thanks for the analysis of the JAXB stuff.   dev.java.net is a pain recently.   :-(

Mads and Nicolas: do you know if the stuff that CXF generates (the SEI interface, service object, Exceptions and such) are also affected or is it just the JAXB things?



> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "nicolas de loof (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12764995#action_12764995 ] 

nicolas de loof commented on CXF-2450:
--------------------------------------

This issue is related to JAXB xjc :

com.sun.codemodel.writer.CodeWriter#openSource  uses the OutputStreamWriter encoding to set the CharsetEncoder to use :

{{{
OutputStreamWriter bw = new OutputStreamWriter(openBinary(pkg,fileName));
(...)
CharsetEncoder encoder = EncoderFactory.createEncoder(bw.getEncoding());
}}}

It SHOULD instead build a CharsetEncoder based on the user-requested encoding (may fallback to default platform encoding) and THEN create the OutputStreamWriter with this encoder...

{{{
CharsetEncoder encoder = EncoderFactory.createEncoder( getUserDefinedEncoding() );
OutputStreamWriter bw = new OutputStreamWriter(openBinary(pkg,fileName), encoder);
}}}


I just can't report this suggestion to JAXB as dev.java.net is unreachable for some days :'(

> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "nicolas de loof (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12766905#action_12766905 ] 

nicolas de loof commented on CXF-2450:
--------------------------------------

@see https://jaxb.dev.java.net/issues/show_bug.cgi?id=701

> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2450) WSDL2java uses system encoding when generating java classes

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CXF-2450:
-----------------------------

    Component/s: Tooling

> WSDL2java uses system encoding when generating java classes
> -----------------------------------------------------------
>
>                 Key: CXF-2450
>                 URL: https://issues.apache.org/jira/browse/CXF-2450
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.1.3
>            Reporter: Mads Jensen
>
> When using wsdl2java java classes are created in default encoding(for instance MacRoman). But when we afterwards try to compile these classes in UTF-8 special chars in java comments resolves in compliations error
> [INFO] Compilation failure
> /url/to/file/SomeFile.java:[31,18] unmappable character for encoding UTF-8
> We would like somehow to specify which encoding wsdl2java should use when generating java classes. We can't seem to find this property.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.