jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kelly C. Goedert" <kelly.goed...@nexxera.com>
Subject Re: help with sample application
Date Wed, 25 Aug 2004 20:08:58 GMT
Same error even if I edit global web.xml. The jar files are in 
TOMCAT_HOME/common/lib which is also in my classpath.

I tried another thing, which was placing a cactus.properties in my home 
directory than the error changed. Now I get this:

java.lang.IncompatibleClassChangeError
    at TestSampleServlet.beginSaveToSessionOK(TestSampleServlet.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at 
org.apache.cactus.internal.client.ClientTestCaseCaller.callGenericBeginMethod(ClientTestCaseCaller.java:358)
    at 
org.apache.cactus.internal.client.ClientTestCaseCaller.callBeginMethod_aroundBody0(ClientTestCaseCaller.java:192)
    at 
org.apache.cactus.internal.client.ClientTestCaseCaller.callBeginMethod_aroundBody1$advice(ClientTestCaseCaller.java:124)
    at 
org.apache.cactus.internal.client.ClientTestCaseCaller.callBeginMethod(ClientTestCaseCaller.java)
    at 
org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:141)
    at 
org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215)
    at 
org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133)
    at 
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:315)
    at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:193)
    at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:124)
    at 
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at

My classes are like this:

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

public class SampleServlet extends HttpServlet
{
    public void saveToSession(HttpServletRequest request)
    {
        String testparam = request.getParameter("testparam");
        request.getSession().setAttribute("testAttribute", testparam);
    }
}

import junit.framework.Test;
import junit.framework.TestSuite;

import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;

public class TestSampleServlet extends ServletTestCase
{
    public TestSampleServlet(String theName)
    {
        super(theName);
    }

    public static Test suite()
    {
        return new TestSuite(TestSampleServlet.class);
    }

    public void beginSaveToSessionOK(WebRequest webRequest)
    {
        webRequest.addParameter("testparam", "it works!");
    }

    public void testSaveToSessionOK()
    {
        SampleServlet servlet = new SampleServlet();
        servlet.saveToSession(request);
        assertEquals("it works!", session.getAttribute("testAttribute"));
    }
}


I thought that since the jar files I am using to compile the cliente are 
the same that are on the server, I wouldn't get an error like this. I've 
seen this kind of error when you compile the classes with one version of 
the library and try to execute it with another version.

Thanks again.

Kelly.



Vincent Massol wrote:

>Hi Kelly,
>
>On http://jakarta.apache.org/cactus/integration/howto_tomcat.html, it says
>to edit the global web.xml but you said you have created a web.xml in your
>webapp. Can you try to do exactly as described on the page and see if it
>works?
>
>Where have you put the cactus jars (commons-logging, aspectjrt, cactus,
>etc)?
>
>What is the name of your war (more specifically have you named it "test")?
>
>Thanks
>-Vincent
>
>PS: We'll get it to work, no worries... ;-)
>
>  
>
>>-----Original Message-----
>>From: Kelly C. Goedert [mailto:kelly.goedert@nexxera.com]
>>Sent: mercredi 25 août 2004 21:40
>>To: Cactus Users List
>>Subject: Re: help with sample application
>>
>>Sorry for the lack of information....
>>
>>The web.xml is as follow and is located in my application WEB-INF
>>directory:
>>
>><web-app>
>>
>><servlet>
>>  <servlet-name>ServletRedirector</servlet-name>
>>  <servlet-class>
>>    org.apache.cactus.server.ServletTestRedirector
>>  </servlet-class>
>>  <init-param>
>>    <param-name>param1</param-name>
>>    <param-value>value1 used for testing</param-value>
>>  </init-param>
>></servlet>
>>
>><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>
>>
>>
>>The page I was referring to is this one:
>>
>>http://jakarta.apache.org/cactus/integration/howto_tomcat.html
>>
>>I'm trying to follow this example.
>>
>>Thanks
>>
>>Kelly
>>
>>
>>
>>
>>
>>Vincent Massol wrote:
>>
>>    
>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Kelly C. Goedert [mailto:kelly.goedert@nexxera.com]
>>>>Sent: mercredi 25 août 2004 21:33
>>>>To: Cactus Users List
>>>>Subject: Re: help with sample application
>>>>
>>>>Hi Vincent,
>>>>
>>>>yes it is a 404. I copied and pasted the web.xml that is in the example
>>>>page. I 'm wondering it is a problem with my tomcat version. I'm using
>>>>tomcat 5.0.27
>>>>
>>>>
>>>>        
>>>>
>>>What web.xml? The global one or the one in your war's web-inf/Web.xml?
>>>      
>>>
>>Could
>>    
>>
>>>you show us your web.xml?
>>>
>>>Could you also tell me what example page you are referring to?
>>>
>>>There should be no pb with your Tomcat install.
>>>
>>>Thanks
>>>-Vincent
>>>
>>>
>>>
>>>      
>>>
>>>>Kelly.
>>>>Vincent Massol wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>Hi Kelly,
>>>>>
>>>>>What error are you getting? A 404? If so it means your mapping in
>>>>>          
>>>>>
>>web.xml
>>    
>>
>>>>>          
>>>>>
>>>>is
>>>>
>>>>
>>>>        
>>>>
>>>>>not correct. If it's a 500 error then your tomcat logs should have the
>>>>>error.
>>>>>
>>>>>Thanks
>>>>>-Vincent
>>>>>
>>>>>PS: Could you please tell me what Cactus page you are referring to? If
>>>>>there's something to fix in the doc we need to know where it's not well
>>>>>explained.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>-----Original Message-----
>>>>>>From: Kelly C. Goedert [mailto:kelly.goedert@nexxera.com]
>>>>>>Sent: mercredi 25 août 2004 15:55
>>>>>>To: cactus-user@jakarta.apache.org
>>>>>>Subject: help with sample application
>>>>>>
>>>>>>I'm trying to run cactus sample application as is explained in cactus
>>>>>>page. But I get this error: _The requested resource
>>>>>>(/test/ServletTestRunner) is not available.
>>>>>>_The url I'm typing is
>>>>>>
>>>>>>http://localhost:8080/test/ServletTestRunner?suite=TestSampleServlet
>>>>>>
>>>>>>I'm using tomcat 5.0.27 and java 1.4.2_04
>>>>>>
>>>>>>I already tried placing the libs in common/lib and in webapps/test/lib
>>>>>>without results.
>>>>>>
>>>>>>All the requested libraries are also in my classpath
>>>>>>
>>>>>>Could anyone help me?
>>>>>>
>>>>>>Kelly.
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>>>
>>>>
>>>>        
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>
>
>  
>


Mime
View raw message