• 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

web.xml configuration Problem

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

I am facing problem in Websphere 5.1, in my web application all servlets are packaged in jar file which i put in wed-inf\lib folder. In web.xml i mentioned about servlet and its mapping.But, i am getting error 404. when i call servleteither by Servlet name or through package.

Pls. help me in this. or tell me some ref. example which i can download and test.

Regards
 
author & internet detective
Posts: 39790
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now on to your question. Can I assume "wed-inf\lib" has "WEB-INF" as a typo just in this post and not in your configuration.

Are there any error messages in the WebSphere console?
 
Pawan Rawal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne for suggesting for Name change which i already done to Pawan Rawal.

It is WEB-INF, the problem which i am facing, how to configure servlets which are lying in WEB-INF\lib as jar files.

The steps i followed e.g as follows:-


1.Compile my servlets and packaging in jar format through jbuilder
2.Put jar in WEB-INF\lib
3.Configure web.xml file as follows (in ServLib.jar contains EcomPrintServlet class)

<servlet>
<servlet-name>/EcomPrint</servlet-name>
<init-param>
<param-name>initParam1</param-name>
<param-value>value1</param-value></init-param>
<init-param>
<param-name>initParam2</param-name>
<param-value>value2</param-value></init-param>
<servlet-class>ServLib.EcomPrintServlet</servlet-class>
<display-name />
<description /></servlet>

<servlet-mapping>
<url-pattern>/EcomPrint</url-pattern>
<servlet-name>ServLib.EcomPrintServlet</servlet-name></servlet-mapping>


Error which i face at the time of running Websphere App Server Error Creating Component Null : Open Failure.

First tell me about my approach and what error i am doing. This is working fine with JRun 4.0

Regards

Pawan Rawal
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,which package is your servlet class in?Don't use your jar package name.for example,my servlet class com.bestone.app.TestServlet in my app.jar, <servlet-class>com.bestone.TestServlet</servlet-class>not<servlet-class>app.TestServlet</servlet-class>.
 
qingwu wang
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Pawan Rawal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your advice
 
I'm so happy! And I wish to make this tiny ad happy too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!