Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

[BUG] java.lang.IllegalStateException: java.nio.file.FileAlreadyExistsException #36333

Open bitbaggi opened 1 year ago

bitbaggi commented 1 year ago

When i run the nativeTest i get an error:

I'm using binders to integrate to serviceBus instances in my spring-boot service.

At another Service with same configuration and dependencyVersions, but with only single service bus string, its working.

java.lang.IllegalStateException: java.nio.file.FileAlreadyExistsException: /project-path/build/generated/aotTestSources/com/azure/spring/cloud/autoconfigure/implementation/context/AzureGlobalPropertiesAutoConfiguration__ServicebusBinderBeanDefinitions.java
        at org.springframework.aot.generate.FileSystemGeneratedFiles.addFile(FileSystemGeneratedFiles.java:97)
        at org.springframework.aot.generate.GeneratedFiles.addFile(GeneratedFiles.java:149)
        at org.springframework.aot.generate.GeneratedFiles.addSourceFile(GeneratedFiles.java:70)
        at org.springframework.aot.generate.GeneratedFiles.addSourceFile(GeneratedFiles.java:47)
        at org.springframework.aot.generate.GeneratedClasses.writeTo(GeneratedClasses.java:198)
        at org.springframework.aot.generate.DefaultGenerationContext.writeGeneratedContent(DefaultGenerationContext.java:127)
        at org.springframework.test.context.aot.TestContextAotGenerator.lambda$processAheadOfTime$4(TestContextAotGenerator.java:209)
        at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:729)
        at org.springframework.util.MultiValueMapAdapter.forEach(MultiValueMapAdapter.java:179)
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:197)
        at org.springframework.test.context.aot.TestContextAotGenerator.processAheadOfTime(TestContextAotGenerator.java:159)
        at org.springframework.test.context.aot.TestAotProcessor.performAotProcessing(TestAotProcessor.java:91)
        at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:72)
        at org.springframework.test.context.aot.TestAotProcessor.doProcess(TestAotProcessor.java:39)
        at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
        at org.springframework.boot.test.context.SpringBootTestAotProcessor.main(SpringBootTestAotProcessor.java:63)
Caused by: java.nio.file.FileAlreadyExistsException: /project-path/build/generated/aotTestSources/com/azure/spring/cloud/autoconfigure/implementation/context/AzureGlobalPropertiesAutoConfiguration__ServicebusBinderBeanDefinitions.java
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
        at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:484)
        at java.base/java.nio.file.Files.newOutputStream(Files.java:227)
        at java.base/java.nio.file.Files.copy(Files.java:3135)
        at org.springframework.aot.generate.FileSystemGeneratedFiles.addFile(FileSystemGeneratedFiles.java:93)
        ... 15 common frames omitted

Setup: OS: MacBook Pro IDE: IntelliJ Library/Libraries: com.azure.spring:spring-cloud-azure-stream-binder-servicebus:5.4.0 Java version: 17 Frameworks: Spring Boot

joshfree commented 1 year ago

Hi @bitbaggi thanks for reporting this issue -- someone from the Azure Spring team will follow up with you momentarily.

Netyyyy commented 1 year ago

Hi @bitbaggi , thanks for reaching out. We have received your submission and will take it into consideration. We appreciate your input and will review this matter as soon as possible. Please feel free to provide any additional information or context that you think may be helpful. We'll keep you updated on the progress of our review. Thank you for your contribution to improving our project.