It seems that annotation:
solves the problem for my MDB. Is it possible to specify the same thing with XML ?
you can do annotation overrides in the
You have to pick the right "domain" though...apologies for the poor doco.
One way is presented in the test classes provided with the source distribution of JBoss 4.0.3SP1. The example uses annotations to configure the pool, but each annotation has its descriptor analog.
Look for the file StrictlyPooledMDB.java. The lines you will find of interest:
@PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=StrictlyPooledMDB.maxActiveCount, timeout=10000)
where StrictlyPooledMDB.maxActiveCount is an int defined in the class to establish the maximum number of threads.
Your milage may vary here, as setting maxSize to low values can result in JMS subsystems exceptions.
And in case anyone is wondering. This is how you do the same thing in jboss.xml:
<?xml version="1.0" encoding="UTF-8"?> <jboss xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0"> <security-domain>java:/jaas/example-domain</security-domain> <enterprise-beans> <message-driven> <ejb-name>sample.MDB</ejb-name> <pool-config> <pool-class>org.jboss.ejb3.StrictMaxPool</pool-class> <pool-max-size>1</pool-max-size> <pool-timeout>5000</pool-timeout> </pool-config> </message-driven> </enterprise-beans> </jboss>
BTW thanks for this thread. You saved my bacon. And thanks to Eclipse for having an XML editor that understands xsd. Oh and thanks to JIRA for showing that the xsd existed!
Finally I'd like to thank my producer... j/k - its late.
I am having a problem following your suggestion. I increased by session size to 20 using :
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "20"
but now I get the following exception :
Failed to acquire the pool semaphore, strictTimeout=10000
A search on the forum suggestion that I need to increase my MDB pool size to boyond the number of the sessions.
However you suggest that this is not the way to go. I tried it and it didn't work. It complained about the jboss.xml file not being correct.
Is there another solution to the Failed to acquire the pool semaphore, strictTimeout=10000 ?