Re: ServletRunner.getResponse() ClassNotFoundException

Adam Hardy <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
Russell Gold on 03/04/08 00:13, wrote:
> On Apr 2, 2008, at 6:23 PM, Adam Hardy wrote:
> 
>> I made a little more progress only to find that in fact, this  
>> attempt to load
>> org.apache.jasper.servlet.JspServlet is not down to Eclipse and is  
>> happening in
>> my maven test environment as well.
>>
>> Could it be HttpUnit? Is it using tomcat to compile the JSPs?
> 
> Yes, it is probably set up to use tomcat's jasper servlet for this.  
> This should be configurable. Can you provide a minimal test case for  
> me to duplicate this?

Actually the test case that I put up for the tiles issue should demonstrate the 
issue effectively, assuming that you use the code with the update that Wolfgang 
made earlier.

I found a way around the problem initially by adding tomcat-jasper as a dependency.

     <dependency>
       <groupId>org.apache.tomcat</groupId>
       <artifactId>jasper</artifactId>
       <version>6.0.13</version>
     </dependency>

However I ran straight into the next issue:

com.meterware.httpunit.HttpInternalErrorException: Error on HTTP request: 500 
javax.servlet.ServletException: org.apache.jasper.JasperException: 
java.io.FileNotFoundException: /home/adam/projects/pattern-repo/WEB-INF/web.xml 
(No such file or directory) [http://localhost/test/test-result/edit.html?code=1]
         at 
com.meterware.servletunit.ServletUnitClient.newResponse(ServletUnitClient.java:121)
         at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:164)
         at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:128)
         at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121)
         at com.meterware.httpunit.WebClient.getResponse(WebClient.java:113)
         at 
com.meterware.servletunit.ServletRunner.getResponse(ServletRunner.java:151)
         at 
org.permacode.patternrepo.web.TestResultActionTest.testSave(TestResultActionTest.java:69)

In my test (the last line of the stacktrace above) I set up the web.xml with a 
call to ServletRunner(new ByteArrayInputStream(webXml.toString().getBytes()), 
"/test");

where webXml was the StringBuilder where I had hard-coded my test web.xml - so I 
can't provide the file for Jasper to find!

I'm afraid I've burnt up all the time I had available for setting this stuff up 
and have to go back to other things, but at some point I'll see if I can sort 
out another little testcase for this. I'll log it on the sourceforge issue 
tracker at that point.

Regards
Adam

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.