Hi
I am trying Cactus with Web Logic 7.0
My deployed War Directory structure is like this
WEB-INF
|
| _web.xml
| _weblogic.xml
|_ _ Classes
| |
| | _SampleServlet.class
| | _TestSampleServlet.class
|----lib
|
| _aspectjrt.jar
| _cactus.jar
| _commons-httpclient.jar
| _junit.jar
web.xml
===========
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ServletTestRunner</servlet-name>
<servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServletTestRunner</servlet-name>
<url-pattern>/ServletTestRunner</url-pattern>
</servlet-mapping>
</web-app>
===========
weblogic.xml
===========
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA
Systems, Inc.//DTD Web Application 7.0//EN"
"http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
<weblogic-web-app>
<display-name>test</display-name>
<context-root>CactusTest</context-root>
</weblogic-web-app>
===========
When I am accessing local host
http://localhost:7001/CactusTest/ServletTestRunner?suite=TestSampleServlet , I am
getting following Exceptions
<?xml version="1.0" encoding="UTF-8" ?>
- <testsuites>
- <testsuite name="TestSampleServlet" tests="1" failures="1" errors="0" time="0.078">
- <testcase name="warning" time="0">
<failure message="Exception in constructor: testSaveToSessionOK
(java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod at
java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at
org.apache.cactus.configuration.BaseConfiguration.<clinit>(BaseConfiguration.java:94)
at org.apache.cactus.ServletTestCase.init(ServletTestCase.java:188) at
org.apache.cactus.ServletTestCase.<init>(ServletTestCase.java:164) at
TestSampleServlet.<init>(TestSampleServlet.java:11) at
java.lang.reflect.Constructor.newInstance(Native Method) at
junit.framework.TestSuite.createTest(TestSuite.java:135) at
junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at
junit.framework.TestSuite.<init>(TestSuite.java:75) at
TestSampleServlet.suite(TestSampleServlet.java:16) at
java.lang.reflect.Method.invoke(Native Method) at
junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111) at
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:302) at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:158)
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:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5412)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134) )"
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
Exception in constructor: testSaveToSessionOK (java.lang.NoClassDefFoundError:
org/apache/commons/httpclient/HttpMethod at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:115) at
org.apache.cactus.configuration.BaseConfiguration.<clinit>(BaseConfiguration.java:94)
at TestSampleServlet.<init>(TestSampleServlet.java:11) at
java.lang.reflect.Constructor.newInstance(Native Method) at
TestSampleServlet.suite(TestSampleServlet.java:16) at
junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111) at
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:302) at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:158)
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:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5412)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134) ) at
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:313) at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
at
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:158)
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:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5412)
at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:744)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3086)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2544)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)</failure>
</testcase>
</testsuite>
</testsuites>
Regards
kuldeep
-----Original Message-----
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Sat 1/17/2004 2:51 AM
To: Cactus Users List
Cc:
Subject: Re: cactus ant task on existing container ?
On Jan 16, 2004, at 12:43 PM, Vincent Massol wrote:
> I'm still hesitating to add this feature (deploying as an exploded war)
> as I'm not sure what benefit it would provide for <cactus> users.
>
Since I got it working using docBase="appfuse.war", and it was fairly
easy - I don't think it's that necessary to add it - especially if
Tomcat 5 supports both.
> On a related matter, are you sure tomcat 4.1.x doesn't support
> META-INF/context.xml files? (this article seems to imply it does:
> http://www.onjava.com/pub/a/onjava/2003/01/08/tomcat4.html?page=3).
I just did a bunch of testing and it doesn't work on 4.1.29 on OS X. I
tried everything - expanded war/META-INF, compressed war, etc. I kept
getting:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver
of class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
No matter what I tried.
I'll have to e-mail the tomcat-user list and see if this is possible
with Tomcat 4.
> When you say "common <junit> test config", what is it common with?
It's not a big deal - since it's my problem and not cactus's.
>
>>
>> I'll probably leave the "start.tomcat" and "stop.tomcat" stuff in my
>> build.xml file because they're nice ways to debug tomcat and I use
> them
>> for running Canoo's Webtest,
>
> Yes, I'd also like that we add <startcontainer>/<stopcontainer> Ant
> tasks for starting/stopping containers. It should be very easy to
> implement as we're already doing it in the <cactus> task. We could
> probably even reuse the existing <[container name]> nested elements
> (they're already Ant task in their implementation I think), and simply
> add an "action" attribute (action="start|stop"). Anyone wishing to
> help?
> :-)
Oooooh - that would be wicked cool!
>>
>> Above all, I do dig the <cactus> task which should allow me to test
>> multiple containers. Now if it was only easier to configure other
>> servers (i.e. Resin, Orion) with a simple context.xml file.
>
> Why is it more complex? For Resin, simply pass a resin.conf file to the
> <resin2x> element, no?
I suppose I could do this - but to configure Resin right now, I add one
line to resin.conf and that includes my appfuse.conf file. I'm sure I
could include a resin.conf in my project (for testing), but then again,
I could also include a server.xml. This is just me trying to do things
without changing anything in my project. The one thing that *is* nice
about including a server.xml and/or resin.conf is that users can look
at a complete working config file for your app.
I appreciate all your help on this Vincent - much appreciated. Is it
possible that the resin2x task will work with Resin 3.x? I'll have to
try it and see! BTW - there's a bug in the documentation for the
<cactus task>
resin2x
The nested element orion1x allows running the tests against the Resin
Server 2.x.
[10 minutes later] - it doesn't look like 2x support 3.x.
[cactus] java.lang.NoSuchMethodException:
com.caucho.server.http.ResinServer.<init>([Ljava.lang.String;, boolean)
[cactus] at java.lang.Class.getConstructor0(Class.java:1769)
[cactus] at java.lang.Class.getConstructor(Class.java:1002)
[cactus] at
org.apache.cactus.integration.ant.container.resin.ResinRun.doStartServer
(ResinRun.java:115)
Matt
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Confidentiality Notice
The information contained in this electronic message and any attachments to this
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL
PROTECTED] immediately
and destroy all copies of this message and any attachments.