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

Dev mode exception returns HTTP 200 reponse #1099

Closed
johnaohara opened this issue Feb 28, 2019 · 0 comments
Closed

Dev mode exception returns HTTP 200 reponse #1099

johnaohara opened this issue Feb 28, 2019 · 0 comments
Labels
kind/bug Something isn't working
Milestone

Comments

@johnaohara
Copy link
Member

If there is an build error in dev mode, the exception is returned in the body of a http response with HTTP 200 status code.

I would have expected a HTTP 500 response code if the request failed due to a build error.

The exception below triggered in release 0.9.1, but am not running into a build error with latest master.

e.g. the following request http://localhost:8080/insurance/rest/authentication/getToken?username=Herb.Daschke_1

Resulted in an exception in the application:

Error Restarting Shamrock
Stack Trace:

java.lang.RuntimeException: org.jboss.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step org.jboss.shamrock.arc.deployment.ArcAnnotationProcessor#build threw an exception: javax.enterprise.inject.UnsatisfiedResolutionException: InjectionPointInfo [requiredType=org.jboss.protean.benchmark.common.broker.IAgentsService, requiredQualifiers=[@RestClient]] on CLASS bean [types=[org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService, java.lang.Object], qualifiers=[@Default, @Any], target=org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService]
	at org.jboss.shamrock.runner.RuntimeRunner.run(RuntimeRunner.java:119)
	at org.jboss.shamrock.dev.DevModeMain.doStart(DevModeMain.java:122)
	at org.jboss.shamrock.dev.DevModeMain.main(DevModeMain.java:83)
Caused by: org.jboss.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step org.jboss.shamrock.arc.deployment.ArcAnnotationProcessor#build threw an exception: javax.enterprise.inject.UnsatisfiedResolutionException: InjectionPointInfo [requiredType=org.jboss.protean.benchmark.common.broker.IAgentsService, requiredQualifiers=[@RestClient]] on CLASS bean [types=[org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService, java.lang.Object], qualifiers=[@Default, @Any], target=org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService]
	at org.jboss.builder.Execution.run(Execution.java:116)
	at org.jboss.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:136)
	at org.jboss.shamrock.deployment.ShamrockAugmentor.run(ShamrockAugmentor.java:101)
	at org.jboss.shamrock.runner.RuntimeRunner.run(RuntimeRunner.java:86)
	... 2 more
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: InjectionPointInfo [requiredType=org.jboss.protean.benchmark.common.broker.IAgentsService, requiredQualifiers=[@RestClient]] on CLASS bean [types=[org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService, java.lang.Object], qualifiers=[@Default, @Any], target=org.jboss.protean.benchmark.insurance.service.InsuranceAgentsService]
	at org.jboss.protean.arc.processor.Beans.resolveInjectionPoint(Beans.java:318)
	at org.jboss.protean.arc.processor.BeanInfo.init(BeanInfo.java:349)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1378)
	at org.jboss.protean.arc.processor.BeanDeployment.init(BeanDeployment.java:281)
	at org.jboss.protean.arc.processor.BeanProcessor.process(BeanProcessor.java:159)
	at org.jboss.shamrock.arc.deployment.ArcAnnotationProcessor.build(ArcAnnotationProcessor.java:237)
	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 org.jboss.shamrock.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:383)
	at org.jboss.builder.BuildContext.run(BuildContext.java:402)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1998)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1525)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1416)
	at java.base/java.lang.Thread.run(Thread.java:844)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

With the following HTTP response header:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/html; charset=UTF-8
Content-Length: 8197
Date: Thu, 28 Feb 2019 09:16:03 GMT
@johnaohara johnaohara added the kind/bug Something isn't working label Feb 28, 2019
@gsmet gsmet closed this as completed in 48cc5a4 Mar 1, 2019
gsmet added a commit that referenced this issue Mar 1, 2019
Fixes #1099, wrong response code if compile fails
@gsmet gsmet added this to the 0.11.0 milestone Mar 2, 2019
maxandersen added a commit to maxandersen/quarkus that referenced this issue Nov 5, 2022
* fix: Improved `main()` method lookup

Before it would just assume that the `main()` method was located
in a class with the same name as the Java source file, but that's
not always the case. For example, when reading from stdin it's
hard to detect the right class and even more so when dealing with
non-public classes (non-public classes can still have `main()`
methods!)

Fixes quarkusio#1099

* chore: fix have tests actually test proper found main

* chore: ensure clean build during ci

* chore: Updated tests after rebase

Co-authored-by: Max Rydahl Andersen <max.andersen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants