• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Run junit CactusStrutsTestCase with Tomcat

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
While running CactusStrutsTestCase, I get below exception, can anyone suggest what can be wrong? I feel that it may be because of jar file version mismatch but still not able to figurout exact. Below is the exception.

testSuccessfulSearch(calendar.TestCalendarSearch)java.lang.NoSuchFieldError: config
[java] at servletunit.struts.CactusStrutsTestCase.setUp(CactusStrutsTestCase.java:105)
[java] at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:155)
[java] at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:120)
[java] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:94)
[java] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:225)
[java] at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
[java] at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
[java] at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:225)
[java] at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
[java] at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
[java] at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:225)
[java] at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java:1)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[java] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
[java] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
[java] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
[java] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[java] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[java] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
[java] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
[java] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
[java] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
[java] at java.lang.Thread.run(Thread.java:595)

Regards,
Kaizar
 
Ranch Hand
Posts: 121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at How To Ask Questions On Java Ranch
Specially at this item
 
Kaizar Laxmidhar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the code which throws the exception. I am running below test in command prompt like "% java calendar.TestCalendarSearch"

package calendar;

import servletunit.struts.CactusStrutsTestCase;
import com.datalex.bic.beans.CalendarSearchParam;
import com.datalex.has.travelservices.handlers.HasDate;

public class TestCalendarSearch extends CactusStrutsTestCase{
public TestCalendarSearch(String testName){
super(testName);
}
public static void main(String[] args){
junit.textui.TestRunner.run(TestCalendarSearch.class);
}
public void testSuccessfulSearch(){
setConfigFile("/WEB-INF/struts-config.xml");
setRequestPathInfo("/CalendarSearchAction");
addRequestParameter("OutboundDay","20");
addRequestParameter("TripType","RETURN");
actionPerform();
}
}

Regards,
Kaizar
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
!!! I have exactly the same problem with cactusstrutstestcase and i d'ont found the solution.
Please help
kaiser
reply
    Bookmark Topic Watch Topic
  • New Topic