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

but to intialize bean class in web.xml

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Bean Class



Web.xml



Java code to acces


I'm getting the following exception

javax.naming.NamingException: Cannot create resource instance

 
Saloon Keeper
Posts: 27705
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I wish you hadn't double-spaced all that. It was very hard to read.

You've defined a bean, defined it as a JNDI-managed resource in web.xml, and provided lookup code.

But I didn't see where you actually instantiated the bean. You need not only a resource REFERENCE, you need a resource DEFINITION.

Actually, for the most part, the web.xml resources are expected to be simple data types such as strings. Even URL class objects are more than you'll get full support for. An exception is the DataSource, where Tomcat is helping out a bit.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Closing this thread, as the discussion if following there...
 
    Bookmark Topic Watch Topic
  • New Topic