[GitHub] [camel-k] ogomezdi edited a comment on issue #814: Can camel-k accept camel context definition?

2020-07-31 Thread GitBox


ogomezdi edited a comment on issue #814:
URL: https://github.com/apache/camel-k/issues/814#issuecomment-666288645


   Notice that also in the examples came-k folder there is an [example 
](https://github.com/apache/camel-k/blob/master/examples/polyglot/JavaRoute.java)
 of using @BindToRegistry in conjunction of using multiple files for deploying 
one integration.
   
   I want also to mention I wan't able to use "packages" for language "java" 
that will be helpful to have better organization of code supporting logical 
needed for each integration. I mean, what I'm trying to do is separe the logic 
from the route itself, so I've created two different java files, one containing 
only the route, and other implementing the utils (for example), the first one I 
want to place it in a "package org.something.integrations.route" and the other 
in a "package org.something.integrations.utils" if I did it in this way and 
execute this command:
   `kamel run ExampleRoute.java ExampleUtils.java --dev`
   I got this error:
   `[1] Monitoring pod example-route-57664f98f9-6pkkw
   [1] exec java -cp 
./resources:/etc/camel/resources:/etc/camel/sources/i-source-000:/etc/camel/sources/i-source-001:dependencies/org.apache.camel.camel-api-3.4.0.jar:dependencies/org.apache.camel.camel-base-3.4.0.jar:dependencies/org.apache.camel.camel-bean-3.4.0.jar:dependencies/org.apache.camel.camel-core-engine-3.4.0.jar:dependencies/org.apache.camel.camel-core-languages-3.4.0.jar:dependencies/org.apache.camel.camel-endpointdsl-3.4.0.jar:dependencies/org.apache.camel.camel-log-3.4.0.jar:dependencies/org.apache.camel.camel-main-3.4.0.jar:dependencies/org.apache.camel.camel-management-api-3.4.0.jar:dependencies/org.apache.camel.camel-support-3.4.0.jar:dependencies/org.apache.camel.camel-timer-3.4.0.jar:dependencies/org.apache.camel.camel-util-3.4.0.jar:dependencies/org.apache.camel.k.camel-k-loader-java-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-core-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-main-1.4.1.jar:dependencies/org.apache.logging.log4j.log4j-
 
api-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-core-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-slf4j-impl-2.13.3.jar:dependencies/org.jooq.joor-0.9.13.jar:dependencies/org.slf4j.slf4j-api-1.7.30.jar
 org.apache.camel.k.main.Application
   Condition "Ready" is "True" for Integration example-route
   [1] 2020-07-30 11:36:22.187 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.ContextConfigurer@503ecb24
   [1] 2020-07-30 11:36:22.192 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.RoutesConfigurer@5d12a356
   [1] 2020-07-30 11:36:22.195 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2
   [1] 2020-07-30 11:36:22.216 INFO  [main] ApplicationRuntime - Listener 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2 executed in phase 
ConfigureProperties
   [1] 2020-07-30 11:36:22.233 INFO  [main] RuntimeSupport - Looking up loader 
for language: java
   [1] 2020-07-30 11:36:22.237 INFO  [main] RuntimeSupport - Found loader 
org.apache.camel.k.loader.java.JavaSourceLoader@35f26e72 for language java from 
service definition
   [1] Exception in thread "main" org.apache.camel.RuntimeCamelException: 
org.joor.ReflectException: Compilation error: 
/org/something/integrations/route/ExampleRoute.java:6: error: package 
org.something.integrations.utils does not exist
   [1] import org.something.integrations.utils.ExampleUtils;
   [1]^
   [1] 1 error
   [1] 
   [1] at 
org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:52)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:102)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:63)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.accept(RoutesConfigurer.java:53)
   [1] at 
org.apache.camel.k.listener.AbstractPhaseListener.accept(AbstractPhaseListener.java:32)
   [1] at 
org.apache.camel.k.main.ApplicationRuntime$MainListenerAdapter.lambda$invokeListeners$0(ApplicationRuntime.java:178)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
   [1] at 
java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
   [1] at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
   [1] at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
   [1] at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   [1] at 

[GitHub] [camel-k] ogomezdi edited a comment on issue #814: Can camel-k accept camel context definition?

2020-07-31 Thread GitBox


ogomezdi edited a comment on issue #814:
URL: https://github.com/apache/camel-k/issues/814#issuecomment-666288645


   Notice that also in the examples came-k folder there is an [example 
](https://github.com/apache/camel-k/blob/master/examples/polyglot/JavaRoute.java)
 of using @BindToRegistry in conjunction of using multiple files for deploying 
one integration.
   
   I want also to mention I wan't able to use "packages" for language "java" 
that will be helpful to have better organization of code supporting logical 
needed for each integration. I mean, what I'm trying to do is separe the logic 
from the route itself, so I've created two different java files, one containing 
only the route, and other implementing the utils (for example), the first one I 
want to place it in a "package org.something.integrations.route" and the other 
in a "package org.something.integrations.utils" if I did it in this way and 
execute this command:
   `kamel run ExampleRoute.java ExampleUtils.java --dev`
   I got this error:
   `[1] Monitoring pod example-route-57664f98f9-6pkkw
   [1] exec java -cp 
./resources:/etc/camel/resources:/etc/camel/sources/i-source-000:/etc/camel/sources/i-source-001:dependencies/org.apache.camel.camel-api-3.4.0.jar:dependencies/org.apache.camel.camel-base-3.4.0.jar:dependencies/org.apache.camel.camel-bean-3.4.0.jar:dependencies/org.apache.camel.camel-core-engine-3.4.0.jar:dependencies/org.apache.camel.camel-core-languages-3.4.0.jar:dependencies/org.apache.camel.camel-endpointdsl-3.4.0.jar:dependencies/org.apache.camel.camel-log-3.4.0.jar:dependencies/org.apache.camel.camel-main-3.4.0.jar:dependencies/org.apache.camel.camel-management-api-3.4.0.jar:dependencies/org.apache.camel.camel-support-3.4.0.jar:dependencies/org.apache.camel.camel-timer-3.4.0.jar:dependencies/org.apache.camel.camel-util-3.4.0.jar:dependencies/org.apache.camel.k.camel-k-loader-java-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-core-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-main-1.4.1.jar:dependencies/org.apache.logging.log4j.log4j-
 
api-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-core-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-slf4j-impl-2.13.3.jar:dependencies/org.jooq.joor-0.9.13.jar:dependencies/org.slf4j.slf4j-api-1.7.30.jar
 org.apache.camel.k.main.Application
   Condition "Ready" is "True" for Integration example-route
   [1] 2020-07-30 11:36:22.187 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.ContextConfigurer@503ecb24
   [1] 2020-07-30 11:36:22.192 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.RoutesConfigurer@5d12a356
   [1] 2020-07-30 11:36:22.195 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2
   [1] 2020-07-30 11:36:22.216 INFO  [main] ApplicationRuntime - Listener 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2 executed in phase 
ConfigureProperties
   [1] 2020-07-30 11:36:22.233 INFO  [main] RuntimeSupport - Looking up loader 
for language: java
   [1] 2020-07-30 11:36:22.237 INFO  [main] RuntimeSupport - Found loader 
org.apache.camel.k.loader.java.JavaSourceLoader@35f26e72 for language java from 
service definition
   [1] Exception in thread "main" org.apache.camel.RuntimeCamelException: 
org.joor.ReflectException: Compilation error: 
/org/something/integrations/route/ExampleRoute.java:6: error: package 
org.something.integrations.utils does not exist
   [1] import org.something.integrations.utils.ExampleUtils;
   [1]^
   [1] 1 error
   [1] 
   [1] at 
org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:52)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:102)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:63)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.accept(RoutesConfigurer.java:53)
   [1] at 
