• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cactus: java.lang.NoSuchErrorField: Config

 
Clinton Morrison
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I run the class below through Eclipse JUnit plugin, I receive the error java.lang.NoSuchErrorField:config. I can't see what I am doing wrong? Thanks in advance.


Cactus Class
package testing.cactus;

import servletunit.struts.CactusStrutsTestCase;


/**
* The Class LoginCactusTest.
*/
public class LoginCactusTest extends CactusStrutsTestCase {

/** The Constant ACTION_PATH. */
private static final String ACTION_PATH = "/ProcessLogin";

/**
* Instantiates a new login cactus test.
*
* @param testName the test name
*/
public LoginCactusTest(String testName) {

super(testName);
}

public void setUp() throws Exception {
super.setUp();
setConfigFile("/WEB-INF/struts-config-signon.xml");
setRequestPathInfo(ACTION_PATH);
}

/**
* Test valid user login.
*
* @throws Exception the exception
*/
public void testValidUserLogin() throws Exception {
actionPerform();
}
}

java.lang.NoSuchFieldError: config
at servletunit.struts.CactusStrutsTestCase.setUp(CactusStrutsTestCase.java:105)
at testing.cactus.LoginCactusTest.setUp(LoginCactusTest.java:25)
at junit.framework.TestCase.runBare(TestCase.java:128)
at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:155)
at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:120)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:94)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:225)
at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java:1)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:102)
at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:225)
at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java:1)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:73)
at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:225)
at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java:1)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34851
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clinton,
Is the web project in the classpath for the project containing this test? I'm wondering if the test can't find the web project and therefore the config file.
 
Clinton Morrison
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running the class through the Eclipse IDE, JUnit plug in. When I check the class path I can see project?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic