quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.64k stars 2.64k forks source link

camel-quarkus-aws-sns failing to compile image-native #7673

Open brunotitata opened 4 years ago

brunotitata commented 4 years ago

Describe the bug I am trying to compile an SMS sending project using the camel-quarkus-aws-sns dependencies, but when I compile the project for image-native using the quarkus command ./mvnw clean package: dev -Pnative, some WARNING messages about java-sdk. Removing the dependency on camel-quarkus-aws-sns, the project was successfully compiled!

I am using Java 11 with GraalVM CE 20.0.6

Actual behavior I have the version of Quarkus 1.2.1.Final

    <properties>
        <compiler-plugin.version>3.8.1</compiler-plugin.version>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus-plugin.version>1.2.1.Final</quarkus-plugin.version>
        <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
        <quarkus.platform.version>1.2.1.Final</quarkus.platform.version>
        <surefire-plugin.version>2.22.1</surefire-plugin.version>
    </properties>

with the dependency on the project

        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-aws-sns</artifactId>
        </dependency>

To Reproduce ./mvnw clean package: dev -Pnative

image text

Configuration

quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.url=jdbc:postgresql://localhost:5432/sms-quarkus?createDatabaseIfNotExist=true
quarkus.datasource.username=postgres
quarkus.datasource.password=postgres
quarkus.log.console.enable=true
quarkus.hibernate-orm.database.generation=update
quarkus.hibernate-orm.log.sql=false

quarkus.http.port=8080

aws.accesskey=-------
aws.secretkey=--------
aws.region=us-east-1

AWSConfiguration.java

@ApplicationScoped
public class AWSConfiguration {

    @ConfigProperty(name = "aws.accesskey")
    String accessKey;

    @ConfigProperty(name = "aws.secretkey")
    String secretKey;

    @ConfigProperty(name = "aws.region")
    String region;

    @Produces
    public AmazonSNS aws() {
        return AmazonSNSClientBuilder.standard().withRegion(Regions.fromName(region))
                .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
                .build();
    }

Environment (please complete the following information):

Additional context A friend also tried to compile for image-native and also failed ...

In his case it was with Java 8 with GraalVM 19.3.1

image text

gwenneg commented 4 years ago

Hi @brunotitata.

Is it me or is there a problem with the first image you uploaded? It's not loading correctly on my computer.

Regarding the second image with an exit status 137, this status means your friend ran out of memory while generating the native image. We will display a clearer error message in Quarkus 1.3 when this happens thanks to https://github.com/quarkusio/quarkus/pull/7645.

brunotitata commented 4 years ago

@gwenneg loaded here normally ... but I'll post the link here again print ...

https://i.imgur.com/b1jcDo7.png

image text