From 6ac203e24f9026dc5f1ecc1e4fe0ae2c586a8df9 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 6 May 2019 14:28:21 +0200 Subject: [PATCH 1/6] Fix #2346 CamelConfig.BuildTime.disableJaxb and disableXml need defaults --- .../io/quarkus/camel/core/runtime/CamelConfig.java | 10 ++++++++-- .../quarkus/camel/core/runtime/graal/JaxbDisabled.java | 9 +++++++-- .../quarkus/camel/core/runtime/graal/XmlDisabled.java | 9 +++++++-- .../src/main/resources/application.properties | 2 ++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/CamelConfig.java b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/CamelConfig.java index 3d2e457a5c08a..27056d77ec012 100644 --- a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/CamelConfig.java +++ b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/CamelConfig.java @@ -2,6 +2,8 @@ import java.util.List; +import io.quarkus.camel.core.runtime.graal.JaxbDisabled; +import io.quarkus.camel.core.runtime.graal.XmlDisabled; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @@ -28,8 +30,10 @@ public static class BuildTime { * down the size of applications, it is possible to disable jaxb support * at runtime. This is useful when routes at loaded at build time and * thus the camel route model is not used at runtime anymore. + * + * @see JaxbDisabled */ - @ConfigItem + @ConfigItem(defaultValue = "false") public boolean disableJaxb; /** @@ -37,8 +41,10 @@ public static class BuildTime { * Because xml parsing using xerces/xalan libraries can consume * a lot of code space in the native binary (and a lot of cpu resources * when building), this allows to disable both libraries. + * + * @see XmlDisabled */ - @ConfigItem + @ConfigItem(defaultValue = "false") public boolean disableXml; } diff --git a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/JaxbDisabled.java b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/JaxbDisabled.java index 2b619c214869c..b8034278152a7 100644 --- a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/JaxbDisabled.java +++ b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/JaxbDisabled.java @@ -1,5 +1,6 @@ package io.quarkus.camel.core.runtime.graal; +import java.util.Optional; import java.util.function.BooleanSupplier; import org.eclipse.microprofile.config.ConfigProvider; @@ -8,8 +9,12 @@ public final class JaxbDisabled implements BooleanSupplier { @Override public boolean getAsBoolean() { - String val = ConfigProvider.getConfig().getValue("quarkus.camel.disable-jaxb", String.class); - return Boolean.parseBoolean(val); + Optional val = ConfigProvider.getConfig().getOptionalValue("quarkus.camel.disable-jaxb", String.class); + if (val.isPresent()) { + return Boolean.parseBoolean(val.get()); + } else { + return false; + } } } diff --git a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/XmlDisabled.java b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/XmlDisabled.java index 6f1a28d07ed7a..24d3762b2be11 100644 --- a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/XmlDisabled.java +++ b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/XmlDisabled.java @@ -1,5 +1,6 @@ package io.quarkus.camel.core.runtime.graal; +import java.util.Optional; import java.util.function.BooleanSupplier; import org.eclipse.microprofile.config.ConfigProvider; @@ -8,8 +9,12 @@ public final class XmlDisabled implements BooleanSupplier { @Override public boolean getAsBoolean() { - String val = ConfigProvider.getConfig().getValue("quarkus.camel.disable-xml", String.class); - return Boolean.parseBoolean(val); + Optional val = ConfigProvider.getConfig().getOptionalValue("quarkus.camel.disable-xml", String.class); + if (val.isPresent()) { + return Boolean.parseBoolean(val.get()); + } else { + return false; + } } } diff --git a/integration-tests/camel-core/src/main/resources/application.properties b/integration-tests/camel-core/src/main/resources/application.properties index f9215ab432c4e..8aa33a3131e21 100644 --- a/integration-tests/camel-core/src/main/resources/application.properties +++ b/integration-tests/camel-core/src/main/resources/application.properties @@ -6,6 +6,8 @@ quarkus.log.file.enable = false # # Camel # +quarkus.camel.disable-xml=true + camel.context.name=quarkus-camel-example camel.context.loadTypeConverters=false From f117e5d849dabfb4e3020c5e05d44b4d82c21d05 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 6 May 2019 14:49:39 +0200 Subject: [PATCH 2/6] Fix #2347 Still: Could not find field com.sun.beans.WeakCache.map on class com.sun.beans.WeakCache --- .../io/quarkus/camel/core/runtime/graal/CamelSubstitutions.java | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/CamelSubstitutions.java b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/CamelSubstitutions.java index 95ea5306daa75..9eaf52f9a23c5 100644 --- a/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/CamelSubstitutions.java +++ b/extensions/camel/camel-core/runtime/src/main/java/io/quarkus/camel/core/runtime/graal/CamelSubstitutions.java @@ -32,6 +32,7 @@ class CamelSubstitutions { @Substitute final class Target_com_sun_beans_WeakCache { + @Substitute private Map> map = new WeakHashMap<>(); @Substitute From b939b3b774322a734981c37bc6ca40772c08dbb8 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 6 May 2019 21:48:16 +0200 Subject: [PATCH 3/6] Disable CamelInfinispanITCase see #2351 --- .../java/io/quarkus/it/camel/core/CamelInfinispanITCase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration-tests/camel-core/src/test/java/io/quarkus/it/camel/core/CamelInfinispanITCase.java b/integration-tests/camel-core/src/test/java/io/quarkus/it/camel/core/CamelInfinispanITCase.java index 135138e351ff7..fd10680def9d7 100644 --- a/integration-tests/camel-core/src/test/java/io/quarkus/it/camel/core/CamelInfinispanITCase.java +++ b/integration-tests/camel-core/src/test/java/io/quarkus/it/camel/core/CamelInfinispanITCase.java @@ -1,7 +1,10 @@ package io.quarkus.it.camel.core; +import org.junit.jupiter.api.Disabled; + import io.quarkus.test.junit.SubstrateTest; +@Disabled("See https://github.com/quarkusio/quarkus/issues/2351") @SubstrateTest public class CamelInfinispanITCase extends CamelInfinispanTest { } From c48009f4064ece189accfb92e056674d7d31c753 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Mon, 6 May 2019 21:50:31 +0200 Subject: [PATCH 4/6] Activate camel-core integration tests via -Dnative Before this change -Dnative-camel was needed and the camel-core integration tests were not run on Quarkus CI. --- integration-tests/camel-core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/camel-core/pom.xml b/integration-tests/camel-core/pom.xml index f5b7659b33a30..1f7ac018619e2 100644 --- a/integration-tests/camel-core/pom.xml +++ b/integration-tests/camel-core/pom.xml @@ -116,7 +116,7 @@ native-image - native-camel + native From c7739ccf6c979f9dae83c1be7c2663bbaecb3924 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Thu, 9 May 2019 10:38:32 +0200 Subject: [PATCH 5/6] Dirty --- integration-tests/camel-core/pom.xml | 2 +- .../camel-core/src/main/resources/application.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/camel-core/pom.xml b/integration-tests/camel-core/pom.xml index 1f7ac018619e2..163e52c3cd313 100644 --- a/integration-tests/camel-core/pom.xml +++ b/integration-tests/camel-core/pom.xml @@ -156,7 +156,7 @@ false ${graalvmHome} false - true + false diff --git a/integration-tests/camel-core/src/main/resources/application.properties b/integration-tests/camel-core/src/main/resources/application.properties index 8aa33a3131e21..9f1634446e026 100644 --- a/integration-tests/camel-core/src/main/resources/application.properties +++ b/integration-tests/camel-core/src/main/resources/application.properties @@ -6,7 +6,7 @@ quarkus.log.file.enable = false # # Camel # -quarkus.camel.disable-xml=true +quarkus.camel.disable-xml=false camel.context.name=quarkus-camel-example camel.context.loadTypeConverters=false From 399ea03f26666d39721a6c0cc247651049b8f161 Mon Sep 17 00:00:00 2001 From: Peter Palaga Date: Thu, 9 May 2019 13:10:43 +0200 Subject: [PATCH 6/6] debug on Azure CI --- azure-pipelines.yml | 42 ++-------------------------- devtools/maven/pom.xml | 4 +-- integration-tests/camel-core/pom.xml | 1 + 3 files changed, 5 insertions(+), 42 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 04e765199f2e9..1920a22b1486b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,43 +33,5 @@ jobs: steps: - - script: docker run --rm --publish 5432:5432 --name build-postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -d postgres:10.5 - displayName: 'start postgres' - - - task: Maven@3 - displayName: 'Maven Build' - inputs: - goals: 'install' - options: '-B --settings azure-mvn-settings.xml -Dnative-image.docker-build -Dtest-postgresql -Dtest-elasticsearch -Dnative-image.xmx=6g -Dnative -Dno-format' - -- job: Windows_Build - timeoutInMinutes: 60 - pool: - vmImage: 'vs2017-win2016' - - variables: - imageName: 'quarkus-windows:$(build.buildId)' - - steps: - - - task: Maven@3 - displayName: 'Maven Build' - inputs: - goals: 'install' - options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format' - -- job: Build_JDK11_Linux - timeoutInMinutes: 60 - pool: - vmImage: 'Ubuntu 16.04' - - variables: - imageName: 'quarkus-jdk11:$(build.buildId)' - - steps: - - task: Maven@3 - displayName: 'Maven Build' - inputs: - jdkVersionOption: '1.11' - goals: 'install' - options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format' + - bash: 'settings=$(pwd)/azure-mvn-settings.xml; mvn clean install -DskipTests -Dinvoker.skip=true -B --settings ${settings} -Dno-format && cd integration-tests/camel-core && mvn clean verify -Dnative -Dnative-image.docker-build -B --settings ${settings} -Dnative-image.xmx=6g -Dno-format; cat target/reports/call_tree_quarkus*' + displayName: 'bash' diff --git a/devtools/maven/pom.xml b/devtools/maven/pom.xml index f76b7df4e4b93..5eb9aa1baa03c 100644 --- a/devtools/maven/pom.xml +++ b/devtools/maven/pom.xml @@ -214,7 +214,7 @@ - + org.apache.maven.plugins diff --git a/integration-tests/camel-core/pom.xml b/integration-tests/camel-core/pom.xml index 163e52c3cd313..467257198a768 100644 --- a/integration-tests/camel-core/pom.xml +++ b/integration-tests/camel-core/pom.xml @@ -157,6 +157,7 @@ ${graalvmHome} false false + -H:+ReportExceptionStackTraces