Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet deployed outside of web app  RSS feed

 
Mark Lybarger
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

we have a need to have a "global" servlet. we'd like to create a servlet and deploy a .jar file into say the jboss lib folder and have that servlet be accessable from any deployed war. the purpose of the servlet is to verify an application's health (lookup an applications jndi values and so forth). we'd like to be able to deploy this without having to deploy all of our applications into production. is there a way to inject this into all our web applications without touching the web.xml to define the servlet?

thanks!
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Lybarger:


we'd like to create a servlet and deploy a .jar file into say the jboss lib folder and have that servlet be accessable from any deployed war.


A servlet going to jboss's lib folder.I do not think its possible.Servlets can only live within a web application.

You have to write a servlet and pack it in web application structure (along with a web.xml ), deploy in server.All the other applications can make use of the servlet the usual way.

But what kind of monitoring you would be doing from that servlet ?
 
Mark Lybarger
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the servelet's purpose it to validate the health of a web application. it is to validate that a web application's declared resources (jndi lookups) are actually available. the servlet looks at a web.xml and all the defined resource ref's and tries to do a lookup on them. if found, good, if not, bad.

this servlet should be deployed to the container and not bundled with each and every application that is deployed. i don't want to have to touch the production applications to have them have this servlet available.

i've read there's some way to invoke a servlet using /servlet/class, but that this isn't supported directly by the j2ee specification. file systems aren't supported by the spec either, but everyone logs using a file logger.

any help would be most appreciated.

thanks
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mark Lybarger:


i've read there's some way to invoke a servlet using /servlet/class, but that this isn't supported directly by the j2ee specification.


Invoker servlet is a feature of Tomcat for quick test.I do not think its recommended for production use.As this is not part of the servlet specification so its not portable.


Mark Lybarger: it is to validate that a web application's declared resources (jndi lookups) are actually available. the servlet looks at a web.xml and all the defined resource ref's and tries to do a lookup on them


I think all vendors provide with these basic features to through administration console.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!