Error on HTTP request: 404 No servlet mapping defined

mostafa kandil <[email protected]> Sun, 11 Nov 2012 16:38:46 -0800 (PST)
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
--===============7625889753649859588==
Content-Type: multipart/alternative;
	boundary="-590777070-2080658017-1352680726=:95406"

---590777070-2080658017-1352680726=:95406
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi httpunit developers team:=0Afirst i=A0appreciate the work of httpunit fr=
amework, i have 4 weeks ago searching for a tool i can use to test java Ser=
vlet. so when i found your framework, i was so happy :D .=A0=0Ai have downl=
oaded last=A0released, and tried a simple case:=0A=0Avoid test(){=0A>>>=A0 =
=A0 =A0try {=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 ServletRunner sr =3D new ServletR=
unner();=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 sr.registerServlet("validateLogin", "=
validateLogin"); =A0=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0// or =A0sr.registerServlet("validateLogin", validateLogin.class.getName=
());=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 ServletUnitClient sc =3D sr.newClient();=
=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 WebRequest request =3D new PostMethodWebReque=
st("http://cuportal.cu.edu.eg:8080/ISB/validateLogin");=0A>>>=0A>>>=0A>>>=
=A0 =A0 =A0 =A0 =A0 =A0 request.setParameter("un", "user1");=0A>>>=A0 =A0 =
=A0 =A0 =A0 =A0 request.setParameter("pwd", "userpwd"); =A0 =A0 =A0 =A0=A0=
=0A>>>=A0 =A0 =A0 =A0 =A0=A0=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 WebResponse respo=
nse =3D sc.getResponse(request);=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 assertEquals(=
"requested resource", "user_page.jsp", response.getText());=0A>>>=A0 =A0 =
=A0 =A0 } catch (Exception e) {=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 System.err.pri=
ntln("ERROR: " + e);=0A>>>=A0 =A0 =A0 =A0 =A0 =A0 e.printStackTrace();=0A>>=
>=A0 =A0 =A0 =A0 }=0A>>>}Always i got exception at red line :=0A=0A=A0=A0ER=
ROR: com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 4=
04 No servlet mapping defined [http://cuportal.cu.edu.eg:8080/ISB/validateL=
ogin]=0A>>>___________________________________=0A>>>com.meterware.httpunit.=
HttpNotFoundException: Error on HTTP request: 404 No servlet mapping define=
d [http://cuportal.cu.edu.eg:8080/ISB/validateLogin]=0A>>>at com.meterware.=
servletunit.WebApplication$ServletRequestImpl.getServlet(WebApplication.jav=
a:772)=0A>>>at com.meterware.servletunit.InvocationContextImpl$ExecutionCon=
text.getServlet(InvocationContextImpl.java:248)=0A>>>at com.meterware.servl=
etunit.InvocationContextImpl.getServlet(InvocationContextImpl.java:86)=0A>>=
>at com.meterware.servletunit.InvocationContextImpl.service(InvocationConte=
xtImpl.java:76)=0A>>>at com.meterware.servletunit.ServletUnitClient.newResp=
onse(ServletUnitClient.java:126)=0A>>>at com.meterware.httpunit.WebClient.c=
reateResponse(WebClient.java:647)=0A>>>at com.meterware.httpunit.WebWindow.=
getResource(WebWindow.java:220)=0A>>>at com.meterware.httpunit.WebWindow.ge=
tSubframeResponse(WebWindow.java:181)=0A>>>at com.meterware.httpunit.WebWin=
dow.getResponse(WebWindow.java:158)=0A>>>at com.meterware.httpunit.WebWindo=
w.getResponse(WebWindow.java:125)=0A>>>at com.meterware.httpunit.WebClient.=
getResponse(WebClient.java:96)=0A>>>at myServletTest.testISB(myServletTest.=
java:65)=0A>>>at myServletTest.<init>(myServletTest.java:21)=0A>>>at myServ=
letTest.main(myServletTest.java:81)=0A>>>=0A>>>i'm using =A0'Java EE 6 Web'=
, and =A0netbeans tool.=0Ai have added all=A0libraries.=0A=0ACan you help m=
e please solve that exception? =A0=0A=0Athanks in advance
---590777070-2080658017-1352680726=:95406
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"color:#000; background-color:#fff; font-family:ti=
mes new roman, new york, times, serif;font-size:14pt"><div style=3D"font-fa=
mily: 'times new roman', 'new york', times, serif; font-size: 14pt;">Hi htt=
punit developers team:</div><div><font face=3D"times new roman, new york, t=
imes, serif" size=3D"4">first i&nbsp;</font><font face=3D"times new roman, =
new york, times, serif"><span style=3D"font-size: 19px;">appreciate the wor=
k of httpunit framework, i have 4 weeks ago searching for a tool i can use =
to test java Servlet. so when i found your framework, i was so happy :D .&n=
bsp;</span></font></div><div style=3D"color: rgb(0, 0, 0); font-size: 19px;=
 font-family: 'times new roman', 'new york', times, serif; background-color=
: transparent; font-style: normal;"><font face=3D"times new roman, new york=
, times, serif" style=3D"background-color: transparent;">i have downloaded =
last&nbsp;</font><span style=3D"background-color: transparent;">released, a=
nd tried a
 simple case:</span><br></div><blockquote style=3D"border: none; padding: 0=
px;"><blockquote style=3D"border: none; padding: 0px;"><blockquote style=3D=
"border: none; padding: 0px;"><div style=3D"background-color: transparent;"=
><div style=3D"background-color: transparent;"><div style=3D"background-col=
or: transparent;"><span style=3D"font-family: 'lucida console', sans-serif;=
 font-size: 13px;">void test(){</span></div><div style=3D"background-color:=
 transparent;"><span style=3D"font-family: 'lucida console', sans-serif; fo=
nt-size: 13px;">&nbsp; &nbsp; &nbsp;try {</span></div><div style=3D"backgro=
und-color: transparent;"><span style=3D"font-family: 'lucida console', sans=
-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Servlet=
Runner sr =3D new ServletRunner();</span></div><div style=3D"background-col=
or: transparent;"><span style=3D"font-family: 'lucida console', sans-serif;=
 font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sr.registerSer=
vlet("validateLogin",
 "validateLogin"); &nbsp;</span></div><div style=3D"background-color: trans=
parent; color: rgb(0, 0, 0); font-size: 13px; font-family: 'lucida console'=
, sans-serif; font-style: normal;"><span style=3D"font-family: 'lucida cons=
ole', sans-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// or &nbsp;sr.registerS=
ervlet("validateLogin", validateLogin.class.getName());</span></div><div st=
yle=3D"background-color: transparent;"><span style=3D"font-family: 'lucida =
console', sans-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; ServletUnitClient sc =3D sr.newClient();</span></div><div style=3D"b=
ackground-color: transparent;"><span style=3D"font-family: 'lucida console'=
, sans-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; W=
ebRequest request =3D new PostMethodWebRequest("http://cuportal.cu.edu.eg:8=
080/ISB/validateLogin");</span></div><div style=3D"background-color:
 transparent;"><span style=3D"font-family: 'lucida console', sans-serif; fo=
nt-size: 13px;"><br></span></div><div style=3D"background-color: transparen=
t;"><span style=3D"font-family: 'lucida console', sans-serif; font-size: 13=
px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.setParameter("un", "=
user1");</span></div><div style=3D"background-color: transparent;"><span st=
yle=3D"font-family: 'lucida console', sans-serif; font-size: 13px;">&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.setParameter("pwd", "userpwd"); =
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div style=3D"background-colo=
r: transparent;"><span style=3D"font-family: 'lucida console', sans-serif; =
font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div=
 style=3D"background-color: transparent;"><span style=3D"font-weight: bold;=
 color: rgb(255, 0, 0); font-family: 'lucida console', sans-serif; font-siz=
e: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WebResponse response =
=3D
 sc.getResponse(request);</span></div><div style=3D"background-color: trans=
parent;"><span style=3D"font-family: 'lucida console', sans-serif; font-siz=
e: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assertEquals("requested=
 resource", "user_page.jsp", response.getText());</span></div><div style=3D=
"background-color: transparent;"><span style=3D"font-family: 'lucida consol=
e', sans-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; } catch (Exce=
ption e) {</span></div><div style=3D"background-color: transparent;"><span =
style=3D"font-family: 'lucida console', sans-serif; font-size: 13px;">&nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.err.println("ERROR: " + e);</sp=
an></div><div style=3D"background-color: transparent;"><span style=3D"font-=
family: 'lucida console', sans-serif; font-size: 13px;">&nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; e.printStackTrace();</span></div><div style=3D"backg=
round-color: transparent;"><span style=3D"font-family: 'lucida console', sa=
ns-serif;
 font-size: 13px;">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style=3D"=
background-color: transparent;"><span style=3D"font-family: 'lucida console=
', sans-serif; font-size: 13px;">}</span></div></div></div></blockquote></b=
lockquote></blockquote><span style=3D"background-color: transparent; font-f=
amily: 'times new roman', 'new york', times, serif; font-size: 18px;">Alway=
s i got exception at red line :</span><br><blockquote style=3D"border: none=
; padding: 0px;"><blockquote style=3D"border: none; padding: 0px;"><blockqu=
ote style=3D"border: none; padding: 0px;"><div style=3D"background-color: t=
ransparent;"><div style=3D"background-color: transparent;"><div style=3D"ba=
ckground-color: transparent;"><span style=3D"color: rgb(255, 0, 0);"><span =
style=3D"font-family: 'times new roman', 'new york', times, serif; font-siz=
e: 16px; font-style: normal;"><span style=3D"font-family: 'times new roman'=
, 'new york', times, serif;">&nbsp;&nbsp;</span></span><span style=3D"backg=
round-color:
 transparent; font-family: 'times new roman', 'new york', times, serif;">ER=
ROR: com.meterware.httpunit.HttpNotFoundException: Error on HTTP request: 4=
04 No servlet mapping defined [http://cuportal.cu.edu.eg:8080/ISB/validateL=
ogin]</span></span></div><div style=3D"background-color: transparent;"><spa=
n style=3D"font-family: 'times new roman', 'new york', times, serif; color:=
 rgb(255, 0, 0);">___________________________________</span></div><div styl=
e=3D"background-color: transparent;"><span style=3D"font-family: 'times new=
 roman', 'new york', times, serif; color: rgb(255, 0, 0);">com.meterware.ht=
tpunit.HttpNotFoundException: Error on HTTP request: 404 No servlet mapping=
 defined [http://cuportal.cu.edu.eg:8080/ISB/validateLogin]</span></div><di=
v style=3D"background-color: transparent;"><span style=3D"font-family: 'tim=
es new roman', 'new york', times, serif; color: rgb(255, 0, 0);"><span clas=
s=3D"Apple-tab-span" style=3D"white-space:pre">=09</span>at
 com.meterware.servletunit.WebApplication$ServletRequestImpl.getServlet(Web=
Application.java:772)</span></div><div style=3D"background-color: transpare=
nt;"><span style=3D"font-family: 'times new roman', 'new york', times, seri=
f; color: rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">=09</span>at com.meterware.servletunit.InvocationContextImpl$Execu=
tionContext.getServlet(InvocationContextImpl.java:248)</span></div><div sty=
le=3D"background-color: transparent;"><span style=3D"font-family: 'times ne=
w roman', 'new york', times, serif; color: rgb(255, 0, 0);"><span class=3D"=
Apple-tab-span" style=3D"white-space:pre">=09</span>at com.meterware.servle=
tunit.InvocationContextImpl.getServlet(InvocationContextImpl.java:86)</span=
></div><div style=3D"background-color: transparent;"><span style=3D"font-fa=
mily: 'times new roman', 'new york', times, serif; color: rgb(255, 0, 0);">=
<span class=3D"Apple-tab-span" style=3D"white-space:pre">=09</span>at
 com.meterware.servletunit.InvocationContextImpl.service(InvocationContextI=
mpl.java:76)</span></div><div style=3D"background-color: transparent;"><spa=
n style=3D"font-family: 'times new roman', 'new york', times, serif; color:=
 rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
=09</span>at com.meterware.servletunit.ServletUnitClient.newResponse(Servle=
tUnitClient.java:126)</span></div><div style=3D"background-color: transpare=
nt;"><span style=3D"font-family: 'times new roman', 'new york', times, seri=
f; color: rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">=09</span>at com.meterware.httpunit.WebClient.createResponse(WebCl=
ient.java:647)</span></div><div style=3D"background-color: transparent;"><s=
pan style=3D"font-family: 'times new roman', 'new york', times, serif; colo=
r: rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-space:pre=
">=09</span>at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:=
220)</span></div><div
 style=3D"background-color: transparent;"><span style=3D"font-family: 'time=
s new roman', 'new york', times, serif; color: rgb(255, 0, 0);"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">=09</span>at com.meterware.ht=
tpunit.WebWindow.getSubframeResponse(WebWindow.java:181)</span></div><div s=
tyle=3D"background-color: transparent;"><span style=3D"font-family: 'times =
new roman', 'new york', times, serif; color: rgb(255, 0, 0);"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">=09</span>at com.meterware.ht=
tpunit.WebWindow.getResponse(WebWindow.java:158)</span></div><div style=3D"=
background-color: transparent;"><span style=3D"font-family: 'times new roma=
n', 'new york', times, serif; color: rgb(255, 0, 0);"><span class=3D"Apple-=
tab-span" style=3D"white-space:pre">=09</span>at com.meterware.httpunit.Web=
Window.getResponse(WebWindow.java:125)</span></div><div style=3D"background=
-color: transparent;"><span style=3D"font-family: 'times new roman', 'new y=
ork', times, serif; color:
 rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
=09</span>at com.meterware.httpunit.WebClient.getResponse(WebClient.java:96=
)</span></div><div style=3D"background-color: transparent;"><span style=3D"=
font-family: 'times new roman', 'new york', times, serif; color: rgb(255, 0=
, 0);"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=09</span>a=
t myServletTest.testISB(myServletTest.java:65)</span></div><div style=3D"ba=
ckground-color: transparent;"><span style=3D"font-family: 'times new roman'=
, 'new york', times, serif; color: rgb(255, 0, 0);"><span class=3D"Apple-ta=
b-span" style=3D"white-space:pre">=09</span>at myServletTest.&lt;init&gt;(m=
yServletTest.java:21)</span></div><div style=3D"background-color: transpare=
nt;"><span style=3D"font-family: 'times new roman', 'new york', times, seri=
f; color: rgb(255, 0, 0);"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace: pre;">=09</span>at myServletTest.main(myServletTest.java:81)</span></d=
iv><div
 style=3D"background-color: transparent; color: rgb(255, 0, 0); font-size: =
16px; font-family: 'times new roman', 'new york', times, serif; font-style:=
 normal;"><span style=3D"font-family: 'times new roman', 'new york', times,=
 serif; color: rgb(255, 0, 0);"><br></span></div></div></div></blockquote><=
/blockquote></blockquote><span style=3D"font-size: 18px; background-color: =
transparent; font-family: 'times new roman', 'new york', times, serif;">i'm=
 using &nbsp;'Java EE 6 Web', and &nbsp;</span><span style=3D"font-size: 18=
px; background-color: transparent; font-family: 'times new roman', 'new yor=
k', times, serif;">netbeans tool.</span><div><span><span style=3D"font-fami=
ly: 'times new roman', 'new york', times, serif; font-size: 18px;">i have a=
dded all&nbsp;libraries.</span></span></div><div><span><span style=3D"font-=
family: 'times new roman', 'new york', times, serif; font-size: 18px;"><br>=
</span></span></div><div><span><span style=3D"font-family: 'times new roman=
', 'new
 york', times, serif; font-size: 18px;">Can you help me please solve that e=
xception? &nbsp;</span></span></div><div><br></div><div><span><span style=
=3D"font-family: 'times new roman', 'new york', times, serif; font-size: 18=
px;">thanks in advance<br></span></span><blockquote style=3D"border: none; =
padding: 0px;"><blockquote style=3D"border: none; padding: 0px;"><blockquot=
e style=3D"border: none; padding: 0px;"><div style=3D"background-color: tra=
nsparent;"><div style=3D"background-color: transparent;"><div style=3D"back=
ground-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-famil=
y: 'times new roman', 'new york', times, serif; font-style: normal;"><span>=
<span style=3D"font-family: 'times new roman', 'new york', times, serif;">&=
nbsp;</span></span></div></div></div></blockquote></blockquote></blockquote=
><div style=3D"background-color: transparent;"><div style=3D"background-col=
or: transparent; font-family: 'times new roman', 'new york', times, serif; =
font-style:
 normal; color: rgb(192, 0, 0); font-size: 16px;"><font face=3D"times new r=
oman, new york, times, serif"><span style=3D"color: rgb(192, 0, 0);"><br></=
span></font></div></div><div style=3D"color: rgb(0, 0, 0); font-size: 19px;=
 font-family: 'times new roman', 'new york', times, serif; background-color=
: transparent; font-style: normal;"><br></div></div></div></body></html>
---590777070-2080658017-1352680726=:95406--


--===============7625889753649859588==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
--===============7625889753649859588==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop

--===============7625889753649859588==--