Hi all,
I want to implement cactus
unit test framework in my
j2ee application. I have an EAR file , which having the following structure:
META-INF/application.xml
testejb.jar
testweb.war(*.jsps/WEB-INF/classes). Now i have written one testcase and put it in classes folder and i changed web.xml file and i added corresponding jars to WEB-INF/lib folder. Also added cactus.properties file in the root of application. Now i buid EAR file and deployed in weblogic8.1 AS and i executed cactus test case like the following URL.
http://localhost:7001/contextroot/ServletTestRunner?suite=testSample(with package).
Now i got the problem like this,
java.lang.NoClassDefFoundError: servletunit/struts/MockStrutsTestCase
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:480)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClassFromContextClassLoader_aroundBody2(ClassLoaderUtils.java:78)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClassFromContextClassLoader_aroundBody3$advice(ClassLoaderUtils.java:246)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClassFromContextClassLoader(ClassLoaderUtils.java)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClass_aroundBody0(ClassLoaderUtils.java:61)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClass_aroundBody1$advice(ClassLoaderUtils.java:246)
at org.apache.cactus.internal.util.ClassLoaderUtils.loadClass(ClassLoaderUtils.java)
at org.apache.cactus.internal.server.runner.WebappTestSuiteLoader.load_aroundBody0(WebappTestSuiteLoader.java:43)
at org.apache.cactus.internal.server.runner.WebappTestSuiteLoader.load_aroundBody1$advice(WebappTestSuiteLoader.java:288)
at org.apache.cactus.internal.server.runner.WebappTestSuiteLoader.load(WebappTestSuiteLoader.java)
at junit.runner.BaseTestRunner.loadSuiteClass(BaseTestRunner.java:208)
at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:101)
at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:298)
at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:186)
at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:217)
at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
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.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
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)
Its irritating me this error, could you please help me where i am going wrong?
Its bit urgent.!!
Thanks in advance
Regards
Venky