This content has been marked as final.
Show 4 replies
-
2. Re: Custom StrictMaxPool settings in ...-aop.xml ignored
shreyasshinde Nov 20, 2009 9:29 PM (in response to rbattenfeld)I am trying to use StrictMaxPool in JBoss 5.1.0.GA and the properties in the -aop.xml file seem to be ignored. This is for a stateless session bean.
The EJB3 container seems to honor only the properties in ejb3-interceptors-aop.xml. Any -aop.xml bundled with the EJB application seem to be ignored.
Any ideas what I could be missing?
Thanks,
Shreyas
jboss.xml:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="5.0" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"> <enterprise-beans> <session> <ejb-name>ClusterOne.USA_MAP.MapServer</ejb-name> <jndi-name>esri/services/ClusterOne/MapServer/USA_MAP</jndi-name> <clustered>true</clustered> <cluster-config> <partition-name>ClusterOne</partition-name> <load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin</load-balance-policy> </cluster-config> <aop-domain-name>Strictly Pooled Stateless Bean</aop-domain-name> </session> </enterprise-beans> </jboss>
mydomain-aop.xml:<?xml version="1.0" encoding="UTF-8"?> <aop xmlns="urn:jboss:aop-beans:1.0"> <domain name="Strictly Pooled Stateless Bean" extends="Stateless Bean" inheritBindings="true"> <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)"> @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=10, timeout=10000) </annotation> </domain> <domain name="Strictly Pooled Message Driven Bean" extends="Message Driven Bean" inheritBindings="true"> <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)"> @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=10, timeout=10000) </annotation> </domain> </aop>
-
3. Re: Custom StrictMaxPool settings in ...-aop.xml ignored
shreyasshinde Nov 22, 2009 6:26 PM (in response to rbattenfeld)Okay. I have a solution for this. It turns out that when EJBs applications are deployed, the properties in ejb3-interceptors-aop.xml file under the deploy directory are applied first. The following annotation in the file says "if the class is not present then apply this property.
<annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)"> @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=20, timeout=10000) </annotation>
So, when I was bundling my -aop.xml file with my EJB application, the property should read:<annotation expr="class(@org.jboss.ejb3.annotation.Pool)"> @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=10, timeout=10000) </annotation>
Which means, if the class is present then apply this property. As the properties from ejb3-interceptors-aop.xml file are always applied first, the class is present and therefore we only check for its existence.
Most of the documentation is misleading in a way that this point is not very clear.
Thanks,
Shreyas -
4. Re: Custom StrictMaxPool settings in ...-aop.xml ignored
jaikiran Nov 23, 2009 2:52 AM (in response to rbattenfeld)"shreyasshinde" wrote:
It turns out that when EJBs applications are deployed, the properties in ejb3-interceptors-aop.xml file under the deploy directory are applied first.
That's because, your configuration instructs the container to do so:<domain name="Strictly Pooled Stateless Bean" extends="Stateless Bean" inheritBindings="true">
Notice the "extends". You have instructed that your domain extends the Stateless Bean domain which comes from ejb3-interceptors-aop.xml