You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2021/03/08 17:06:00 UTC

[jira] [Assigned] (CXF-8420) cxf-codegen-plugin failing with StringIndexOutOfBoundsException

     [ https://issues.apache.org/jira/browse/CXF-8420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Yue Fang reassigned CXF-8420:
-------------------------------------

    Assignee: Freeman Yue Fang

> cxf-codegen-plugin failing with StringIndexOutOfBoundsException
> ---------------------------------------------------------------
>
>                 Key: CXF-8420
>                 URL: https://issues.apache.org/jira/browse/CXF-8420
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 3.4.0, 3.4.1, 3.4.2
>         Environment: OS: Windows 10
> maven: 3.5.3
> Java: 
> openjdk version "11.0.8" 2020-07-14
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
> OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
> java version "1.8.0_271"
> Java(TM) SE Runtime Environment (build 1.8.0_271-b25)
> Java HotSpot(TM) 64-Bit Server VM (build 25.271-b25, mixed mode)
>            Reporter: George McCone
>            Assignee: Freeman Yue Fang
>            Priority: Major
>         Attachments: TestNoImportXSD.wsdl
>
>
> When trying to run the cxf-codegen-plugin on a simple wsdl, the build fails with a StringIndexOutOfBoundsException: String index out of range: 56
>  
> If I manually run wsdl2java from the command line using Java 1.8  it seems to complete without error.
> If I use the version 3.3.9 of cxf-codegen-pluign it works, looks like it was broken in 3.4.0 and still broken in 3.4.1 and 3.4.2.
> Maven Snippet
>  
> {code:java}
> <plugin>
>  <groupId>org.apache.cxf</groupId>
>  <artifactId>cxf-codegen-plugin</artifactId>
>  <version>3.4.2</version>
>  <executions>
>   <execution>
>     <id>generate-sources-test</id>
>     <phase>generate-sources</phase>
>     <configuration>
>       <wsdlOptions>
>          <wsdlOption>
>            <wsdl>${basedir}/src/main/resources/TestNoImportXSD.wsdl</wsdl>                         </wsdlOption>
>       </wsdlOptions>
>     </configuration>
>     <goals>
>       <goal>wsdl2java</goal>
>     </goals>
>   </execution>
>  </executions>
> </plugin>
> {code}
> Errors for both AdoptOpenJDK 11.0.8 and Oracle 1.8.0_271
> Maven Error
> {code:java}
> [INFO] --- cxf-codegen-plugin:3.4.2:wsdl2java (generate-sources-test) @ test-cxf-codegen ---
> [INFO] Running code generation in fork mode...
> [INFO] The java executable is c:\Program Files\Java\jdk-11.0.8\bin\java.exe
> [INFO] Building jar: C:\Users\gmccone\AppData\Local\Temp\cxf-tmp-7337572184428678393\cxf-codegen10540664752677402074.jar
> [WARNING] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> [WARNING] SLF4J: Defaulting to no-operation (NOP) logger implementation
> [WARNING] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
> [WARNING] Exception in thread "main" org.apache.cxf.tools.common.ToolException: java.lang.StringIndexOutOfBoundsException: String index out of range: 56
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:410)
> [WARNING]       at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
> [WARNING]       at org.apache.cxf.maven_plugin.wsdl2java.ForkOnceWSDL2Java.main(ForkOnceWSDL2Java.java:51)
> [WARNING] Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 56
> [WARNING]       at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:47)
> [WARNING]       at java.base/java.lang.String.charAt(String.java:693)
> [WARNING]       at com.sun.codemodel.JCommentPart.escape(JCommentPart.java:133)
> [WARNING]       at com.sun.codemodel.JCommentPart.format(JCommentPart.java:90)
> [WARNING]       at com.sun.codemodel.JDocComment.generate(JDocComment.java:150)
> [WARNING]       at com.sun.codemodel.JFormatter.g(JFormatter.java:320)
> [WARNING]       at com.sun.codemodel.JMethod.declare(JMethod.java:390)
> [WARNING]       at com.sun.codemodel.JFormatter.d(JFormatter.java:346)
> [WARNING]       at com.sun.codemodel.JDefinedClass.declareBody(JDefinedClass.java:803)
> [WARNING]       at com.sun.codemodel.JDefinedClass.declare(JDefinedClass.java:774)
> [WARNING]       at com.sun.codemodel.JFormatter.d(JFormatter.java:346)
> [WARNING]       at com.sun.codemodel.JFormatter.write(JFormatter.java:420)
> [WARNING]       at com.sun.codemodel.JPackage.build(JPackage.java:422)
> [WARNING]       at com.sun.codemodel.JCodeModel.build(JCodeModel.java:328)
> [WARNING]       at com.sun.codemodel.JCodeModel.build(JCodeModel.java:318)
> [WARNING]       at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.generate(JAXBDataBinding.java:844)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:717)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:259)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:156)
> [WARNING]       at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:402)
> [WARNING]       ... 4 more
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 9.090 s
> [INFO] Finished at: 2021-02-10T14:57:32-07:00
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:3.4.2:wsdl2java (generate-sources-test) on project test-cxf-codegen:
> [ERROR] Exit code: 1
> [ERROR] Command line was: cmd.exe /X /C ""c:\Program Files\Java\jdk-11.0.8\bin\java.exe" --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -jar C:\Users\gmccone\AppData\Local\Temp\cxf-tmp-7337572184428678393\cxf-codegen10540664752677402074.jar C:\Users\gmccone\AppData\Local\Temp\cxf-tmp-7337572184428678393\cxf-w2j11172612224607807272args"
> {code}
> Attached is the test WSDL that exhibits the error.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)