Debugging jboss code I see now that there is a moment in which the exception is embedded in a MBeanException. Is this useful to understand the cause of this strange behaviour?
For JBoss 4.0.2 the classloading was changed so that web applications are isolated from other deployments.
Have you packed your exception twice? Once in the war and once in the jar? If the exception is loaded by two classloaders it is likely that it will appear to be a different class which is why it is skipping the first catch.
You made te right assumption, I deployed a JAR file for EJBs and a WAR file for Servlets and JSP. The exceptions package is included in both. Thanks very much for your help.