Reputation: 39
I'm trying to develop my app on glassfish, I use eclipse luna, but I get the following error:
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: PWC1430: Unable to add listener of type: br.com.hrtech.atendimento.listener.ContadorSessao, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces. Please see server.log for more details.
I tought that was something about web.xml
and I have this code but I can't undderstand what is wrong:
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
Has someone ever seen this ????
Upvotes: 0
Views: 1313
Reputation: 13857
The error message is clearly describing the problem:
Unable to add listener of type: br.com.hrtech.atendimento.listener.ContadorSessao, because it does not implement any of the required ServletContextListener, ServletContextAttributeListener, ServletRequestListener, ServletRequestAttributeListener, HttpSessionListener, or HttpSessionAttributeListener interfaces.
The message says you have registered a class named br.com.hrtech.atendimento.listener.ContadorSessao
as a listener (probably in web.xml
), which doesn't implement any of the required interfaces.
You have to implement one of these interfaces in your class if you want to register it as a listener.
So either you can do something like this:
public class ContadorSessao implements ServletContextListener {
// implement all required methods
}
or, if this really shouldn't be a listener, there seems to be an entry in your web.xml
looking like this:
<listener>
<listener-class>br.com.hrtech.atendimento.listener.ContadorSessao</listener-class>
</listener>
Remove this entry and it should work.
If the problem doesn't get fixed by one of these solutions, make sure that you Clean & Build
your project before redeploying it with the new settings.
By the way, the part of the your web.xml
you posted, indicates that you are using obsolete and deprecated technologies (namely JSP) which doesn't make any sense in 2014 if you develop a new web app which should run on Glassfish (I guess at least version 3). For a standard JSF 2.x web application you shouldn't need something like com.sun.faces.config.ConfigureListener
.
You should consider switching to a more recent "software stack" (JSF 2, EJB 3.1, JPA 2).
Upvotes: 1