We're using JBoss 4.22 with portlets. When the listener tag is not in the web.xml the portlet loads, but the listener sessionDestroyed() is never called (obviously). When added the portlet isn't loaded, and there aren't any exceptions or log messages. Are there any gotchas I should be aware of?
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<!-- Listeners used by application -->
<listener>
<listener-class>listenerpackage.MyClassThatImplementsHttpSessionListener</listener-class>
</listener>
...Other tags...
</web-app>
In reply to the comments I have been looking through the code to find trouble spots. My Listener's constructor does have some possible trouble. Normally (not as listener) an instance would be made by the relevant portlet's (the one that isn't loaded when the listener is added to the web.xml) constructor. Can I still expect this to be the case or does the container create a instance itself?