Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1059

Specifying an invalid configuration value for an enum should display the allowed values

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Trivial
    • Resolution: Done
    • Affects Version/s: 2017.2.0
    • Fix Version/s: 2017.3.3
    • Component/s: core
    • Labels:
      None

      Description

      If an invalid value is provided for an enum configuration key, (eg. -Dswarm.undertow.servlet-containers.default.stack-trace-on-error=true) the following error is thrown:

      java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No enum constant org.wildfly.swarm.config.undertow.ServletContainer.StackTraceOnError.TRUE
      	at org.wildfly.swarm.container.runtime.cdi.FractionProducingExtension.afterBeanDiscovery(FractionProducingExtension.java:80)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
      	at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:340)
      	at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:122)
      	at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:318)
      	at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:296)
      	at org.jboss.weld.util.Observers.notify(Observers.java:140)
      	at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:300)
      	at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:288)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:165)
      	at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:159)
      	at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
      	at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:44)
      	at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:74)
      	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:419)
      	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
      	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:654)
      	at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$0(ServerBootstrapImpl.java:132)
      	at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:60)
      	at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:109)
      	at org.wildfly.swarm.Swarm.start(Swarm.java:334)
      	at org.obsidiantoaster.generator.Main.main(Main.java:42)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:39)
      	at org.wildfly.swarm.bootstrap.Main.run(Main.java:44)
      	at org.wildfly.swarm.bootstrap.Main.main(Main.java:35)
      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No enum constant org.wildfly.swarm.config.undertow.ServletContainer.StackTraceOnError.TRUE
      	at org.wildfly.swarm.spi.api.config.Builder.getValue(Builder.java:45)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.configure(ConfigurableManager.java:118)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scan(ConfigurableManager.java:286)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scan(ConfigurableManager.java:263)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scanSubresources(ConfigurableManager.java:388)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scan(ConfigurableManager.java:265)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scanFraction(ConfigurableManager.java:203)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scanInternal(ConfigurableManager.java:194)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.scan(ConfigurableManager.java:189)
      	at org.wildfly.swarm.container.runtime.cdi.configurable.ConfigurableFractionBean.<init>(ConfigurableFractionBean.java:28)
      	at org.wildfly.swarm.container.runtime.cdi.FractionProducingExtension.afterBeanDiscovery(FractionProducingExtension.java:78)
      	... 33 more
      Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: No enum constant org.wildfly.swarm.config.undertow.ServletContainer.StackTraceOnError.TRUE
      	at org.wildfly.swarm.spi.api.config.Builder.convert(Builder.java:80)
      	at org.wildfly.swarm.spi.api.config.Builder.getValue(Builder.java:39)
      	... 43 more
      Caused by: java.lang.IllegalArgumentException: No enum constant org.wildfly.swarm.config.undertow.ServletContainer.StackTraceOnError.TRUE
      	at java.lang.Enum.valueOf(Enum.java:238)
      	at org.wildfly.swarm.container.runtime.ConfigurableManager.lambda$converter$0(ConfigurableManager.java:132)
      	at org.wildfly.swarm.spi.api.config.Builder.convert(Builder.java:78)
      	... 44 more
      
      	at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:46)
      	at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:74)
      	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:419)
      	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
      	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:654)
      	at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$0(ServerBootstrapImpl.java:132)
      	at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:60)
      	at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:109)
      	at org.wildfly.swarm.Swarm.start(Swarm.java:334)
      	at org.obsidiantoaster.generator.Main.main(Main.java:42)
      	... 7 more
      

      It would be nice if the error message contained the allowed enum values to be used.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bob.mcwhirter Bob McWhirter
                Reporter:
                gastaldi George Gastaldi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: