[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Deployment in JBoss - Cannot add servlet context listener from a programatically added listener  XML
Forum Index -> Deployment
Author Message

Power User

Joined: 21/11/2007 12:23:06
Messages: 5545

(from mail conversation)

The message "Cannot add servlet context listener from a programatically added listener" is shown during JBoss startup.

Please follow the JavaDoc of class CCServletContainerIInitializer. This means:

1. create file META-INF/services/javax.servlet.ServletContainerInitializer - a template file is available within eclnt_jsfserver.jar (name: META-INF/services/javax.servlet.ServletContainerInitializer_template)

2. Make sure that this file is part of your WEB-INF/classes or WEB-INF/<yourApp>.jar

Now deploy & start again!

Background information is: listeners, filters, servelts are registered via API (and not via web.xml) from Oct 2020 on. This mechanism is triggered by a central context listener (CCServletContextListener) - the last remaining part of CaptainCasa in the web.xml.
In some applicaiton servers this is too late - it is not possible to register new listeners during the processing of another listener. By using above's META-INF way, the triggering is done at the correct point of time.

Björn Müller, CaptainCasa GmbH
Forum Index -> Deployment
Go to:   
Powered by JForum 2.1.6 © JForum Team