org.apache.camel.k.listener.AbstractPhaseListener.accept(AbstractPhaseListener.java:32)
   [1] at 
org.apache.camel.k.main.ApplicationRuntime$MainListenerAdapter.lambda$invokeListeners$0(ApplicationRuntime.java:178)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
   [1] at 
java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
   [1] at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
   [1] at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
   [1] at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   [1] at 

[GitHub] [camel-k] ogomezdi edited a comment on issue #814: Can camel-k accept camel context definition?

2020-07-30 Thread GitBox


ogomezdi edited a comment on issue #814:
URL: https://github.com/apache/camel-k/issues/814#issuecomment-666288645


   Notice that also in the examples came-k folder there is an [example 
](https://github.com/apache/camel-k/blob/master/examples/polyglot/JavaRoute.java)
 of using @BindToRegistry in conjunction of using multiple files for deploying 
one integration.
   
   I want also to mention I wan't able to use "packages" for language "java" 
that will be helpful to have better organization of code supporting logical 
needed for each integration. I mean, what I'm trying to do is separe the logic 
from the route itself, so I've created two different java files, one containing 
only the route, and other implementing the utils (for example), the first one I 
want to place it in a "package org.something.integrations.route" and the other 
in a "package org.something.integrations.utils" if I did it in this way and 
execute this command:
   `kamel run ExampleRoute.java ExampleUtils.java --dev`
   I got this error:
   `[1] Monitoring pod example-route-57664f98f9-6pkkw
   [1] exec java -cp 
./resources:/etc/camel/resources:/etc/camel/sources/i-source-000:/etc/camel/sources/i-source-001:dependencies/org.apache.camel.camel-api-3.4.0.jar:dependencies/org.apache.camel.camel-base-3.4.0.jar:dependencies/org.apache.camel.camel-bean-3.4.0.jar:dependencies/org.apache.camel.camel-core-engine-3.4.0.jar:dependencies/org.apache.camel.camel-core-languages-3.4.0.jar:dependencies/org.apache.camel.camel-endpointdsl-3.4.0.jar:dependencies/org.apache.camel.camel-log-3.4.0.jar:dependencies/org.apache.camel.camel-main-3.4.0.jar:dependencies/org.apache.camel.camel-management-api-3.4.0.jar:dependencies/org.apache.camel.camel-support-3.4.0.jar:dependencies/org.apache.camel.camel-timer-3.4.0.jar:dependencies/org.apache.camel.camel-util-3.4.0.jar:dependencies/org.apache.camel.k.camel-k-loader-java-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-core-1.4.1.jar:dependencies/org.apache.camel.k.camel-k-runtime-main-1.4.1.jar:dependencies/org.apache.logging.log4j.log4j-
 
api-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-core-2.13.3.jar:dependencies/org.apache.logging.log4j.log4j-slf4j-impl-2.13.3.jar:dependencies/org.jooq.joor-0.9.13.jar:dependencies/org.slf4j.slf4j-api-1.7.30.jar
 org.apache.camel.k.main.Application
   Condition "Ready" is "True" for Integration example-route
   [1] 2020-07-30 11:36:22.187 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.ContextConfigurer@503ecb24
   [1] 2020-07-30 11:36:22.192 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.RoutesConfigurer@5d12a356
   [1] 2020-07-30 11:36:22.195 INFO  [main] ApplicationRuntime - Add listener: 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2
   [1] 2020-07-30 11:36:22.216 INFO  [main] ApplicationRuntime - Listener 
org.apache.camel.k.listener.PropertiesConfigurer@4fad9bb2 executed in phase 
ConfigureProperties
   [1] 2020-07-30 11:36:22.233 INFO  [main] RuntimeSupport - Looking up loader 
for language: java
   [1] 2020-07-30 11:36:22.237 INFO  [main] RuntimeSupport - Found loader 
org.apache.camel.k.loader.java.JavaSourceLoader@35f26e72 for language java from 
service definition
   [1] Exception in thread "main" org.apache.camel.RuntimeCamelException: 
org.joor.ReflectException: Compilation error: 
/org/something/integrations/route/ExampleRoute.java:6: error: package 
org.something.integrations.utils does not exist
   [1] import org.something.integrations.utils.ExampleUtils;
   [1]^
   [1] 1 error
   [1] 
   [1] at 
org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:52)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:102)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.load(RoutesConfigurer.java:63)
   [1] at 
org.apache.camel.k.listener.RoutesConfigurer.accept(RoutesConfigurer.java:53)
   [1] at 
org.apache.camel.k.listener.AbstractPhaseListener.accept(AbstractPhaseListener.java:32)
   [1] at 
org.apache.camel.k.main.ApplicationRuntime$MainListenerAdapter.lambda$invokeListeners$0(ApplicationRuntime.java:178)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
   [1] at 
java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
   [1] at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
   [1] at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
   [1] at 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
   [1] at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   [1] at