• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Listener class problem

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

i implemented HttpSessionListener which is used to count the current users online by checking the session count. Then i configured the web.xml for the listener. But after the confguration i cant able to run any html or jsp in the server (Tomcat V 5.5 server). I am using ObjectWeb Lomboz Eclipse.

I dont know whats the reason. i am getting an error saying "The requested resource (/Myproj/form_cookie.html) is not available "

If i remove the listener description in the DD, everything working fine. So Can you help me out of this. What is the reason behind this problem.

And also i can run the jsp in the other projects. i guess that there is some error in the DD of this project. Please help me

This is my DD

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 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">

<display-name>
Myproj
</display-name>

<context-param>
<param-name>commonMail</param-name>
<param-value>vinovs@indiatimes.com</param-value>
</context-param>

<context-param>
<param-name>breed</param-name>
<param-value>Great Dane</param-value>
</context-param>

<!-- Here i am facing the problem. Once i remove this description, its working fine. Any logical reason for this problem -->

<listener>
<listener-class>Active_Count</listener-class>
</listener>



<servlet>
<description>
</description>
<display-name>ListenerTester</display-name>
<servlet-name>ListenerTester</servlet-name>
<servlet-class>ListenerTester</servlet-class>
</servlet>


<servlet>
<description>
</description>
<display-name>
Srvlet_cookie</display-name>
<servlet-name>Srvlet_cookie</servlet-name>
<servlet-class>
Srvlet_cookie</servlet-class>
<init-param>
<description>
</description>
<param-name>mail</param-name>
<param-value>vinoth4.s@tcs.com</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>ListenerTester</servlet-name>
<url-pattern>/ListenTest.do</url-pattern>
</servlet-mapping>


<servlet-mapping>
<servlet-name>Srvlet_cookie</servlet-name>
<url-pattern>/Cookie_servlet.do</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

</web-app>

The Error message

HTTP Status 404 - /Myproj/PageCounter.jsp

--------------------------------------------------------------------------------

type Status report

message /Myproj/PageCounter.jsp

description The requested resource (/Myproj/PageCounter.jsp) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.25

Please clear my problem.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<listener>
<listener-class>Active_Count</listener-class>
</listener>


i think, you have to give fully qualified name for LitenerClass

example,
..........................................................
<listener>
<listener-class>package.Active_Count</listener-class>
</listener>
........................................................
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup the listener class must have a fully qualified path with package. Yet you don't get deployment errors?
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic