Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17662

REST DSL without restConfiguration fails with camel-jbang

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.15.0
    • 3.16.0
    • camel-jbang
    • None
    • Unknown

    Description

      Running following yaml

      apiVersion: camel.apache.org/v1
      kind: Integration
      metadata:
        name: rest-dsl-example.yaml
      spec:
        flows:
          - rest:
              get:
                - uri: "/foo"
                  to: "direct:foo"
          - from:
              uri: 'direct:foo'
              steps:
                - log: '${body}'
      

      with command

      jbang -Dcamel.jbang.version=3.15.0 camel@apache/camel run rest-dsl-example.yaml
      

      have following error

      2022-02-16 14:43:28.860  INFO 18536 --- [           main] e.camel.impl.engine.AbstractCamelContext : Detected: camel-debug JAR (enabling Camel Debugging)
      2022-02-16 14:43:28.982  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    : Auto-configuration summary
      2022-02-16 14:43:28.982  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.name=CamelJBang
      2022-02-16 14:43:28.982  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.shutdownTimeout=5
      2022-02-16 14:43:28.982  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.routesReloadEnabled=false
      2022-02-16 14:43:28.982  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.sourceLocationEnabled=true
      2022-02-16 14:43:28.983  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.tracing=false
      2022-02-16 14:43:28.983  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.main.routesIncludePattern=file:rest-dsl-example.yaml
      2022-02-16 14:43:28.983  INFO 18536 --- [           main] org.apache.camel.main.BaseMainSupport    :     camel.component.kamelet.location=classpath:/kamelets,github:apache:camel-kamelets/kamelets
      2022-02-16 14:43:29.074  INFO 18536 --- [           main] e.camel.management.JmxManagementStrategy : JMX is enabled
      2022-02-16 14:43:29.795  INFO 18536 --- [           main] org.apache.camel.main.DownloaderHelper   : Downloaded dependency: org.apache.camel:camel-coap:3.15.0 took: 626ms
      Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/californium/elements/Connector
              at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
              at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
              at java.base/java.lang.Class.getConstructor0(Class.java:3342)
              at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553)
              at org.apache.camel.support.ObjectHelper.newInstance(ObjectHelper.java:393)
              at org.apache.camel.impl.engine.DefaultInjector.newInstance(DefaultInjector.java:65)
              at org.apache.camel.impl.engine.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:66)
              at org.apache.camel.main.DependencyDownloaderComponentResolver.resolveComponent(DependencyDownloaderComponentResolver.java:56)
              at org.apache.camel.impl.engine.AbstractCamelContext.initComponent(AbstractCamelContext.java:692)
              at org.apache.camel.impl.engine.AbstractCamelContext$3.apply(AbstractCamelContext.java:620)
              at org.apache.camel.impl.engine.AbstractCamelContext$3.apply(AbstractCamelContext.java:616)
              at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
              at org.apache.camel.impl.engine.AbstractCamelContext.getComponent(AbstractCamelContext.java:616)
              at org.apache.camel.impl.engine.AbstractCamelContext.getComponent(AbstractCamelContext.java:596)
              at org.apache.camel.component.rest.RestEndpoint.createConsumer(RestEndpoint.java:515)
              at org.apache.camel.impl.engine.DefaultRoute.gatherRootServices(DefaultRoute.java:620)
              at org.apache.camel.impl.engine.DefaultRoute.gatherServices(DefaultRoute.java:604)
              at org.apache.camel.impl.engine.DefaultRoute.initializeServices(DefaultRoute.java:189)
              at org.apache.camel.impl.engine.RouteService.doSetup(RouteService.java:151)
              at org.apache.camel.impl.engine.RouteService.setUp(RouteService.java:130)
              at org.apache.camel.impl.engine.InternalRouteStartupManager.doInitRoutes(InternalRouteStartupManager.java:92)
              at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2903)
              at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
              at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2585)
              at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
              at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2604)
              at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:247)
              at org.apache.camel.main.KameletMain.doStart(KameletMain.java:129)
              at org.apache.camel.support.service.BaseService.start(BaseService.java:119)
              at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:308)
              at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:120)
              at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:46)
              at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
              at picocli.CommandLine.access$1300(CommandLine.java:145)
              at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
              at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
              at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
              at picocli.CommandLine.execute(CommandLine.java:2078)
              at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:43)
              at main.CamelJBang.main(CamelJBang.java:37)
      Caused by: java.lang.ClassNotFoundException: org.eclipse.californium.elements.Connector
              at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
              at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:869)
              at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:979)
              at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:967)
              ... 42 more
      

      Assuming camel-jbang provides default REST DSL implementation

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            marat.gubaidullin@gmail.com Marat Gubaidullin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: