[jboss-jira] [JBoss JIRA] (WFLY-12083) Deployment failure if an explicit bean archive contain a Pojo with @NotNull annotation

Matěj Novotný (Jira) issues at jboss.org
Thu May 30 08:54:00 EDT 2019


    [ https://issues.jboss.org/browse/WFLY-12083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740490#comment-13740490 ] 

Matěj Novotný commented on WFLY-12083:
--------------------------------------

bq. So that would look as an application problem - defining non-proxyable bean but requesting a functionality (validation) that requires a proxy?

Yes, that corresponds to my previous comment.

bq. There's already a configuration option in Weld that causes it to print a warning (instead of failing a deployment) when a final method is being intercepted:

You are right, but this exists because in some cases you can have a class that's perfectly proxyable except for one final method that becomes a blocker. Otherwise the proxy is still usable. Also note that this has roots directly in CDI spec in several forms - as a [lifecycle event method|http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#process_bean_attributes] or on an [interception factory|http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#interception_factory].
Here, the story is different. Due to constructor you simply cannot create the proxy *at all*. I would argue that ignoring the class (even with logging) does more harm then actual fail-fast exception for the simple fact that the functionality you tried to apply will be missing altogether.

> Deployment failure if an explicit bean archive contain a Pojo with @NotNull annotation
> --------------------------------------------------------------------------------------
>
>                 Key: WFLY-12083
>                 URL: https://issues.jboss.org/browse/WFLY-12083
>             Project: WildFly
>          Issue Type: Bug
>          Components: Bean Validation
>    Affects Versions: 17.0.0.Alpha1
>            Reporter: Joerg Baesner
>            Assignee: Brian Stansberry
>            Priority: Major
>         Attachments: playground.zip
>
>
> If an exlicit bean archive ({{META-INF}} contains an empty {{beans.xml}}) contain a Pojo without any Bean defining annotations and it has {{@NotNull}} annotations, the deployment of that module fails with:
> {code}
> ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."playground-jar.jar".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."playground-jar.jar".WeldStartService: Failed to start service
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1730)
> 	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
> 	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> 	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
> 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
> 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
> 	at java.lang.Thread.run(Thread.java:748)
> Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001436: Type org.jboss.playground.PlaygroundToStringUtil is not proxyable because it has a private constructor [EnhancedAnnotatedConstructorImpl] private org.jboss.playground.PlaygroundToStringUtil() - class org.jboss.playground.PlaygroundToStringUtil.
> 	at org.jboss.weld.injection.producer.InterceptionModelInitializer.init(InterceptionModelInitializer.java:117)
> 	at org.jboss.weld.injection.producer.BeanInjectionTarget.buildInterceptionModel(BeanInjectionTarget.java:94)
> 	at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeInterceptionModel(BeanInjectionTarget.java:89)
> 	at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeAfterBeanDiscovery(BeanInjectionTarget.java:99)
> 	at org.jboss.weld.injection.producer.InjectionTargetInitializationContext.initialize(InjectionTargetInitializationContext.java:42)
> 	at org.jboss.weld.injection.producer.InjectionTargetService.initialize(InjectionTargetService.java:63)
> 	at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:481)
> 	at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:86)
> 	at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:97)
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
> 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
> 	... 6 more
> {code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the jboss-jira mailing list