Skip to content

Dev mode exception returns HTTP 200 reponse #1099

@johnaohara

Description

@johnaohara

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions