Custom aspect domain does not work
afejes Jan 19, 2010 10:58 AMHi,
I have a session bean (ejb3) with a custom aspect domain. If the ejb is deployed as jar it works fine.
The *-aop.xml can be found in the jar META-INF.
If the ejb is deployed as EAR jboss5.1.0.GA throws exception:
{
org.jboss.deployers.spi.DeploymentException: Error deploying myaop-ejb.jar: No container configured with name 'TestDomain''
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:30
6)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: No container configured with name 'TestDomain''
at org.jboss.ejb3.Ejb3AnnotationHandler.getStatelessContainer(Ejb3AnnotationHandler.java:307)
at org.jboss.ejb3.Ejb3AnnotationHandler.getContainers(Ejb3AnnotationHandler.java:203)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:718)
at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:669)
at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:651)
at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:614)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:491)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:182)
... 34 more
16:34:37,375 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DE
TAILS):
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/work/servers/jboss-xxx/server/default/deploy/test.ear/" is in error due to the following reason(s): java.
lang.RuntimeException: No container configured with name 'TestDomain''}
I got the same result using the @AspectDomain annotaion in the bean or creating a jboss.xml (basis on the http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html).
In jboss4.2.3 this feature works correctly.
The ejb staff is:
{code:java}
package test.aop;
public interface Hello
{
void hello();
}
package test.aop;
package test.aop;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import org.jboss.ejb3.annotation.AspectDomain;
@Stateless
@Remote(Hello.class)
@AspectDomain("TestDomain")
public class HelloBean implements Hello
{
@Override
public void hello()
{
// TODO Auto-generated method stub
}
}
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
public class HelloInterceptor implements Interceptor
{
public Object invoke(Invocation invocation) throws Throwable
{
System.out.println("*** say hello ***");
return invocation.invokeNext();
}
public String getName()
{
return HelloInterceptor.class.getName();
}
}
{code}
The custom aop is:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
<interceptor class="test.aop.HelloInterceptor" scope="PER_VM"/>
<domain name="TestDomain">
<bind pointcut="execution(* $instanceof{@javax.ejb.Remote}->*(..))">
<interceptor-ref name="test.aop.HelloInterceptor"/>
</bind>
<annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
@org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=5, timeout=10000)
</annotation>
</domain>
</aop>{code}
Anybody else had this issue?
Thanks
Andrew