jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: ServletRequest.getParameterMap() throws java.lang.AbstractMethodError
Date Sun, 20 Oct 2002 13:59:24 GMT
Hi Philipp,

The reason is simple, you're using Cactus for J2EE 1.2 (i.e. Servlet API
2.2) whereas getParameterMap() only exists in Servlet API 2.3. You
should use Cactus for J2EE 1.3 instead.

I've also added the following test case in cactus test suite to confirm
it works ok:

    public void beginGetParameterMap(WebRequest theRequest)
    {
        theRequest.addParameter("multivalue", "value 1");
        theRequest.addParameter("multivalue", "value 2");
    }

    public void testGetParameterMap()
    {
        Map parameters = request.getParameterMap();
        assertTrue(parameters.containsKey("multivalue"));
        String[] values = (String[]) parameters.get("multivalue");
        assertEquals(2, values.length);        
        assertEquals("value 1", values[0]);        
        assertEquals("value 2", values[1]);        
    }

Thanks
-Vincent

> -----Original Message-----
> From: Philipp von Hartrott [mailto:P.Hartrott@datadesignag.com]
> Sent: 02 October 2002 16:17
> To: cactus-user@jakarta.apache.org
> Subject: ServletRequest.getParameterMap() throws
> java.lang.AbstractMethodError
> 
> Hello,
> 
> using jakarta-cactus-12-1.4.1 and jakarta-tomcat-4.0.4 on j2sdk1.4.0 I
> encounter the following problem:
> whenever my servlet calls getParameterMap() on a request an
> AbstractMethodError is thrown.
> 
> Ideas or help are appreciated.
> Greetings,
> Philipp.
> 
> My servlet:
> 
> 	...
> 	public void service(
> 		ServletRequest servletRequest,
> 		ServletResponse servletResponse)
> 		throws ServletException, IOException
> 	{
> 		//Works fine
> 		String[] params =
> servletRequest.getParameterValues("multivalue");
> 		System.out.println(params);
> 		//Throws an error
> 		Map m = servletRequest.getParameterMap();
> 		System.out.println(m);
> 	}
> 	...
> 
> My testcase:
> 
>     ...
>     public void beginService(WebRequest theRequest)
>     {
>         theRequest.addParameter("multivalue", "value 1");
>         theRequest.addParameter("multivalue", "value 2");
>     }
> 
> 	public void testService()
> 	{
> 		try
> 		{
> 			TestServlet testServlet = new TestServlet();
> 			testServlet.service(request, response);
> 
> 		}catch(IOException e)
> 		{
> 			fail(e.getMessage());
> 		}catch(ServletException e)
> 		{
> 			fail(e.getMessage());
> 		}
> 	}	...
> 
> The error:
> 
> There was 1 error:
> 1)
>
testServiceFBRq(de.datadesign.fb.alc.servlet.common.TestServletTestCase)
> java.lang.AbstractMethodError:
>
org.apache.cactus.server.HttpServletRequestWrapper.getParameterMap()Ljav
a/
> util/Map;
> 	at
>
de.datadesign.fb.alc.servlet.common.TestServlet.service(TestServlet.java
:3
> 9)
> 	at
>
de.datadesign.fb.alc.servlet.common.TestServletTestCase.testServiceFBRq(
Te
> stServletTestCase.java:54)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:
> 39)
> 	at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Im
> pl.java:25)
> 	at
>
org.apache.cactus.AbstractTestCase.runServerTest(AbstractTestCase.java:3
32
> )
> 	at
>
org.apache.cactus.AbstractTestCase.runBareServerTest(AbstractTestCase.ja
va
> :235)
> 	at
>
org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCal
le
> r.java:149)
> 	at
>
org.apache.cactus.server.AbstractWebTestController.dispatch87_handleRequ
es
>
t(AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj
(1
> k):125)
> 	at
>
org.apache.cactus.server.AbstractWebTestController.around87_handleReques
t(
>
AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1
k)
> :1156)
> 	at
>
org.apache.cactus.server.AbstractWebTestController.handleRequest(Abstrac
tW
> ebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.dispatch113_doPost(Servle
tT
> estRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):123)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.around113_doPost(ServletT
es
> tRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirec
to
> r.java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.dispatch112_doGet(Servlet
Te
> stRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.around112_doGet(ServletTe
st
> Redirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
> 	at
>
org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirect
or
> .java;org/apache/cactus/util/log/LogAspect.aj(1k):92)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
ti
> onFilterChain.java:247)
> 	at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
er
> Chain.java:193)
> 	at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.
> java:243)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.
> java:190)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va
> :246)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
7)
> 	at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:1
> 80)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lv
> e.java:170)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:1
> 70)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :564)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
ja
> va:174)
> 	at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va
> :566)
> 	at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> 	at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j
av
> a:1027)
> 	at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:
11
> 25)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message