• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

ContextListener

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


I unable to run this simple program mentioned in HFSJ and cant figure out the mistake.
I keep getting the 404 resource not found error.

MyServletContextListener



ListenerTester.java




Dog,java


web.xml





 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your application's deployment is failing. The url-pattern in web.xml must start with / so this line is creating the problem

 
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:The url-pattern in web.xml must start with /



unless its an extension match(*.do) which must start with a * and not a /.
 
Ranch Hand
Posts: 463
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nabila,

Can you post your JSP code here, I wanted to check how you are calling the servlet from JSP?

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there!


I am not using JSP . Just using servlets, exactly the way it is mentioned in HFSJ.
I had tried the same program earlier and it was perfectly fine. It is still running.. but some how this
one isn't !

I thought by adding "/"in <url-pattern>/ListenTest.do</url-pattern> , it should work , but its still giving me the same error.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My log.. if it's any help.

 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Exception processing TLD at resource path /WEB-INF/SelectTag.tld in context /Select


It may help to see SelectTag.tld.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I noticed that, but I don't have any selecttag.tld file I am not even using any tld or jsp files.I have mentioned all the files I am using...
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nabila Mohammad wrote:I noticed that, but I don't have any selecttag.tld file I am not even using any tld or jsp files.I have mentioned all the files I am using...


Your context name is "Select" ? Then you will have to check the contents inside your application in the container.
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nabila.

Use
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chinmaya, aren't I using the same thing...

 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nabila Mohammad wrote:Chinmaya, aren't I using the same thing...



Your listener class is not public. Why couldn't I see that
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Chinmaya, Good Catch!!

These tiny mistakes can really drive you crazy!

Thanks ppl for all your help..
 
Sai Surya
Ranch Hand
Posts: 463
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
However, I am trying to understand the relationship between the exception and the not defining listener class public.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sai Surya wrote:However, I am trying to understand the relationship between the exception and the not defining listener class public.


I'd like to know that too.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I saw this old post that shows exactly my recent problem. I have the same problem and I understand nobody answered it.
On the server log I got the same message which is on the line 22 (error ListenerStart) of server log in this post.
I appreciate your prompt solution for this problem.
 
Creator of Enthuware JWS+ V6
Posts: 3412
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bahman,

Could you start a new thread with this question (please do not wake up old threads) and add some more information of your setup.
(this old post was about not having a public Listener class)

Regards,
Frits
 
Hey cool! They got a blimp! But I have a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic