[
https://issues.apache.org/jira/browse/OWB-864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13667409#comment-13667409
]
Reinis Vicups commented on OWB-864:
---
Before closing this - Romain are you absolutely positive about this?
I am not arguing about your knowledge or understanding of CDI spec, it just
appears to me (subjectively) that this is inconsistent, because
- specializing abstract classes is the fundamental pattern in OO-programming,
why was it excluded from CDI spec?
- abstract producers are supported, so why is not specializing abstract beans
supported?
br
Reinis
@Specializes is not working if extended class is abstract
-
Key: OWB-864
URL: https://issues.apache.org/jira/browse/OWB-864
Project: OpenWebBeans
Issue Type: Bug
Components: Inheritance, Specialization
Affects Versions: 1.2.1
Reporter: Reinis Vicups
Attachments: specializes.zip
When @Specializes an abstract class, specialization fails mit following
exception:
org.apache.webbeans.exception.WebBeansDeploymentException:
org.apache.webbeans.exception.inject.InconsistentSpecializationException:
WebBean component class : de.orbitx.specializes.ConcreteFooProducer is not
enabled for specialized by the class
de.orbitx.specializes.ConcreteFooProducer class
at
org.apache.webbeans.config.BeansDeployer.checkSpecializations(BeansDeployer.java:709)
at
org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:188)
at
org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:182)
at
org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:158)
at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:798)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:608)
at
org.apache.openejb.testing.ApplicationComposers.before(ApplicationComposers.java:580)
at
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:664)
at
org.apache.openejb.junit.ApplicationComposer$DeployApplication.evaluate(ApplicationComposer.java:64)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by:
org.apache.webbeans.exception.inject.InconsistentSpecializationException:
WebBean component class : de.orbitx.specializes.ConcreteFooProducer is not
enabled for specialized by the class
de.orbitx.specializes.ConcreteFooProducer class
at
org.apache.webbeans.util.WebBeansUtil.configureSpecializations(WebBeansUtil.java:784)
at
org.apache.webbeans.util.WebBeansUtil.configureSpecializations(WebBeansUtil.java:643)
at
org.apache.webbeans.config.BeansDeployer.checkSpecializations(BeansDeployer.java:700)
... 25 more
Please see the attached replication example (testcase: FooTest).
kind regards
Reinis
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira