• Post Reply Bookmark Topic Watch Topic
  • New Topic

Listener servlet run time error  RSS feed

 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning All,
Hope you all have a great Friday . I am struggling with the error from my listener servlet and I could not figure it out why it can not find my resource instance eventhough i declared it in both my web.xml and context.xml.
I am going to post my codes and my error message here; and hopefully you may tell me what's going on.

For the information, I am using Tomcat 7.0 web server.

I declared a resource reference named TimerManager in my web.xml and my context.xml, and i try to look for it using InitialContext from my ServletContextListener.


Thanks so much in advance.

My ServletContextListener is as following:



my web.xml is as following :




My context.xml is as following :



and finally my error message is :

 
Ishan Pandya
Ranch Hand
Posts: 228
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what if you chage line 41 of myListener.java to

I am not sure but can you try it and tell what happens?
 
Mark Curlette
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I just changed it to
as you suggested, and it gave me the error message saying that



Does anyone have an aswer why it could not perform the look up? It seems to be very straight forward as it explains in the book , but it did turn out so.

Thanks in advance for your help,

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!