You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by mde <fo...@mail.thesmithconnection.net> on 2003/05/21 19:33:34 UTC
classcastexception
Hi all,
I just upgraded to tomcat 4.1.24, put the necessary jars in common/lib, updated conf/web.xml per the instructions, and I'm getting a classcastexception when I try to use the ServletTestRunner. It seems that the problem is with the logging, but I'm not sure. Here's the pertinent stack trace:
java.lang.ClassCastException
at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111)
at org.apache.cactus.server.runner.ServletTestRunner.dispatch92_run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):153)
at org.apache.cactus.server.runner.ServletTestRunner.around92_run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):1236)
at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):137)
at org.apache.cactus.server.runner.ServletTestRunner.dispatch91_doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):121)
at org.apache.cactus.server.runner.ServletTestRunner.around91_doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
One immediately apparent difference is that the config docs indicate to use commons-logging-1.0, whereas tomcat 4.1.24 comes with commons-logging-api. I imagine the problem stems from this, but I'm not sure how to fix it. Swapping jars didn't work and produced a different exception (when logging-1.0 is used, i get log4j errors). I'd prefer not to remove logging-api frmo this directory, however, since I don't know what other dependencies tomcat may have with this jar.
thanks for any advice.
-M
Re: classcastexception
Posted by Christopher Lenz <cm...@gmx.de>.
Hi M,
weird exception and I have no good idea... anyway, you might want to try
putting the cactus libs in shared/lib instead of common/lib, and maybe
also move commons-logging-api.jar into server/lib (I still haven't
understood why it was put in common/lib at all).
-chris
mde wrote:
> Hi all,
> I just upgraded to tomcat 4.1.24, put the necessary jars in common/lib, updated conf/web.xml per the instructions, and I'm getting a classcastexception when I try to use the ServletTestRunner. It seems that the problem is with the logging, but I'm not sure. Here's the pertinent stack trace:
>
> java.lang.ClassCastException
> at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111)
> at org.apache.cactus.server.runner.ServletTestRunner.dispatch92_run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):153)
> at org.apache.cactus.server.runner.ServletTestRunner.around92_run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):1236)
> at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):137)
> at org.apache.cactus.server.runner.ServletTestRunner.dispatch91_doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):121)
> at org.apache.cactus.server.runner.ServletTestRunner.around91_doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):1156)
> at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>
> One immediately apparent difference is that the config docs indicate to use commons-logging-1.0, whereas tomcat 4.1.24 comes with commons-logging-api. I imagine the problem stems from this, but I'm not sure how to fix it. Swapping jars didn't work and produced a different exception (when logging-1.0 is used, i get log4j errors). I'd prefer not to remove logging-api frmo this directory, however, since I don't know what other dependencies tomcat may have with this jar.
>
> thanks for any advice.
>
> -M