Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8749

Existing handler file fails the compile generated java source files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.3
    • 3.5.4, 4.0.0, 3.6.0
    • Tooling
    • None
    • Unknown

    Description

      Use wsdl2java to generate code for two wsdls , and passing the same "-d" and "-classdir" flags to put the source files and compiled classes to one directory. The first wsdl file generated handler files always fails compiler the source files by the second wsdl. 

      org.apache.cxf.tools.common.ToolException: FAIL_TO_COPY_GENERATED_RESOURCE_FILE
            at org.apache.cxf.tools.common.ClassUtils.compile(ClassUtils.java:104)
            at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:295)
            at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:156)
            at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:402)
            at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
            at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
            at org.jboss.wsf.stack.cxf.tools.CXFConsumerImpl.consume(CXFConsumerImpl.java:303)
            at org.jboss.ws.tools.cmd.WSConsume.importServices(WSConsume.java:298)
            at org.jboss.ws.tools.cmd.WSConsume.mainInternal(WSConsume.java:108)
            at org.jboss.ws.tools.cmd.WSConsume.main(WSConsume.java:96)
        Caused by: java.nio.file.FileAlreadyExistsException: /Users/jimma/classes/generated-classes/Endpoint_handler.xml
            at sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:551)
            at sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
            at java.nio.file.Files.copy(Files.java:1274)
            at org.apache.cxf.tools.common.ClassUtils.compile(ClassUtils.java:99)
            ... 9 more

       

      This issue is introduced by:

      commit f5f08c838e1d52f17bcc8422fac38831a63e6e30
      Author: Alexey Markevich <buhhunyx@gmail.com>
      Date:   Mon Nov 16 10:44:36 2020 +0300
          cxf-tools-common: use Files.copy
      
      

      https://github.com/apache/cxf/commit/f5f08c838e1d52f17bcc8422fac38831a63e6e30

       

      It's better to add a warning message instead of throwing exception which fails the compiling generated files.

      Attachments

        Activity

          People

            ema Jim Ma
            ema Jim Ma
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: