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

Camel jira throws in native mode java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl #2650

Closed
lfabriko opened this issue May 24, 2021 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lfabriko
Copy link

lfabriko commented May 24, 2021

I generated sample application on https://code.quarkus.io/?e=org.apache.camel.quarkus%3Acamel-quarkus-jira with Camel Jira and replaced the GreetingResource.java with code:

package org.acme;

import java.lang.Exception;
import java.lang.Override;
import org.apache.camel.builder.RouteBuilder;

public class MyRouteBuilder  extends RouteBuilder {
    @Override
    public void configure() throws Exception {
        this.getContext().setStreamCaching(false);

        from("jira://newIssues?jiraUrl=xxx&username=xxx&password=xxx&jql=xxx")
                .log("${body}");
    }
}

Next I run:
./mvnw package -Pnative -Dquarkus.native.container-build=true
./target/code-with-quarkus-1.0.0-SNAPSHOT-runner
which produced


__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-05-24 14:36:47,772 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2021-05-24 14:36:47,775 INFO  [org.apa.cam.com.jir.JiraEndpoint] (main) Jira Basic authentication with username/password.
2021-05-24 14:36:47,777 ERROR [org.apa.cam.imp.eng.AbstractCamelContext] (main) Error starting CamelContext (camel-1) due to exception thrown: Failed to start route route1 because of null: org.apache.camel.FailedToStartRouteException: Failed to start route route1 because of null
        at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123)
        at org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:306)
        at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:189)
        at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:147)
        at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:3177)
        at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2861)
        at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2812)
        at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
        at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2507)
        at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
        at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
        at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:139)
        at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
        at org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
        at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy_0(CamelBootstrapProcessor$boot-173480958.zig:101)
        at io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy(CamelBootstrapProcessor$boot-173480958.zig:40)
        at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:598)
        at io.quarkus.runtime.Application.start(Application.java:90)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:100)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
        at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl
        at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:129)
        at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:96)
@jamesnetherton
Copy link
Contributor

Try adding an exclusion like this:

<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jira</artifactId>
    <exclusions>
        <exclusion>
            <groupId>com.sun.jersey</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Then add this dependency:

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-rest-client</artifactId>
</dependency>

Then rebuild / retry the native application.

@lfabriko
Copy link
Author

Thank you, it runs correctly now.

@jamesnetherton jamesnetherton self-assigned this May 24, 2021
@jamesnetherton jamesnetherton added the bug Something isn't working label May 24, 2021
@jamesnetherton jamesnetherton added this to the 2.0.0 milestone May 24, 2021
@jamesnetherton jamesnetherton changed the title Application with extension Camel jira throws in native mode java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl Camel jira throws in native mode java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl May 24, 2021
jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue May 26, 2021
jamesnetherton added a commit to jboss-fuse/camel-quarkus that referenced this issue May 27, 2021
jamesnetherton added a commit to jboss-fuse/camel-quarkus that referenced this issue May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants