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

1.1.0 Main fails to start in IntelliJ #1800

Closed
ennishol opened this issue Sep 16, 2020 · 1 comment · Fixed by #1808
Closed

1.1.0 Main fails to start in IntelliJ #1800

ennishol opened this issue Sep 16, 2020 · 1 comment · Fixed by #1808
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ennishol
Copy link

ennishol commented Sep 16, 2020

camel-quarkus-examples-timer-log-main fails to start in Intelij:

Caused by: java.lang.IllegalArgumentException: The supplied 'main-class' value of 'org.apache.camel.quarkus.main.CamelMainApplication' does not correspond to either a fully qualified class name or a matching 'name' field of one of the '@QuarkusMain' annotations

Stacktrace:

at io.quarkus.builder.Execution.run(Execution.java:116)
at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:149)
at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:250)
... 18 more
Caused by: java.lang.IllegalArgumentException: The supplied
'main-class' value of
'org.apache.camel.quarkus.main.CamelMainApplication' does not
correspond to either a fully qualified class name or a matching 'name'
field of one of the '@QuarkusMain' annotations
at io.quarkus.deployment.steps.MainClassBuildStep.mainClassBuildStep(MainClassBuildStep.java:400)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:936)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:832)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

2020-09-16 16:35:45,823 INFO  [io.qua.dep.dev.IsolatedDevModeMain]
(main) Attempting to start hot replacement endpoint to recover from
previous Quarkus startup failure
@jamesnetherton jamesnetherton changed the title 1.1.0 Main fails to start 1.1.0 Main fails to start in IntelliJ Sep 16, 2020
@jamesnetherton
Copy link
Contributor

I think the problem is here.

No implementors of QuarkusApplication are found, so Quarkus does not know which main class to run. I think we can fix it by adding a new BuildStep to the main extension, so that CamelMainApplication is indexed. E.g:

AdditionalIndexedClassesBuildItem(CamelMainApplication.class.getName())

Until then, the workaround is to manually index camel-quarkus-main by setting properties in application.properties:

quarkus.index-dependency.camel-quarkus-main.group-id=org.apache.camel.quarkus
quarkus.index-dependency.camel-quarkus-main.artifact-id=camel-quarkus-main

Or you can tweak the QuarkusMain annotation to:

@QuarkusMain(name = "org.apache.camel.quarkus.main.CamelMainApplication")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants