• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Problems running servlets from WAR file

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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.
 
It's exactly the same and completely different as this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic