You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by GitBox <gi...@apache.org> on 2019/02/14 12:28:29 UTC

[GitHub] kameshsampath opened a new issue #436: Error while deploying integration in Knative based environment

kameshsampath opened a new issue #436: Error while deploying integration in Knative based environment
URL: https://github.com/apache/camel-k/issues/436
 
 
   I am trying to deploy the following integration called `Greeter.java` with content
   
   ```java
   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)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services