camel-idea-plugin icon indicating copy to clipboard operation
camel-idea-plugin copied to clipboard

Camel IDEA plugin cannot download the Camel Catalog

Open kobmik opened this issue 3 years ago • 5 comments

I get the following error in my Camel 3.7.3 projects.

Camel IDEA plugin cannot download the Camel catalog for the Karaf Runtime with version 3.7.3. Will fallback and use the Camel catalog version 3.18.2

Any idea why this happens? camel-catalog 3.7.3 is available in my local Maven repository.

kobmik avatar Oct 05 '22 06:10 kobmik

Could you please provide a simple project to reproduce? Or anything that could help to reproduce?

essobedo avatar Oct 05 '22 07:10 essobedo

There is a camel-karaf catalog as well in its own JAR, that is what is attempted to be downloaded https://search.maven.org/artifact/org.apache.camel.karaf/catalog

davsclaus avatar Oct 09 '22 08:10 davsclaus

The camel-karaf catalog does exist in my local repository. In the file idea.log I get the following warning:

2022-10-09 13:30:15,062 [5374216] WARN - #c.g.c.i.s.CamelMavenVersionManager - Could not load the catalog version 3.7.3: Error grabbing Grapes -- [unresolved dependency: org.apache.camel#camel-catalog;3.7.3: not found]

camel-catalog jar is also available in my m2 folder.

kobmik avatar Oct 09 '22 11:10 kobmik

camel 3.7 is an old version, can you try using a new camel version

davsclaus avatar Oct 09 '22 12:10 davsclaus

Same problem with a more recent version:

2022-10-09 15:20:02,842 [11961996] FINE - #c.g.c.i.s.CamelMavenVersionManager - java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.apache.camel#camel-catalog;3.14.5: not found] at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:455) at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:625) at groovy.grape.GrapeIvy.resolve(GrapeIvy.groovy:592) at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:256) at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:236) at groovy.grape.Grape.grab(Grape.java:153) at com.github.cameltooling.idea.service.CamelMavenVersionManager.loadVersion(CamelMavenVersionManager.java:74) at com.github.cameltooling.idea.service.CamelCatalogService.loadVersion(CamelCatalogService.java:116) at com.github.cameltooling.idea.service.CamelService.downloadNewCamelCatalogVersion(CamelService.java:556) at com.github.cameltooling.idea.service.CamelService$1.run(CamelService.java:465) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833)

kobmik avatar Oct 09 '22 13:10 kobmik

Do you have a custom configuration of Grape? In other words, do you have a file located at ~/.groovy/grapeConfig.xml?

essobedo avatar Nov 10 '22 11:11 essobedo

Could you please add the next system properties into the file idea.vmoptions (see https://www.jetbrains.com/help/idea/tuning-the-ide.html#configure-jvm-options to know where it is located according to your OS)

-Dgroovy.grape.report.downloads=true
-Divy.message.logger.level=4

Then relaunch your project and give us the log

essobedo avatar Nov 10 '22 13:11 essobedo

Thanks for the tip with grapeConfig.xml. I was able to solve the issue by adding the repos to the XML and selecting the runtime provider "Auto detect". However, when I select the Camel Runtime Provider "Karaf" in the settings, I still get the error message "Camel IDEA plugin cannot download the Camel catalog for the Karaf Runtime with version 3.7.3. Will fallback and use the Camel catalog version 3.19.0".

2022-11-10 18:32:23,157 [ 240784] FINE - #c.g.c.i.s.CamelMavenVersionManager - Trying to find the resource org/apache/camel/catalog/karaf/components.properties from the catalog 2022-11-10 18:32:23,164 [ 240791] FINE - #c.g.c.i.s.CamelMavenVersionManager - The resource org/apache/camel/catalog/karaf/components.properties could not be found in the catalog

Do you know what is causing this error? It looks like "camel-catalog-provider-karaf" won't be downloaded even if it's available in the repo.

kobmik avatar Nov 10 '22 18:11 kobmik

Those log entries are not relevant to spot the problem, could you please do what I described in my previous comment?

essobedo avatar Nov 10 '22 18:11 essobedo

idea.log

kobmik avatar Nov 10 '22 19:11 kobmik

Thx for the log, I see that it is on a Windows OS, it is not well tested on it. I planned to work on that next week

essobedo avatar Nov 10 '22 19:11 essobedo

I could not reproduce your problem while working on other problems that are Windows related. Could you propose a simple project to reproduce?

essobedo avatar Nov 16 '22 14:11 essobedo

Or if a project among the examples works on your side, like this one https://github.com/apache/camel-examples/tree/main/examples/main

essobedo avatar Nov 17 '22 09:11 essobedo

Yes, same problem with with your linked project (version 3.7.0) as soon as I switch the runtime provider in the plugin settings to "Karaf".

Error: "Camel IDEA plugin cannot download the Camel catalog for the Karaf Runtime with version 3.7.0. Will fallback and use the Camel catalog version 3.19.0"

kobmik avatar Nov 17 '22 17:11 kobmik

Interesting, thx for the feedback. Do you get the error with any other runtime or it is only with Karaf? And do you get this error with a more recent version of Camel?

essobedo avatar Nov 17 '22 17:11 essobedo

Same for Quarkus and Spring Boot. Only Default and Auto detect (Default) seems to work.

kobmik avatar Nov 17 '22 17:11 kobmik

And what about the version? What happens if you use Camel 3.18?

essobedo avatar Nov 17 '22 17:11 essobedo

Same problem. With version 3.18 even the Default runtime can't be downloaded.

kobmik avatar Nov 17 '22 18:11 kobmik

I can reproduce thx

essobedo avatar Nov 17 '22 18:11 essobedo

If you force a runtime and the corresponding core artifacts are not part of the dependencies of the project, the catalog is not downloaded which needs to be more flexible. I created a ticket for that https://github.com/camel-tooling/camel-idea-plugin/issues/769

essobedo avatar Nov 17 '22 18:11 essobedo

What I mean is the fact that we are potentially mixing 2 problems here. With the example "main" because of the issue described previously only the "Default" runtime can work so what you described in this comment is expected with the current code. What is not normal is the fact that with 3.18, the "Default" runtime doesn't work on your side. Unfortunately, I cannot reproduce this behavior so it will be hard for me to fix it.

essobedo avatar Nov 17 '22 19:11 essobedo

After a restart of IDEA, the download now seems to work for the "Default" runtime with Camel 3.18.0. No idea what caused the problem before. Sorry for the circumstances.

kobmik avatar Nov 17 '22 19:11 kobmik

While working on https://github.com/camel-tooling/camel-idea-plugin/pull/771, I met a problem with localm2, as workaround I simply removed it from the grapeConfig.xml

essobedo avatar Nov 18 '22 16:11 essobedo

Okay there is a new 0.9.0 release out as well. As we cannot reproduce this, then lets close it, and you can reopen if we can see this again, or create a new ticket.

davsclaus avatar Nov 21 '22 19:11 davsclaus