Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ContextListener

 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • 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





 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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

 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
  • 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 /.
 
Sai Surya
Ranch Hand
Posts: 463
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator

My log.. if it's any help.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nabila.

Use
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chinmaya, aren't I using the same thing...

 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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 Java Tomcat Server
  • Mark post as helpful
  • send pies
  • 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 Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Bahman Robin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2450
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic