1
Exception in thread "main" org.apache.camel.FailedToCreateRouteException: Failed to create route logging-route: Route(logging-route)[From[direct:LogPoint] -> [Log[${body}],... because of Failed to resolve endpoint: direct://LogPoint due to: Value false converted to boolean cannot be null

I only get this error when running my project from an executable jar as opposed to the ide. Function Failing In:

logContext = new DefaultCamelContext();

        try{
            logContext.addRoutes(new RouteBuilder() {
                @Override
                public void configure() throws Exception {
                    from("direct:LogPoint")
                                    .routeId("logging-route")
                                    .log("${body}")
                                    .to("stream:out");
                }

            });

        }catch (Exception e){
            System.out.println("Failed createLoggingContext()");
            System.out.println(e.getStackTrace().toString());
        }
        return logContext;
Jocke
  • 2,189
  • 1
  • 16
  • 24
Ben
  • 117
  • 11
  • sounds like you are missing references – Jocke Mar 03 '20 at 17:22
  • What reference would I be missing and how come it runs fine from intellij then? – Ben Mar 03 '20 at 17:34
  • It this a Gradle, Maven or Ant project? If so, or if there are any dependencies manually added to your project, you have to consider that when executing your jar by adding them to the classpath. –  Mar 03 '20 at 17:58
  • it is a gradle project and the jar is a FatJar with everything in it – Ben Mar 03 '20 at 18:11
  • You have missing META-INF entries for type converters, you need to tune your build plugin a bit. See https://stackoverflow.com/questions/59935008/why-does-the-camel-to-route-fail/59938476#59938476 and https://camel.apache.org/manual/latest/faq/how-to-create-executable-jar-camel-main.html and https://camel.apache.org/manual/latest/faq/how-do-i-use-a-big-uber-jar.html – Bedla Mar 03 '20 at 21:36
  • I dont use gradle, but looks like you want something like this to merge META-INF entries https://stackoverflow.com/questions/44595145/how-to-create-fat-jar-which-does-not-overwrite-entries-under-meta-inf-services – Bedla Mar 03 '20 at 21:52

0 Answers0