This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ContextListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ContextListener" Watch "ContextListener" New topic
Author

ContextListener

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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






The future belongs to those who believe in the beauty of their dreams.Dream BIG!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

Your application's deployment is failing. The url-pattern in web.xml must start with / so this line is creating the problem



SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bindu Lakhanpal
Ranch Hand

Joined: Oct 17, 2008
Posts: 165

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

Joined: Feb 08, 2006
Posts: 457

Hi Nabila,

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


Sai Surya, SCJP 5.0, SCWCD 5.0, IBM 833 834
http://sai-surya-talk.blogspot.com, I believe in Murphy's law.
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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

Joined: Nov 05, 2007
Posts: 661

My log.. if it's any help.

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

It may help to see SelectTag.tld.


[My Blog]
All roads lead to JavaRanch
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
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

Joined: Mar 24, 2008
Posts: 3827

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.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi Nabila.

Use
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
Chinmaya, aren't I using the same thing...

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9293
    
  17

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

Joined: Nov 05, 2007
Posts: 661
Thanks Chinmaya, Good Catch!!

These tiny mistakes can really drive you crazy!

Thanks ppl for all your help..
Sai Surya
Ranch Hand

Joined: Feb 08, 2006
Posts: 457

However, I am trying to understand the relationship between the exception and the not defining listener class public.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

Joined: Feb 15, 2009
Posts: 4
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
Bartender

Joined: Apr 07, 2010
Posts: 1665
    
  25

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ContextListener