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

Error while deploying integration in Knative based environment #436

Closed
kameshsampath opened this issue Feb 14, 2019 · 1 comment
Closed
Assignees

Comments

@kameshsampath
Copy link
Contributor

I am trying to deploy the following integration called Greeter.java with content

import org.apache.camel.builder.RouteBuilder;

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

        restConfiguration().component("undertow").port(8080);

        rest()
                .post("/greeter")
                .route()
                .log("${body}");

    }
}

When i deploy the service using the command kamel run --name=greeter Greeter.java or kamel run Greeter.java it throws an error

Exception in thread "main" org.joor.ReflectException: Compilation error: /CAMEL_K_ROUTE_000.java:4: error: class Greeter is public, should be declared in a file named Greeter.java
public class Greeter extends RouteBuilder {
       ^
1 error

    at org.joor.Compile.compile(Compile.java:97)
    at org.joor.Reflect.compile(Reflect.java:102)
    at org.joor.Reflect.compile(Reflect.java:77)
    at org.apache.camel.k.jvm.loader.JavaSourceLoader$1.configure(JavaSourceLoader.java:39)
    at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:463)
    at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:403)
    at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:384)
    at org.apache.camel.impl.DefaultCamelContext$3.call(DefaultCamelContext.java:1024)
    at org.apache.camel.impl.DefaultCamelContext$3.call(DefaultCamelContext.java:1021)
    at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
    at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:1021)
    at org.apache.camel.main.MainSupport.postProcessCamelContext(MainSupport.java:612)
    at org.apache.camel.main.MainSupport.postProcessContext(MainSupport.java:550)
    at org.apache.camel.k.jvm.Runtime.doStart(Runtime.java:107)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:170)
    at org.apache.camel.k.jvm.Application.main(Application.java:73)
@lburgazzoli lburgazzoli self-assigned this Feb 15, 2019
@lburgazzoli
Copy link
Contributor

@kameshsampath can you post the content of the knative service created by the integration ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants