Return-Path: Delivered-To: apmail-jakarta-cactus-user-archive@apache.org Received: (qmail 72259 invoked from network); 20 Dec 2001 15:31:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 20 Dec 2001 15:31:19 -0000 Received: (qmail 13077 invoked by uid 97); 20 Dec 2001 15:31:19 -0000 Delivered-To: qmlist-jakarta-archive-cactus-user@jakarta.apache.org Received: (qmail 13026 invoked by uid 97); 20 Dec 2001 15:31:18 -0000 Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Cactus Users List" Reply-To: "Cactus Users List" Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 13013 invoked from network); 20 Dec 2001 15:31:17 -0000 To: "Cactus Users List" Subject: RE: 500 error after accessing WebRequest object Message-ID: From: KenRussell@spektra.co.uk Date: Thu, 20 Dec 2001 15:30:33 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks for your assistance Vincent - made a little progress! I cleaned everything up, started with the cactus ant package, and successfully ran the cactus 22-1.2 sample. However, I am unable to run the 22-1.3dev sample - it is throwing a NoClassDefFound when it looks for org/apache/log4j/Logger. I can't see this package/class structure in the log4j-core.jar supplied with Cactus, or in the main log4j. jar? Ken "Vincent Massol" 12/20/2001 12:20 PM Please respond to "Cactus Users List" To: "'Cactus Users List'" cc: Subject: RE: 500 error after accessing WebRequest object Ken, You're out of luck ! :-) It seems you're using a version of JUnit which is not compatible with the version of Ant you're running. In order not to have any problem, you can download the prepackaged Ant provided on the cactus site, in the download area (release download section). Thanks -Vincent > -----Original Message----- > From: KenRussell@spektra.co.uk [mailto:KenRussell@spektra.co.uk] > Sent: 20 December 2001 11:47 > To: Cactus Users List > Subject: RE: 500 error after accessing WebRequest object > > Vincent, > I've tried running the 22 sample nightly build, but have not been > successful. I edited the build properties as per the setup instructions > but the run fails with the following error: > > [junit] Running org.apache.cactus.TestAll > [junit] java.lang.NoSuchMethodError > [junit] at > org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter.s ta > rtTest(PlainJUnitResultFormatter.java:158) > [junit] at > junit.framework.TestResult.startTest(TestResult.java:158) > [junit] at junit.framework.TestResult.run(TestResult.java:103) > [junit] at junit.framework.TestCase.run(TestCase.java:122) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) > [junit] at junit.framework.TestSuite.run(TestSuite.java:168) > [junit] at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTe st > Runner.java:209) > [junit] at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitT es > tRunner.java:342) > [junit] Exception in thread "main" > > Ken > > > > > > > "Vincent Massol" > 12/19/2001 09:20 PM > Please respond to "Cactus Users List" > > > To: "'Cactus Users List'" > cc: > Subject: RE: 500 error after accessing WebRequest object > > > Ken, > > Can you try to run the latest Cactus sample application as is (nightly > build from the day before yesterday) ? I have included a new unit test > that sets the content-type. If you succeed in running the sample, it > means the problems come from your code (either test code or code under > test). > > To run the cactus sample, simply follow the instructions at > http://jakarta.apache.org/cactus/howto_sample.html > > -Vincent > > > -----Original Message----- > > From: KenRussell@spektra.co.uk [mailto:KenRussell@spektra.co.uk] > > Sent: 19 December 2001 16:52 > > To: Cactus Users List > > Subject: RE: 500 error after accessing WebRequest object > > > > Vincent, > > Tried using the nightly build cactus.jar, commons-httpclient.jar and > > aspectjrt.jar as an alternative to my 2.3 release stuff, but no joy - > > still get the same error: > > > > java.lang.NullPointerException > > [junit] at > > > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.ja > va > > :158) > > > > when I try to set the content-type header. > > > > I'm assuming that it is something to do with my Tomcat environment, as > you > > are able to run the content-type test OK. I can manipulate any other > > header values without problems. > > I haven't been able to download the cactus source, so I am unable to > see > > what might be causing the null pointer in AbstractHttpClient. > > Ken > > > > > > > > > > > > > > > > "Vincent Massol" > > 12/17/2001 09:36 AM > > Please respond to "Cactus Users List" > > > > > > To: "'Cactus Users List'" > > cc: > > Subject: RE: 500 error after accessing WebRequest > object > > > > > > Hi Ken, > > > > I have just tried the following test and it works fine for me (with > > Cactus 1.3 - I have not tried with Cactus 1.2) : > > > > public void beginSetContentTypeHeader(WebRequest request) > > { > > request.addHeader("Content-type", "text/xml"); > > } > > > > public void testSetContentTypeHeader() > > { > > assertEquals("text/xml", request.getContentType()); > > } > > > > Now, if you are using Cactus 1.3 (still in CVS but you can use the > > nightly builds), there is also a new API (which does the same as > above) > > : WebRequest.setContentType(String contentType) > > > > Ex : > > > > public void beginTest(WebRequest theRequest) > > { > > theRequest.setContentType("text/xml"); > > } > > > > public void testTest() throws Exception > > { > > assertEquals("text/xml", request.getContentType()); > > } > > > > > > -Vincent > > > > > -----Original Message----- > > > From: KenRussell@spektra.co.uk [mailto:KenRussell@spektra.co.uk] > > > Sent: 17 December 2001 09:23 > > > To: Cactus Users List > > > Subject: RE: 500 error after accessing WebRequest object > > > > > > Thanks for the reply. > > > It looks like the problem is a specific header type, as you suggest. > I > > > want to do some tests based on setting "content-type", but this > throws > > an > > > error whenever I try to set it. > > > Other arbitrary header settings seem to run OK, including the test > you > > > outline below - no errors for this on my platform. > > > I can force content-type OK on the non-cactus tests I have been > > running, > > > so it looks like I have a problem if I want to cactus-ise my tests. > Is > > > there a list of "vital" headers which you can't touch when using > > cactus? > > > Ken > > > > > > > > > > > > > > > > > > > > > > > > "Vincent Massol" > > > 12/14/2001 08:52 PM > > > Please respond to "Cactus Users List" > > > > > > > > > To: "'Cactus Users List'" > > > > cc: > > > Subject: RE: 500 error after accessing WebRequest > > object > > > > > > > > > Ken, > > > > > > I don't know what's wrong with what you're doing - it seems fine to > me > > > (unless you're modifying a "vital" header which cause the server to > > > throw a 500 exception). > > > > > > There is one test in the Cactus test suite that does this : it is as > > > follows : > > > > > > public void beginSendHeader(WebRequest theRequest) > > > { > > > theRequest.addHeader("testheader", "this is a header test"); > > > } > > > > > > public void testSendHeader() > > > { > > > assertEquals("this is a header test", > > > request.getHeader("testheader")); > > > } > > > > > > -Vincent > > > > > > > -----Original Message----- > > > > From: KenRussell@spektra.co.uk [mailto:KenRussell@spektra.co.uk] > > > > Sent: 14 December 2001 18:29 > > > > To: cactus-user@jakarta.apache.org > > > > Subject: 500 error after accessing WebRequest object > > > > > > > > Wondering if anyone can help me... > > > > I set up a cactus test (testInit) which ran succesfully to > > conclusion > > > with > > > > empty method bodies on beginInit, testInit endInit. > > > > I then tried setting a header value in beginInit, using the > > WebRequest > > > > object. The header was set correctly (I checked this by reading > the > > > > headers back from the WebRequest object, immediately after > setting) > > > but > > > > the test then threw the following error: > > > > > > > > test.uk.co.spektra.ofs.runtime.TestCactusOrigoHTTPInput > constructor > > > > .beginInit > > > > E > > > > Time: 0.862 > > > > There was 1 error: > > > > 1) > testInit(test.uk.co.spektra.ofs.runtime.TestCactusOrigoHTTPInput) > > > > java.io.IOException: Server returned HTTP response code: 500 for > > URL: > > > > http://localhost:8080/ServletRedirector/ > > > > at > > > > > > > > > > sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec > > > ti > > > > on.java:564) > > > > at > > > > > > > > > > org.apache.cactus.client.AutoReadHttpURLConnection.getInputStream(AutoRe > > > ad > > > > HttpURLConnection.java:127) > > > > at > > > > > > > > > > org.apache.cactus.client.AbstractHttpClient.doTest(AbstractHttpClient.ja > > > va > > > > :136) > > > > at > > > > > > > > > > org.apache.cactus.AbstractTestCase.runGenericTest(AbstractTestCase.java: > > > 42 > > > > 2) > > > > at > > > > > org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:130) > > > > at > > > > > > org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:371) > > > > at > > > > > > > > > > test.uk.co.spektra.ofs.runtime.LocalTestPackage.main(LocalTestPackage.ja > > > va > > > > :27) > > > > > > > > FAILURES!!! > > > > Tests run: 1, Failures: 0, Errors: 1 > > > > > > > > This error appears to get thrown when I start trying to access the > > > > WebRequest method. > > > > Having looked at the archives, I see references to 500 errors, but > > not > > > > exactly the same situation. > > > > Any ideas? > > > > Thanks > > > > Ken > > > > > > > > -- > > > > To unsubscribe, e-mail: > > > unsubscribe@jakarta.apache.org> > > > > For additional commands, e-mail: > > > help@jakarta.apache.org> > > > > > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > unsubscribe@jakarta.apache.org> > > > For additional commands, e-mail: > > help@jakarta.apache.org> > > > > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > unsubscribe@jakarta.apache.org> > > > For additional commands, e-mail: > > help@jakarta.apache.org> > > > > > > > > > > > > > -- > > To unsubscribe, e-mail: > unsubscribe@jakarta.apache.org> > > For additional commands, e-mail: > help@jakarta.apache.org> > > > > > > > > > > > > -- > > To unsubscribe, e-mail: > unsubscribe@jakarta.apache.org> > > For additional commands, e-mail: > help@jakarta.apache.org> > > > > > > > -- > To unsubscribe, e-mail: unsubscribe@jakarta.apache.org> > For additional commands, e-mail: help@jakarta.apache.org> > > > > > > -- > To unsubscribe, e-mail: unsubscribe@jakarta.apache.org> > For additional commands, e-mail: help@jakarta.apache.org> > -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: