You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mark <mp...@gmail.com> on 2021/01/11 16:46:25 UTC

Jetty/Camel-K classpath problems

Hello,
I have a simple Jetty Integration which worked well mid-last year, but that
will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift 4.6.
Here's the source code:

import org.apache.camel.builder.RouteBuilder;

public class Jetty extends RouteBuilder {
  @Override
  public void configure() throws Exception {

    from ("jetty://http://0.0.0.0:8080/hello")
      .log("Received a request: ${body}")
      .setBody(simple("Hello!"));
  }
}

With v1.2.1 or v1.3,

kamel run Jetty.java --dev gives,

Caused by: java.lang.RuntimeException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
because of No endpoint could be found for: jetty://http://0.0.0.0:8080/hello,
please check your classpath contains the needed Camel component jar.

kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev

produces errors in the operator pod log:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for
org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project
org.apache.camel.k.integration:camel-k-integration:1.2.1
(/tmp/builder-501079428/maven/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for
org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
{"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
failed with error: failure while building project: exit status 1","step":"
github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
{"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
[mvn:org.apache.camel.k/camel-k-quarkus-loader-java
mvn:org.apache.camel.k/camel-k-runtime-quarkus
mvn:org.apache.camel/camel-jetty:3.7.0]"}

Please can anyone give me some advice? I really can't find a way to get
this simple Integration running, either as Java or Groovy code.

Very many thanks in advance!

Regards,
Mark

Re: Jetty/Camel-K classpath problems

Posted by mark <mp...@gmail.com>.
This works! Thank you very much Nicola!

Regards,
Mark

On Mon, 11 Jan 2021 at 17:04, Nicola Ferraro <ni...@gmail.com> wrote:

> Hi,
> since 1.2 Camel K has moved into using Quarkus as runtime (in 1.3 the old
> runtime based on main has been removed). So now it's recommended to use the
> Quarkus internal http server for exposing HTTP functions instead of Jetty.
>
> In order to use it, you can try consuming:
>
> from("platform-http:/hello")
>
> Nicola
>
> On Mon, Jan 11, 2021 at 5:53 PM mark <mp...@gmail.com> wrote:
>
> > Hello,
> > I have a simple Jetty Integration which worked well mid-last year, but
> that
> > will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift 4.6.
> > Here's the source code:
> >
> > import org.apache.camel.builder.RouteBuilder;
> >
> > public class Jetty extends RouteBuilder {
> >   @Override
> >   public void configure() throws Exception {
> >
> >     from ("jetty://http://0.0.0.0:8080/hello")
> >       .log("Received a request: ${body}")
> >       .setBody(simple("Hello!"));
> >   }
> > }
> >
> > With v1.2.1 or v1.3,
> >
> > kamel run Jetty.java --dev gives,
> >
> > Caused by: java.lang.RuntimeException:
> > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
> > because of No endpoint could be found for: jetty://
> > http://0.0.0.0:8080/hello,
> > please check your classpath contains the needed Camel component jar.
> >
> > kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev
> >
> > produces errors in the operator pod log:
> >
> > [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> > [ERROR] 'dependencies.dependency.version' for
> > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> >  @
> > [ERROR] The build could not read 1 project -> [Help 1]
> > [ERROR]
> > [ERROR]   The project
> > org.apache.camel.k.integration:camel-k-integration:1.2.1
> > (/tmp/builder-501079428/maven/pom.xml) has 1 error
> > [ERROR]     'dependencies.dependency.version' for
> > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> > [ERROR]
> > [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e
> > switch.
> > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> > [ERROR]
> > [ERROR] For more information about the errors and possible solutions,
> > please read the following articles:
> > [ERROR] [Help 1]
> >
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> >
> >
> {"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
> > failed with error: failure while building project: exit status
> 1","step":"
> > github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
> > ","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
> >
> >
> {"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
> > [mvn:org.apache.camel.k/camel-k-quarkus-loader-java
> > mvn:org.apache.camel.k/camel-k-runtime-quarkus
> > mvn:org.apache.camel/camel-jetty:3.7.0]"}
> >
> > Please can anyone give me some advice? I really can't find a way to get
> > this simple Integration running, either as Java or Groovy code.
> >
> > Very many thanks in advance!
> >
> > Regards,
> > Mark
> >
> > On Mon, 11 Jan 2021 at 16:46, mark <mp...@gmail.com> wrote:
> >
> > > Hello,
> > > I have a simple Jetty Integration which worked well mid-last year, but
> > > that will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift
> > > 4.6. Here's the source code:
> > >
> > > import org.apache.camel.builder.RouteBuilder;
> > >
> > > public class Jetty extends RouteBuilder {
> > >   @Override
> > >   public void configure() throws Exception {
> > >
> > >     from ("jetty://http://0.0.0.0:8080/hello")
> > >       .log("Received a request: ${body}")
> > >       .setBody(simple("Hello!"));
> > >   }
> > > }
> > >
> > > With v1.2.1 or v1.3,
> > >
> > > kamel run Jetty.java --dev gives,
> > >
> > > Caused by: java.lang.RuntimeException:
> > > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > > route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] ->
> [Lo...
> > > because of No endpoint could be found for: jetty://
> > > http://0.0.0.0:8080/hello, please check your classpath contains the
> > > needed Camel component jar.
> > >
> > > kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev
> > >
> > > produces errors in the operator pod log:
> > >
> > > [ERROR] [ERROR] Some problems were encountered while processing the
> POMs:
> > > [ERROR] 'dependencies.dependency.version' for
> > > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> > >  @
> > > [ERROR] The build could not read 1 project -> [Help 1]
> > > [ERROR]
> > > [ERROR]   The project
> > > org.apache.camel.k.integration:camel-k-integration:1.2.1
> > > (/tmp/builder-501079428/maven/pom.xml) has 1 error
> > > [ERROR]     'dependencies.dependency.version' for
> > > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> > > [ERROR]
> > > [ERROR] To see the full stack trace of the errors, re-run Maven with
> the
> > > -e switch.
> > > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> > > [ERROR]
> > > [ERROR] For more information about the errors and possible solutions,
> > > please read the following articles:
> > > [ERROR] [Help 1]
> > >
> >
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> > >
> >
> {"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
> > > failed with error: failure while building project: exit status
> > 1","step":"
> > > github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
> > > ","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
> > >
> >
> {"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
> > > [mvn:org.apache.camel.k/camel-k-quarkus-loader-java
> > > mvn:org.apache.camel.k/camel-k-runtime-quarkus
> > > mvn:org.apache.camel/camel-jetty:3.7.0]"}
> > >
> > > Please can anyone give me some advice? I really can't find a way to get
> > > this simple Integration running, either as Java or Groovy code.
> > >
> > > Very many thanks in advance!
> > >
> > > Regards,
> > > Mark
> > >
> >
>

Re: Jetty/Camel-K classpath problems

Posted by Nicola Ferraro <ni...@gmail.com>.
Hi,
since 1.2 Camel K has moved into using Quarkus as runtime (in 1.3 the old
runtime based on main has been removed). So now it's recommended to use the
Quarkus internal http server for exposing HTTP functions instead of Jetty.

In order to use it, you can try consuming:

from("platform-http:/hello")

Nicola

On Mon, Jan 11, 2021 at 5:53 PM mark <mp...@gmail.com> wrote:

> Hello,
> I have a simple Jetty Integration which worked well mid-last year, but that
> will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift 4.6.
> Here's the source code:
>
> import org.apache.camel.builder.RouteBuilder;
>
> public class Jetty extends RouteBuilder {
>   @Override
>   public void configure() throws Exception {
>
>     from ("jetty://http://0.0.0.0:8080/hello")
>       .log("Received a request: ${body}")
>       .setBody(simple("Hello!"));
>   }
> }
>
> With v1.2.1 or v1.3,
>
> kamel run Jetty.java --dev gives,
>
> Caused by: java.lang.RuntimeException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
> because of No endpoint could be found for: jetty://
> http://0.0.0.0:8080/hello,
> please check your classpath contains the needed Camel component jar.
>
> kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev
>
> produces errors in the operator pod log:
>
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR] 'dependencies.dependency.version' for
> org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
>  @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project
> org.apache.camel.k.integration:camel-k-integration:1.2.1
> (/tmp/builder-501079428/maven/pom.xml) has 1 error
> [ERROR]     'dependencies.dependency.version' for
> org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>
> {"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
> failed with error: failure while building project: exit status 1","step":"
> github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
> ","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
>
> {"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
> [mvn:org.apache.camel.k/camel-k-quarkus-loader-java
> mvn:org.apache.camel.k/camel-k-runtime-quarkus
> mvn:org.apache.camel/camel-jetty:3.7.0]"}
>
> Please can anyone give me some advice? I really can't find a way to get
> this simple Integration running, either as Java or Groovy code.
>
> Very many thanks in advance!
>
> Regards,
> Mark
>
> On Mon, 11 Jan 2021 at 16:46, mark <mp...@gmail.com> wrote:
>
> > Hello,
> > I have a simple Jetty Integration which worked well mid-last year, but
> > that will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift
> > 4.6. Here's the source code:
> >
> > import org.apache.camel.builder.RouteBuilder;
> >
> > public class Jetty extends RouteBuilder {
> >   @Override
> >   public void configure() throws Exception {
> >
> >     from ("jetty://http://0.0.0.0:8080/hello")
> >       .log("Received a request: ${body}")
> >       .setBody(simple("Hello!"));
> >   }
> > }
> >
> > With v1.2.1 or v1.3,
> >
> > kamel run Jetty.java --dev gives,
> >
> > Caused by: java.lang.RuntimeException:
> > org.apache.camel.FailedToCreateRouteException: Failed to create route
> > route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
> > because of No endpoint could be found for: jetty://
> > http://0.0.0.0:8080/hello, please check your classpath contains the
> > needed Camel component jar.
> >
> > kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev
> >
> > produces errors in the operator pod log:
> >
> > [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> > [ERROR] 'dependencies.dependency.version' for
> > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> >  @
> > [ERROR] The build could not read 1 project -> [Help 1]
> > [ERROR]
> > [ERROR]   The project
> > org.apache.camel.k.integration:camel-k-integration:1.2.1
> > (/tmp/builder-501079428/maven/pom.xml) has 1 error
> > [ERROR]     'dependencies.dependency.version' for
> > org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> > [ERROR]
> > [ERROR] To see the full stack trace of the errors, re-run Maven with the
> > -e switch.
> > [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> > [ERROR]
> > [ERROR] For more information about the errors and possible solutions,
> > please read the following articles:
> > [ERROR] [Help 1]
> >
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> >
> {"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
> > failed with error: failure while building project: exit status
> 1","step":"
> > github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
> > ","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
> >
> {"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
> > [mvn:org.apache.camel.k/camel-k-quarkus-loader-java
> > mvn:org.apache.camel.k/camel-k-runtime-quarkus
> > mvn:org.apache.camel/camel-jetty:3.7.0]"}
> >
> > Please can anyone give me some advice? I really can't find a way to get
> > this simple Integration running, either as Java or Groovy code.
> >
> > Very many thanks in advance!
> >
> > Regards,
> > Mark
> >
>

Re: Jetty/Camel-K classpath problems

Posted by mark <mp...@gmail.com>.
Hello,
I have a simple Jetty Integration which worked well mid-last year, but that
will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift 4.6.
Here's the source code:

import org.apache.camel.builder.RouteBuilder;

public class Jetty extends RouteBuilder {
  @Override
  public void configure() throws Exception {

    from ("jetty://http://0.0.0.0:8080/hello")
      .log("Received a request: ${body}")
      .setBody(simple("Hello!"));
  }
}

With v1.2.1 or v1.3,

kamel run Jetty.java --dev gives,

Caused by: java.lang.RuntimeException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
because of No endpoint could be found for: jetty://http://0.0.0.0:8080/hello,
please check your classpath contains the needed Camel component jar.

kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev

produces errors in the operator pod log:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.version' for
org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project
org.apache.camel.k.integration:camel-k-integration:1.2.1
(/tmp/builder-501079428/maven/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for
org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
{"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
failed with error: failure while building project: exit status 1","step":"
github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
{"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
[mvn:org.apache.camel.k/camel-k-quarkus-loader-java
mvn:org.apache.camel.k/camel-k-runtime-quarkus
mvn:org.apache.camel/camel-jetty:3.7.0]"}

Please can anyone give me some advice? I really can't find a way to get
this simple Integration running, either as Java or Groovy code.

Very many thanks in advance!

Regards,
Mark

On Mon, 11 Jan 2021 at 16:46, mark <mp...@gmail.com> wrote:

> Hello,
> I have a simple Jetty Integration which worked well mid-last year, but
> that will not compile with kamel 1.2.1 or 1.3. I'm running on OpenShift
> 4.6. Here's the source code:
>
> import org.apache.camel.builder.RouteBuilder;
>
> public class Jetty extends RouteBuilder {
>   @Override
>   public void configure() throws Exception {
>
>     from ("jetty://http://0.0.0.0:8080/hello")
>       .log("Received a request: ${body}")
>       .setBody(simple("Hello!"));
>   }
> }
>
> With v1.2.1 or v1.3,
>
> kamel run Jetty.java --dev gives,
>
> Caused by: java.lang.RuntimeException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> route1: Route(route1)[From[jetty://http://0.0.0.0:8080/hello] -> [Lo...
> because of No endpoint could be found for: jetty://
> http://0.0.0.0:8080/hello, please check your classpath contains the
> needed Camel component jar.
>
> kamel run Jetty.java -d mvn:org.apache.camel/camel-jetty:3.7.0 --dev
>
> produces errors in the operator pod log:
>
> [ERROR] [ERROR] Some problems were encountered while processing the POMs:
> [ERROR] 'dependencies.dependency.version' for
> org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
>  @
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR]   The project
> org.apache.camel.k.integration:camel-k-integration:1.2.1
> (/tmp/builder-501079428/maven/pom.xml) has 1 error
> [ERROR]     'dependencies.dependency.version' for
> org.apache.camel:camel-jetty:jar is missing. @ line 39, column 17
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
> {"level":"info","ts":1610383450.3048193,"logger":"camel-k.builder","msg":"step
> failed with error: failure while building project: exit status 1","step":"
> github.com/apache/camel-k/pkg/builder/runtime/BuildQuarkusRunner
> ","phase":20,"name":"kit-bvu80m086h5tvrf96eg0","task":"builder"}
> {"level":"info","ts":1610383450.304877,"logger":"camel-k.builder","msg":"dependencies:
> [mvn:org.apache.camel.k/camel-k-quarkus-loader-java
> mvn:org.apache.camel.k/camel-k-runtime-quarkus
> mvn:org.apache.camel/camel-jetty:3.7.0]"}
>
> Please can anyone give me some advice? I really can't find a way to get
> this simple Integration running, either as Java or Groovy code.
>
> Very many thanks in advance!
>
> Regards,
> Mark
>