Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running app in OpenShift fails because of classpath set after jar #15416

Closed
llowinge opened this issue Mar 2, 2021 · 8 comments · Fixed by #15670
Closed

Running app in OpenShift fails because of classpath set after jar #15416

llowinge opened this issue Mar 2, 2021 · 8 comments · Fixed by #15670
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@llowinge
Copy link
Contributor

llowinge commented Mar 2, 2021

Describe the bug
Using quarkus-openshift plugin to deploy quarkus app i can see in deploymentconfig

    spec:
      containers:
      - args:
        - -jar
        - /deployments/camel-quarkus-examples-rest-json-1.6.0-SNAPSHOT-runner.jar
        - -cp
        - /deployments/lib/jakarta.annotation.jakarta.annotation-api-1.3.5.jar:/deployments/lib/jakarta.el.jakarta.el-api-3.0.3.jar:/deployments/lib/jakarta.interceptor.jakarta.interceptor-api-1.2.5.jar:/deployments/lib/jakarta.enterprise.jakarta.enterprise.cdi-api-2.0.2.jar:/deployments/lib/jakarta.inject.jakarta.inject-api-1.0.jar:/deployments/lib/io.quarkus.quarkus-development-mode-spi-1.12.0.Final.jar:/deployments/lib/io.smallrye.config.smallrye-config-common-1.10.2.jar:/deployments/lib/io.smallrye.common.smallrye-common-function-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-expression-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-constraint-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-classloader-1.5.0.jar:/deployments/lib/io.smallrye.config.smallrye-config-1.10.2.jar:/deployments/lib/org.jboss.logging.jboss-logging-3.4.1.Final.jar:/deployments/lib/org.jboss.logmanager.jboss-logmanager-embedded-1.0.6.jar:/deployments/lib/org.jboss.logging.jboss-logging-annotations-2.2.0.Final.jar:/deployments/lib/org.jboss.threads.jboss-threads-3.2.0.Final.jar:/deployments/lib/org.slf4j.slf4j-api-1.7.30.jar:/deployments/lib/org.jboss.slf4j.slf4j-jboss-logmanager-1.1.0.Final.jar:/deployments/lib/org.graalvm.sdk.graal-sdk-21.0.0.jar:/deployments/lib/org.wildfly.common.wildfly-common-1.5.4.Final-format-001.jar:/deployments/lib/io.smallrye.common.smallrye-common-io-1.5.0.jar:/deployments/lib/io.quarkus.quarkus-bootstrap-runner-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-core-1.12.0.Final.jar:/deployments/lib/jakarta.transaction.jakarta.transaction-api-1.3.3.jar:/deployments/lib/io.quarkus.arc.arc-1.12.0.Final.jar:/deployments/lib/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.0.1.jar:/deployments/lib/io.quarkus.quarkus-arc-1.12.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-support-common-1.7.0.jar:/deployments/lib/org.apache.camel.camel-base-3.8.0.jar:/deployments/lib/org.apache.camel.camel-componentdsl-3.8.0.jar:/deployments/lib/org.apache.camel.camel-util-json-3.8.0.jar:/deployments/lib/org.apache.camel.camel-tooling-model-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-catalog-3.8.0.jar:/deployments/lib/org.apache.camel.camel-base-engine-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-model-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-reifier-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-engine-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-languages-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-processor-3.8.0.jar:/deployments/lib/org.apache.camel.camel-endpointdsl-3.8.0.jar:/deployments/lib/org.eclipse.microprofile.config.microprofile-config-api-1.4.jar:/deployments/lib/org.apache.camel.camel-microprofile-config-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-core-1.7.0.jar:/deployments/lib/org.apache.camel.camel-api-3.8.0.jar:/deployments/lib/org.apache.camel.camel-management-api-3.8.0.jar:/deployments/lib/org.apache.camel.camel-support-3.8.0.jar:/deployments/lib/org.apache.camel.camel-util-3.8.0.jar:/deployments/lib/org.apache.camel.camel-main-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-main-1.7.0.jar:/deployments/lib/com.sun.activation.javax.activation-1.2.0.jar:/deployments/lib/org.apache.camel.camel-attachments-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-attachments-1.7.0.jar:/deployments/lib/org.apache.camel.camel-platform-http-3.8.0.jar:/deployments/lib/io.vertx.vertx-web-common-3.9.5.jar:/deployments/lib/io.vertx.vertx-auth-common-3.9.5.jar:/deployments/lib/io.vertx.vertx-bridge-common-3.9.5.jar:/deployments/lib/io.netty.netty-common-4.1.49.Final.jar:/deployments/lib/io.netty.netty-buffer-4.1.49.Final.jar:/deployments/lib/io.netty.netty-transport-4.1.49.Final.jar:/deployments/lib/io.netty.netty-handler-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-socks-4.1.49.Final.jar:/deployments/lib/io.netty.netty-handler-proxy-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-http-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-http2-4.1.49.Final.jar:/deployments/lib/io.netty.netty-resolver-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-dns-4.1.49.Final.jar:/deployments/lib/io.netty.netty-resolver-dns-4.1.49.Final.jar:/deployments/lib/io.vertx.vertx-core-3.9.5.jar:/deployments/lib/io.vertx.vertx-web-3.9.5.jar:/deployments/lib/org.apache.camel.camel-platform-http-vertx-3.8.0.jar:/deployments/lib/io.netty.netty-codec-4.1.49.Final.jar:/deployments/lib/io.quarkus.quarkus-netty-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-core-1.12.0.Final.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-api-1.1.0.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-storage-1.1.0.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-1.1.0.jar:/deployments/lib/io.quarkus.quarkus-smallrye-context-propagation-1.12.0.Final.jar:/deployments/lib/io.smallrye.reactive.mutiny-context-propagation-0.13.0.jar:/deployments/lib/io.quarkus.quarkus-mutiny-1.12.0.Final.jar:/deployments/lib/io.smallrye.reactive.smallrye-mutiny-vertx-runtime-1.4.0.jar:/deployments/lib/org.mvel.mvel2-2.4.12.Final.jar:/deployments/lib/io.vertx.vertx-codegen-3.9.5.jar:/deployments/lib/io.smallrye.reactive.vertx-mutiny-generator-1.4.0.jar:/deployments/lib/io.smallrye.reactive.smallrye-mutiny-vertx-core-1.4.0.jar:/deployments/lib/io.quarkus.quarkus-vertx-1.12.0.Final.jar:/deployments/lib/io.smallrye.common.smallrye-common-annotation-1.5.0.jar:/deployments/lib/io.quarkus.quarkus-security-runtime-spi-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-http-dev-console-runtime-spi-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-http-1.12.0.Final.jar:/deployments/lib/org.reactivestreams.reactive-streams-1.0.3.jar:/deployments/lib/io.smallrye.reactive.mutiny-0.13.0.jar:/deployments/lib/io.quarkus.security.quarkus-security-1.1.3.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-web-1.12.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-platform-http-1.7.0.jar:/deployments/lib/io.quarkus.quarkus-jaxp-1.12.0.Final.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-databind-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.module.jackson-module-parameter-names-2.12.1.jar:/deployments/lib/io.quarkus.quarkus-jackson-1.12.0.Final.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-annotations-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-core-2.12.1.jar:/deployments/lib/jakarta.activation.jakarta.activation-api-1.2.1.jar:/deployments/lib/com.fasterxml.jackson.module.jackson-module-jaxb-annotations-2.12.1.jar:/deployments/lib/org.apache.camel.camel-jackson-3.8.0.jar:/deployments/lib/org.jboss.spec.javax.xml.bind.jboss-jaxb-api_2.3_spec-2.0.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-jackson-1.7.0.jar:/deployments/lib/io.quarkus.quarkus-kubernetes-client-internal-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-openshift-1.12.0.Final.jar:/deployments/lib/io.quarkus.ts.openshift.app-metadata-1.0.0-SNAPSHOT.jar
        - -Dquarkus.http.host=0.0.0.0
        - -Djava.util.logging.manager=org.jboss.logmanager.LogManager
        command:
        - java

I think the problem comes from https://github.com/quarkusio/quarkus/blob/master/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java#L110.

Expected behavior
The correct order (alteast from java --help) is java [options] -jar <jarfile> [args...] where -cp is in [options].

Actual behavior
Wrong sequence leads to a problem in pod

2021-03-02 16:09:24,852 INFO  [org.apa.cam.qua.mai.CamelMainRuntime] (main) Starting camel-quarkus with args: [-cp, /deployments/lib/jakarta.annotation.jakarta.annotation-api-1.3.5.jar:/deployments/lib/jakarta.el.jakarta.el-api-3.0.3.jar:/deployments/lib/jakarta.interceptor.jakarta.interceptor-api-1.2.5.jar:/deployments/lib/jakarta.enterprise.jakarta.enterprise.cdi-api-2.0.2.jar:/deployments/lib/jakarta.inject.jakarta.inject-api-1.0.jar:/deployments/lib/io.quarkus.quarkus-development-mode-spi-1.12.0.Final.jar:/deployments/lib/io.smallrye.config.smallrye-config-common-1.10.2.jar:/deployments/lib/io.smallrye.common.smallrye-common-function-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-expression-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-constraint-1.5.0.jar:/deployments/lib/io.smallrye.common.smallrye-common-classloader-1.5.0.jar:/deployments/lib/io.smallrye.config.smallrye-config-1.10.2.jar:/deployments/lib/org.jboss.logging.jboss-logging-3.4.1.Final.jar:/deployments/lib/org.jboss.logmanager.jboss-logmanager-embedded-1.0.6.jar:/deployments/lib/org.jboss.logging.jboss-logging-annotations-2.2.0.Final.jar:/deployments/lib/org.jboss.threads.jboss-threads-3.2.0.Final.jar:/deployments/lib/org.slf4j.slf4j-api-1.7.30.jar:/deployments/lib/org.jboss.slf4j.slf4j-jboss-logmanager-1.1.0.Final.jar:/deployments/lib/org.graalvm.sdk.graal-sdk-21.0.0.jar:/deployments/lib/org.wildfly.common.wildfly-common-1.5.4.Final-format-001.jar:/deployments/lib/io.smallrye.common.smallrye-common-io-1.5.0.jar:/deployments/lib/io.quarkus.quarkus-bootstrap-runner-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-core-1.12.0.Final.jar:/deployments/lib/jakarta.transaction.jakarta.transaction-api-1.3.3.jar:/deployments/lib/io.quarkus.arc.arc-1.12.0.Final.jar:/deployments/lib/org.eclipse.microprofile.context-propagation.microprofile-context-propagation-api-1.0.1.jar:/deployments/lib/io.quarkus.quarkus-arc-1.12.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-support-common-1.7.0.jar:/deployments/lib/org.apache.camel.camel-base-3.8.0.jar:/deployments/lib/org.apache.camel.camel-componentdsl-3.8.0.jar:/deployments/lib/org.apache.camel.camel-util-json-3.8.0.jar:/deployments/lib/org.apache.camel.camel-tooling-model-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-catalog-3.8.0.jar:/deployments/lib/org.apache.camel.camel-base-engine-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-model-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-reifier-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-engine-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-languages-3.8.0.jar:/deployments/lib/org.apache.camel.camel-core-processor-3.8.0.jar:/deployments/lib/org.apache.camel.camel-endpointdsl-3.8.0.jar:/deployments/lib/org.eclipse.microprofile.config.microprofile-config-api-1.4.jar:/deployments/lib/org.apache.camel.camel-microprofile-config-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-core-1.7.0.jar:/deployments/lib/org.apache.camel.camel-api-3.8.0.jar:/deployments/lib/org.apache.camel.camel-management-api-3.8.0.jar:/deployments/lib/org.apache.camel.camel-support-3.8.0.jar:/deployments/lib/org.apache.camel.camel-util-3.8.0.jar:/deployments/lib/org.apache.camel.camel-main-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-main-1.7.0.jar:/deployments/lib/com.sun.activation.javax.activation-1.2.0.jar:/deployments/lib/org.apache.camel.camel-attachments-3.8.0.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-attachments-1.7.0.jar:/deployments/lib/org.apache.camel.camel-platform-http-3.8.0.jar:/deployments/lib/io.vertx.vertx-web-common-3.9.5.jar:/deployments/lib/io.vertx.vertx-auth-common-3.9.5.jar:/deployments/lib/io.vertx.vertx-bridge-common-3.9.5.jar:/deployments/lib/io.netty.netty-common-4.1.49.Final.jar:/deployments/lib/io.netty.netty-buffer-4.1.49.Final.jar:/deployments/lib/io.netty.netty-transport-4.1.49.Final.jar:/deployments/lib/io.netty.netty-handler-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-socks-4.1.49.Final.jar:/deployments/lib/io.netty.netty-handler-proxy-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-http-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-http2-4.1.49.Final.jar:/deployments/lib/io.netty.netty-resolver-4.1.49.Final.jar:/deployments/lib/io.netty.netty-codec-dns-4.1.49.Final.jar:/deployments/lib/io.netty.netty-resolver-dns-4.1.49.Final.jar:/deployments/lib/io.vertx.vertx-core-3.9.5.jar:/deployments/lib/io.vertx.vertx-web-3.9.5.jar:/deployments/lib/org.apache.camel.camel-platform-http-vertx-3.8.0.jar:/deployments/lib/io.netty.netty-codec-4.1.49.Final.jar:/deployments/lib/io.quarkus.quarkus-netty-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-core-1.12.0.Final.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-api-1.1.0.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-storage-1.1.0.jar:/deployments/lib/io.smallrye.smallrye-context-propagation-1.1.0.jar:/deployments/lib/io.quarkus.quarkus-smallrye-context-propagation-1.12.0.Final.jar:/deployments/lib/io.smallrye.reactive.mutiny-context-propagation-0.13.0.jar:/deployments/lib/io.quarkus.quarkus-mutiny-1.12.0.Final.jar:/deployments/lib/io.smallrye.reactive.smallrye-mutiny-vertx-runtime-1.4.0.jar:/deployments/lib/org.mvel.mvel2-2.4.12.Final.jar:/deployments/lib/io.vertx.vertx-codegen-3.9.5.jar:/deployments/lib/io.smallrye.reactive.vertx-mutiny-generator-1.4.0.jar:/deployments/lib/io.smallrye.reactive.smallrye-mutiny-vertx-core-1.4.0.jar:/deployments/lib/io.quarkus.quarkus-vertx-1.12.0.Final.jar:/deployments/lib/io.smallrye.common.smallrye-common-annotation-1.5.0.jar:/deployments/lib/io.quarkus.quarkus-security-runtime-spi-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-http-dev-console-runtime-spi-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-http-1.12.0.Final.jar:/deployments/lib/org.reactivestreams.reactive-streams-1.0.3.jar:/deployments/lib/io.smallrye.reactive.mutiny-0.13.0.jar:/deployments/lib/io.quarkus.security.quarkus-security-1.1.3.Final.jar:/deployments/lib/io.quarkus.quarkus-vertx-web-1.12.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-platform-http-1.7.0.jar:/deployments/lib/io.quarkus.quarkus-jaxp-1.12.0.Final.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-databind-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.module.jackson-module-parameter-names-2.12.1.jar:/deployments/lib/io.quarkus.quarkus-jackson-1.12.0.Final.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-annotations-2.12.1.jar:/deployments/lib/com.fasterxml.jackson.core.jackson-core-2.12.1.jar:/deployments/lib/jakarta.activation.jakarta.activation-api-1.2.1.jar:/deployments/lib/com.fasterxml.jackson.module.jackson-module-jaxb-annotations-2.12.1.jar:/deployments/lib/org.apache.camel.camel-jackson-3.8.0.jar:/deployments/lib/org.jboss.spec.javax.xml.bind.jboss-jaxb-api_2.3_spec-2.0.0.Final.jar:/deployments/lib/org.apache.camel.quarkus.camel-quarkus-jackson-1.7.0.jar:/deployments/lib/io.quarkus.quarkus-kubernetes-client-internal-1.12.0.Final.jar:/deployments/lib/io.quarkus.quarkus-openshift-1.12.0.Final.jar:/deployments/lib/io.quarkus.ts.openshift.app-metadata-1.0.0-SNAPSHOT.jar, -Dquarkus.http.host=0.0.0.0, -Djava.util.logging.manager=org.jboss.logmanager.LogManager]
Unknown option: -cp

Apache Camel Runner takes the following options

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:
1.
2.
3.

Configuration

# Add your application.properties here, if applicable.

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Output of uname -a or ver:
  • Output of java -version:
  • GraalVM version (if different from Java):
  • Quarkus version or git rev:
  • Build tool (ie. output of mvnw --version or gradlew --version):

Additional context
(Add any other context about the problem here.)

@llowinge llowinge added the kind/bug Something isn't working label Mar 2, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 2, 2021

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Mar 2, 2021

@iocanel this sounds like one for you :)

@famod
Copy link
Member

famod commented Mar 2, 2021

AFAIK, -cp is ignored when using -jar!
https://stackoverflow.com/a/5858892

So -cp should probably be dropped completely.

@geoand
Copy link
Contributor

geoand commented Mar 2, 2021

Yeah for sure.

@iocanel we've mentioned that before haven't we?

@maxandersen
Copy link
Contributor

#15076 seems related

@ppalaga
Copy link
Contributor

ppalaga commented Mar 12, 2021

#15076 fixes the -jar before -cp ordering problem (by dropping -cp altogether) only if quarkus.package.type is uber-jar. For fast-jar and legacy-jar the ordering is still broken and -cp is interpreted as an application argument.

As mentioned above, there is no point in setting -cp because it is both ignored by java and we properly set Class-Path: in the runner manifests of fast-jar, legacy-jar and uber-jar.

@iocanel I'd send a PR, unless you want to do it yourself?

@iocanel
Copy link
Contributor

iocanel commented Mar 12, 2021

@ppalaga: sure go ahead!

@ppalaga
Copy link
Contributor

ppalaga commented Mar 12, 2021

Thanks, sent #15670

@quarkus-bot quarkus-bot bot added this to the 1.14 - main milestone Mar 22, 2021
@gsmet gsmet modified the milestones: 1.14 - main, 1.13.0.Final Mar 23, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Mar 23, 2021
@gsmet gsmet modified the milestones: 1.13.0.Final, 1.11.7.Final Apr 29, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants