Re: fun with NetBeans & StrutsTestCase

kaputmaltwormΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 1 μήνα)

345 εμφανίσεις

Re: fun with NetBeans & StrutsTestCase
Source: http://coding.derkeiler.com/Archive/Java/comp.lang.java.softwaretools/2005−09/msg00088.html
From: etienno@xxxxxxxxx•
Date: 29 Sep 2005 11:00:47 −0700•
Hi,
I have the same problem. MockStrutsTestCase doesn't seems to see the
Web.xml even if you set it in the setServletConfigFile method.
It try:
setServletConfigFile("webApplication/WEB−INF/web.xml");
And it never work.
This is the error I got putting most on the log on DEBUG:
2005−09−29 13:59:42,316 DEBUG [main] (MockStrutsTestCase.java:113) −
Entering
0 [main] DEBUG struts.MockStrutsTestCase − Entering
172 [main] DEBUG struts.MockStrutsTestCase − Exiting
172 [main] DEBUG struts.MockStrutsTestCase − Entering − key =
validating, value = false
172 [main] DEBUG struts.MockStrutsTestCase − Exiting
2005−09−29 13:59:42,488 DEBUG [main] (MockStrutsTestCase.java:122) −
Exiting
2005−09−29 13:59:42,488 DEBUG [main] (MockStrutsTestCase.java:407) −
Entering − key = validating, value = false
2005−09−29 13:59:42,488 DEBUG [main] (MockStrutsTestCase.java:412) −
Exiting
2005−09−29 13:59:42,488 DEBUG [main] (MockStrutsTestCase.java:439) −
Entering − pathName = webApplication/WEB−INF/struts−config.xml
2005−09−29 13:59:42,503 DEBUG [main] (MockStrutsTestCase.java:457) −
Entering − moduleName = null, pathname
=webApplication/WEB−INF/struts−config.xml
2005−09−29 13:59:42,503 DEBUG [main] (MockStrutsTestCase.java:465) −
Exiting
2005−09−29 13:59:42,503 DEBUG [main] (MockStrutsTestCase.java:443) −
Exiting
172 [main] DEBUG struts.MockStrutsTestCase − Entering − pathName =
webApplication/WEB−INF/struts−config.xml
187 [main] DEBUG struts.MockStrutsTestCase − Entering − moduleName =
null, pathname =webApplication/WEB−INF/struts−config.xml
Re: fun with NetBeans & StrutsTestCase
Re: fun with NetBeans & StrutsTestCase 1
187 [main] DEBUG struts.MockStrutsTestCase − Exiting
2005−09−29 13:59:42,503 DEBUG [main] (MockStrutsTestCase.java:479) −
Entering − pathname = webApplication/WEB−INF/web.xml
187 [main] DEBUG struts.MockStrutsTestCase − Exiting
187 [main] DEBUG struts.MockStrutsTestCase − Entering − pathname =
webApplication/WEB−INF/web.xml
1141 [main] DEBUG struts.MockStrutsTestCase − Exiting
2005−09−29 13:59:43,457 DEBUG [main] (MockStrutsTestCase.java:528) −
Exiting
2005−09−29 13:59:43,457 DEBUG [main] (SearchLuceneActionTest.java:45) −
TEST inside the test class
2005−09−29 13:59:43,457 DEBUG [main] (MockStrutsTestCase.java:320) −
Entering − parameterName = keyword, parameterValue = test
2005−09−29 13:59:43,457 DEBUG [main] (MockStrutsTestCase.java:324) −
Exiting
2005−09−29 13:59:43,457 DEBUG [main] (MockStrutsTestCase.java:353) −
Entering − pathInfo = /searchLucene
1141 [main] DEBUG control.SearchLuceneActionTest − TEST inside the
test class
1141 [main] DEBUG struts.MockStrutsTestCase − Entering − parameterName
= keyword, parameterValue = test
1141 [main] DEBUG struts.MockStrutsTestCase − Exiting
1141 [main] DEBUG struts.MockStrutsTestCase − Entering − pathInfo =
/searchLucene
1141 [main] DEBUG struts.MockStrutsTestCase − Entering − moduleName =
, pathInfo = /searchLucene
2005−09−29 13:59:43,457 DEBUG [main] (MockStrutsTestCase.java:376) −
Entering − moduleName = , pathInfo = /searchLucene
1172 [main] DEBUG struts.Common − Entering − path = /searchLucene
2005−09−29 13:59:43,488 DEBUG [main] (Common.java:349) − Entering −
path = /searchLucene
1172 [main] DEBUG struts.Common − Exiting − returning path =
/searchLucene
1172 [main] DEBUG struts.MockStrutsTestCase − setting request
attribute − name = javax.servlet.include.servlet_path, value =
2005−09−29 13:59:43,488 DEBUG [main] (Common.java:358) − Exiting −
returning path = /searchLucene
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:387) −
setting request attribute − name = javax.servlet.include.servlet_path,
value =
1172 [main] DEBUG struts.MockStrutsTestCase − Exiting
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:394) −
Exiting
1172 [main] DEBUG struts.MockStrutsTestCase − Exiting
1172 [main] DEBUG struts.MockStrutsTestCase − Entering
1172 [main] DEBUG struts.MockStrutsTestCase − Entering
1172 [main] DEBUG struts.MockStrutsTestCase − intializing
actionServlet
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:357) −
Exiting
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:282) −
Re: fun with NetBeans & StrutsTestCase
Re: fun with NetBeans & StrutsTestCase 2
Entering
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:219) −
Entering
2005−09−29 13:59:43,488 DEBUG [main] (MockStrutsTestCase.java:224) −
intializing actionServlet
1172 [main] INFO servletunit.ServletContextSimulator − ActionServlet:
init
1922 [main] ERROR action.ActionServlet − The /WEB−INF/web.xml was not
found.
2005−09−29 13:59:44,238 ERROR [main] (ActionServlet.java:1137) − The
/WEB−INF/web.xml was not found.
1938 [main] ERROR action.ActionServlet − Unable to initialize Struts
ActionServlet due to an unexpected exception or error thrown, so
marking the servlet as unavailable. Most likely, this is due to an
incorrect or missing library dependency.
javax.servlet.ServletException: The /WEB−INF/web.xml was not found.
at
org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1138)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:328)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:226)
at
servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:290)
But if I place the webApplication folder in the claspath, when running
my test, it works!
But this is not the best way to do this I guess.
Etienne.
.
References:
fun with NetBeans & StrutsTestCase
From: Phlip◊

fun with NetBeans & StrutsTestCase
From: Phlip◊


Prev by Date: Re: Export JAR file•
Previous by thread: fun with NetBeans & StrutsTestCase•
Next by thread: Look what I found, free grid java applet !•
Re: fun with NetBeans & StrutsTestCase
Re: fun with NetBeans & StrutsTestCase 3
Index(es):
Date♦
Thread♦

Re: fun with NetBeans & StrutsTestCase
Re: fun with NetBeans & StrutsTestCase 4