You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "squakez (via GitHub)" <gi...@apache.org> on 2024/01/25 10:45:12 UTC

[I] Dynamic execution of js route failing [camel-quarkus]

squakez opened a new issue, #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678

   ### Bug description
   
   I'm trying to run a polyglot application which is composed by multiple routes in multiple languages. I found out that when we run `js` applications, if we provide the classpath list of dependencies, the execution fails with the following error:
   ```
   java -cp target/quarkus-app/lib/main/*:target/quarkus-app/quarkus-run.jar io.quarkus.bootstrap.runner.QuarkusEntryPoint
   ...
   2024-01-25 11:38:57,034 INFO  [org.apa.cam.mai.BaseMainSupport] (main)     [MicroProfilePropertiesSource] camel.main.routesIncludePattern=file:/tmp/test/**
   2024-01-25 11:38:57,035 INFO  [org.apa.cam.mai.BaseMainSupport] (main)     [MicroProfilePropertiesSource] camel.main.sourceLocationEnabled=true
   2024-01-25 11:38:57,261 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (main) Failed to start application: org.graalvm.polyglot.PolyglotException: java.lang.IllegalStateException: Duplicate language id regex. First language [Language class com.oracle.truffle.regex.RegexLanguage, Loaded from file:/home/squake/Desktop/jbang/ceq-java/target/quarkus-app/lib/main/org.graalvm.regex.regex-23.0.1.jar]. Second language [Language class com.oracle.truffle.regex.RegexLanguage, Loaded from file:/home/squake/Desktop/jbang/ceq-java/target/quarkus-app/lib/main/org.graalvm.regex.regex-23.0.1.jar].
   	at com.oracle.truffle.polyglot.LanguageCache.createLanguages(LanguageCache.java:259)
   ...
   ```
   It seems there was a similar issue in Quarkus core: https://github.com/quarkusio/quarkus/pull/27090 - I wonder if we need to do something in Camel Quarkus as well to incorporate that change.
   
   Mind that the same would work flawlessly if run via:
   
   ```
   java -jar target/quarkus-app/quarkus-run.jar
   ```
   However I need to specify the list of dependencies in order to make it works Java applications which it seems to be required by joor.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1943927216

   Quarkus fix is present in 3.8.0.CR1 (and also 3.7.3 when it gets released).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1912161546

   FYI, the workaround is working.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1909942000

   > When I added the initial fast-jar support in camel-k, I couldn't figure out how to make joor work without manually adding everything to the classpath. It'd be so much simpler if you could just execute the runnable JAR as per normal.
   
   Yeah, I was trying to revert that but I was unsuccessful as well. It would be much cleaner, of course. In any case I manage to make it work with `-cp target/quarkus-app/lib/main/*` style which would be a first progress. However, now the problem is on the js DSL. I'm going to see if the workaround is good and report here. Thanks @jamesnetherton 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1919206476

   Assuming my [change](https://github.com/quarkusio/quarkus/pull/38495) gets backported, this should get fixed permanently in 3.8.x. Otherwise it'll be in 3.9.x.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton closed issue #5678: Dynamic execution of js route failing
URL: https://github.com/apache/camel-quarkus/issues/5678


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "lburgazzoli (via GitHub)" <gi...@apache.org>.
lburgazzoli commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1909941403

   > When I added the initial `fast-jar` support in camel-k, I couldn't figure out how to make joor work without manually adding everything to the classpath. It'd be so much simpler if you could just execute the runnable JAR as per normal.
   
   I think relying on the fast-jar would be the right think imho, we can tune the camel-k image discovery to require a 100% compatible one and re-visit image layering 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1909927206

   `org.graalvm.regex:regex` probably needs to be configured as a `runnerParentFirstArtifact`.
   
   > seems to be required by joor
   
   Maybe that's something that needs digging into a bit deeper.
   
   When I added the initial `fast-jar` support in camel-k, I couldn't figure out how to make joor work without manually adding everything to the classpath. It'd be so much simpler if you could just execute the runnable JAR as per normal.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1909933120

   You might be able to work around it if you set a build time property like:
   
   ```
   quarkus.class-loading.parent-first-artifacts=org.graalvm.regex:regex
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic execution of js route failing [camel-quarkus]

Posted by "squakez (via GitHub)" <gi...@apache.org>.
squakez commented on issue #5678:
URL: https://github.com/apache/camel-quarkus/issues/5678#issuecomment-1919305160

   > Assuming my [change](https://github.com/quarkusio/quarkus/pull/38495) gets backported, this should get fixed permanently in 3.8.x. Otherwise it'll be in 3.9.x.
   
   Great, thanks a lot @jamesnetherton 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org