[jboss-jira] [JBoss JIRA] (WFWIP-66) smallrye-config: Unable to deploy component using automatic converter on injected properties
Michal Jurc (JIRA)
issues at jboss.org
Thu Jul 19 06:52:00 EDT 2018
Michal Jurc created WFWIP-66:
--------------------------------
Summary: smallrye-config: Unable to deploy component using automatic converter on injected properties
Key: WFWIP-66
URL: https://issues.jboss.org/browse/WFWIP-66
Project: WildFly WIP
Issue Type: Bug
Components: MP Config
Reporter: Michal Jurc
Assignee: Jeff Mesnil
Priority: Blocker
MicroProfile Configuration specification states the following:
{quote}Automatic Converters
If no built-in nor custom Converter for a requested Type T, an implicit Converter is automatically
provided if the following conditions are met:
• The target type {@code T} has a {@code public static T of(String)} method, or
• The target type {@code T} has a {@code public static T valueOf(String)} method, or
• The target type {@code T} has a public Constructor with a String parameter, or
• The target type {@code T} has a {@code public static T parse(CharSequence)} method{quote}
Consider deploying an application with the following injected property:
{code} @Inject
@ConfigProperty(name = "convertedOne", defaultValue = "2007-12-03T10:15:30")
LocalDateTime localDateTimeProperty;{code}
Deployment of such application fails with the following:
{code:title=jboss-cli}[standalone at localhost:9990 /] deploy ~/testing/mock-artifacts/smallrye-config-playground/ejb-smallrye-config/server/target/server.jar
{"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"server.jar\".CdiValidatorFacto
ryService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getReference() is not available during application initialization. Container state: DEPLOYED"}}}}
{code}
{code:title=server.log}12:46:19,263 ERROR [stderr] (MSC service thread 1-5) org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LocalDateTime with qualifiers @ConfigProperty
12:46:19,263 ERROR [stderr] (MSC service thread 1-5) at injection point [BackedAnnotatedField] @Inject @ConfigProperty ejb.HelloBean.localDateTimeProperty
12:46:19,263 ERROR [stderr] (MSC service thread 1-5) at ejb.HelloBean.localDateTimeProperty(HelloBean.java:0)
12:46:19,263 ERROR [stderr] (MSC service thread 1-5)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
12:46:19,264 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at java.util.concurrent.FutureTask.run(FutureTask.java:266)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at java.lang.Thread.run(Thread.java:748)
12:46:19,265 ERROR [stderr] (MSC service thread 1-5) at org.jboss.threads.JBossThread.run(JBossThread.java:485)
12:46:19,270 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."server.jar".CdiValidatorFactoryService: org.jboss.msc.service.StartException in service jboss.deployment.unit."server.jar".CdiValidatorFactoryService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1728)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getReference() is not available during application initialization. Container state: DEPLOYED
at org.jboss.weld.bean.builtin.BeanManagerProxy.checkContainerState(BeanManagerProxy.java:234)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:85)
at org.jboss.as.weld.CdiValidatorFactoryService.getReference(CdiValidatorFactoryService.java:122)
at org.jboss.as.weld.CdiValidatorFactoryService.start(CdiValidatorFactoryService.java:83)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
... 6 more
12:46:19,288 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ({"deployment" => "server.jar"}) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"server.jar\".CdiValidatorFactoryService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getReference() is not available during application initialization. Container state: DEPLOYED"}}
12:46:19,289 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "server.jar" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"server.jar\".CdiValidatorFactoryService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001332: BeanManager method getReference() is not available during application initialization. Container state: DEPLOYED"}}
{code}
This failure is not produced if the automatically converted property is optional.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list