Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Problems running servlets from WAR file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm using WAS 4.0 to deploy a WAR file.
It installs OK, and the static content (i.e. images) show right. The problem is that I can't get the servlets to run, the browser stops showing a 'File Not Found' error.
I think the problem might be related to the 'servlet-mapping'. In my web.xml file I have not defined it.
Can anyone tell me if a 'servlet-mapping' element has to be added for each servlet to run in WAS ?
If that is the case, is there any way to state that every servlet of a WAR file to have some kind of mapping. (I'd rather not add a 'servlet-mapping' to every servlet inside the WAR file)
[I've tried this WAR file on Tomcat and J/Run and it works fine]
Thanks,
Gustavo Brown
 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gustavo Brown:
I think the problem might be related to the 'servlet-mapping'. In my web.xml file I have not defined it.
Can anyone tell me if a 'servlet-mapping' element has to be added for each servlet to run in WAS ?


Yes, you have to add servlet mappings. Or, enable servlet invoker, so your servlet in WAR file can be exceuted by their class names.
 
Gustavo Brown
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And how do I enable servlet invoker ?
Do I enable it with some 'web.xml' tags or is it a WebSphere option ?
Thanks...
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a servlet mapping for invoker in ws 3.5 -not sure about ws4. I picked it up from the default_app.webapp in the properties directory.
<servlet>
<name>invoker</name>
<description>Auto-registration servlet</description>
<code>com.ibm.servlet.engine.webapp.InvokerServlet</code>
<servlet-path>/servlet</servlet-path>
<autostart>false</autostart>
</servlet>
Enjoy.
 
Normally trees don't drive trucks. Does this tiny ad have a license?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic