[
https://issues.jboss.org/browse/WELD-912?page=com.atlassian.jira.plugin.s...
]
Nicklas Karlsson commented on WELD-912:
---------------------------------------
A test could look something like
{code}
package org.jboss.weld.tests.specialization;
import org.jboss.arquillian.api.Deployment;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ArchivePaths;
import org.jboss.shrinkwrap.api.BeanArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
public class AS7Specialization
{
@Deployment
public static Archive<?> deploy()
{
JavaArchive jar = ShrinkWrap.create(BeanArchive.class,
"test.jar").addClass(Foo.class);
WebArchive war = ShrinkWrap.create(WebArchive.class,
"test.war").addLibrary(jar).addClass(Bar.class).addWebResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"));
return war;
}
@Test
public void notneeded()
{
// should fail on deployment
}
}
{code}
{code}
public class Foo
{
}
{code}
{code}
@Specializes
public class Bar extends Foo
{
}
{code}
Specializing beans in different bean archives does not work
-----------------------------------------------------------
Key: WELD-912
URL:
https://issues.jboss.org/browse/WELD-912
Project: Weld
Issue Type: Bug
Components: Bootstrap and Metamodel API
Affects Versions: 1.1.1.Final
Reporter: Nicklas Karlsson
Fix For: 1.2.0.Beta1
Attachments: test.zip
@Specializing a bean that is deployed in a different bean archive fails with the
following exception:
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000047 Specializing bean
must extend another bean: Managed Bean [class fi.affecto.test.MyApplicationBundles] with
qualifiers [@Any @Default]
at org.jboss.weld.bean.ManagedBean.specialize(ManagedBean.java:545)
at org.jboss.weld.bean.AbstractBean.initialize(AbstractBean.java:124)
at org.jboss.weld.bean.AbstractClassBean.initialize(AbstractClassBean.java:202)
at org.jboss.weld.bean.ManagedBean.initialize(ManagedBean.java:372)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.deploy(AbstractBeanDeployer.java:113)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:216)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:370)
at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
... 4 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira