• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot Run Servlet  RSS feed

 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All:

Hopefully someone has seen this. Using Tomcat 4.1.30 JDK 1.4.2_06.
I.E. 6.0, (Cannot use firefox).

1. I am consistently getting the following error When I try to execute a servlet in a form:

HTTP Status 404 - /Jreports/RunJasperReport_s2b
--------------------------------------------------------------------------------
type Status report
message /Jreports/RunJasperReport_s2b
description The requested resource (/Jreports/RunJasperReport_s2b) is not available.


2. The web.xml for the servlet is:

<servlet>
<servlet-name>com.entservlet.RunJasperReport_s2b</servlet-name>
<servlet-class>com.entservlet.RunJasperReport_s2b</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>com.entservlet.RunJasperReport_s2b</servlet-name>
<url-pattern>/com/entservlet/RunJasperReport_s2b</url-pattern>
</servlet-mapping>


3. The form I am using is:

<form name="printJasperReport" method="POST" action="/com/entservlet/RunJasperReport_s2b" >
<input type="hidden" name="reportName" id="reportName" value="<%=reportName%>">
<input type="hidden" name="fromSession" id="fromSession" value="<%=fromSession%>">
<input type="hidden" name="printType" id="printType" value="<%=printType%>">
<input type="hidden" name="userName" id="userName" value="<%=owner%>">
</form>

4. I am not getting ANY ERRORS in any log files! I was able to verify that an instance of the servlet is being loaded on startUp and I was able to confirm that a declared instance was not null. I have searched through various web listings (java.sun.com, etc.) and have tried different approaches without success.


5. Has anyone seen a similiar problem ?Can Anyone provide any assistance??

Thanks for any Help Provided.

Michael Turner
[ March 29, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the context path for the web app?

Also, I'd not reveal the package path of the servlets in it's mapping. That's a bit too reminiscent of the evil Invoker.
 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The context path is: <Context /Jreports
 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mistake ...

<Context path="/Jreports"
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by michael turner:
mistake ...

<Context path="/Jreports"


when you submit the form do you see this url -
http://<host>:<port>/Jreports/com/entservlet/RunJasperReport_s2b

I see that it is rather being submitted to
/Jreports/RunJasperReport_s2b ??
[ March 29, 2007: Message edited by: Abhinav Srivastava ]
 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:

i am using
/Jreports/RunJasperReport_s2b

I will try to submit to
http://<host>:<port>/Jreports/com/entservlet/RunJasperReport_s2b

 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...sorry ... I have been at this since 4:00 A.M. I misunderstood.

when I submit the form I do not see the url -
http://<host>:<port>/Jreports/com/entservlet/RunJasperReport_s2b ....

The program goes straight to the error Listed above..

 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a workable solution
---------------------------
Thanks to:
Abhinav Srivastava
ranch hand
Member # 40100



I used:

<form name="printJasperReport" method="POST" action="http://localhost:8080/Jreports/com/entservlet/RunJasperReport_s2bcom/entservlet/RunJasperReport_s2b" >
<input type="hidden" name="reportName" id="reportName" value="<%=reportName%>">
<input type="hidden" name="fromSession" id="fromSession" value="<%=fromSession%>">
<input type="hidden" name="printType" id="printType" value="<%=printType%>">
<input type="hidden" name="userName" id="userName" value="<%=owner%>">
</form>



And It Worked! Thanks to Abhinav Srivastava for the assistance!!!
 
michael turner
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.....mistake correction .......

The true form entry. Extra Characters were in the other post

<form name="printJasperReport" method="POST" action="http://localhost:8080/Jreports/com/entservlet/RunJasperReport_s2bcom" >
<input type="hidden" name="reportName" id="reportName" value="<%=reportName%>">
<input type="hidden" name="fromSession" id="fromSession" value="<%=fromSession%>">
<input type="hidden" name="printType" id="printType" value="<%=printType%>">
<input type="hidden" name="userName" id="userName" value="<%=owner%>">
</form>
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!