• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Listener servlet run time error

 
Ranch Hand
Posts: 46
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :

 
Ranch Hand
Posts: 228
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic