RE: Losing Hair
Hi Mike, If you really want to try the tutorial as is without surprise I recommend using the suggest container, i.e. Tomcat 4.x (this is the first note of the page: This tutorial applies to Cactus 1.4 or greater and Tomcat 4.0 or greater.). Now if you're already familiar with Cactus and you want to make it work with JBoss 4.0 I have no idea but your problem seem to be one of classpath. In order to help you we would need the full stack trace. You're using the ServletTestRunner to start the Cactus tests, right? Are you using the J2EE 1.4 API or the 1.3 one (Cactus currently supports the 1.3 one only even though we have started implementing it for 1.4 and it's in 1.7 but it's not tested and not officially supported). Also, make sure you copy *all* Cactus-required libraries (for example the commons-httpclient version used in Cactus may be a newer version than the one shipped with JBoss 4.0.1). Thanks -Vincent -Original Message- From: Mike Sowka [mailto:[EMAIL PROTECTED] Sent: mercredi 23 mars 2005 20:45 To: cactus-user@jakarta.apache.org Subject: Losing Hair Hello Folks, Mike again... sorry for the two email back to back, the other was a draft that I had quickly sent off after I was accepted to the list... ... since then I've been ripping at my hair, as I'm not even able to run the basic Quickstart application! :| from: http://jakarta.apache.org/cactus/integration/howto_tomcat.html I've copied junit-3.8.1.jar, cactus-1.7.jar, and aspectjrt-1.2.1.jar into my {jboss dir}/lib/endorsed directory (the rest of the minimal jars are included in JBoss 4.0.1.) and did the rest of the Quickstart as per instructions... This is what I get: ... root cause java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet ... Curious, n'est-ce pas? I assure You, I haven't broke my JBoss installation, have the servlet jars in the classpath since other web-apps work just fine. Your patience and suggestions are appreciated, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Losing Hair
Vincent, I tried the Quickstart app in order to trouble shoot Cactus+JBoss4, so yes I've already taken a good part of the week to familiarize myself with JUnit/Cactus with the help of your book (A BLESSING). Using Tomcat is out of the question as I'm interested purely in testing EJBs, but at this point I'm considering switching backwards to JBoss3 :|. That's correct, I'm using ServletTestRunner to start the tests. I've compiled the Quickstart app with 1.3 servlet.jar, and... I've copied all of the cactus jars in the WEB-INF/libs (just to be on the safe side, but I doubt this is proper practise). Here is the fool stack trace as reported by HTTP 500: javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.cactus.server.runner.ServletTestRunner or a class it depends on org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595) root cause java.lang.ClassNotFoundException: org.apache.cactus.server.runner.ServletTestRunner java.net.URLClassLoader$1.run(URLClassLoader.java:200) java.security.AccessController.doPrivileged(Native Method) java.net.URLClassLoader.findClass(URLClassLoader.java:188) java.lang.ClassLoader.loadClass(ClassLoader.java:306) java.lang.ClassLoader.loadClass(ClassLoader.java:251) org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595) The error reported is different from the one I got before copying all of the cactus libs to WEB-INF/lib, it can at least find HttpServlet! ;) Any ideas? Merci, Mike On Wed, 2005-03-23 at 21:00 +0100, Vincent Massol wrote: Hi Mike, If you really want to try the tutorial as is without surprise I recommend using the suggest container, i.e. Tomcat 4.x (this is the first note of the page: This tutorial applies to Cactus 1.4 or greater and Tomcat 4.0 or greater.). Now if you're already familiar with Cactus and you want to make it work with JBoss 4.0 I have no idea but your problem seem to be one of classpath. In order to help you we would need the full stack trace. You're using the ServletTestRunner to start the Cactus tests, right? Are you using the J2EE 1.4 API or the 1.3 one (Cactus currently supports the 1.3 one only even though we have started implementing it for 1.4 and it's in 1.7 but it's not tested and not officially supported). Also, make sure you copy *all* Cactus-required libraries (for example the commons-httpclient version used in Cactus may be a newer version than the one shipped with JBoss 4.0.1). Thanks -Vincent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Losing Hair
Hi Mike, -Original Message- From: Mike Sowka [mailto:[EMAIL PROTECTED] Sent: mercredi 23 mars 2005 21:45 To: Cactus Users List Subject: RE: Losing Hair Vincent, I tried the Quickstart app in order to trouble shoot Cactus+JBoss4, so yes I've already taken a good part of the week to familiarize myself with JUnit/Cactus with the help of your book (A BLESSING). Glad you liked it :-) Using Tomcat is out of the question as I'm interested purely in testing EJBs, but at this point I'm considering switching backwards to JBoss3 :|. That's correct, I'm using ServletTestRunner to start the tests. I've compiled the Quickstart app with 1.3 servlet.jar, and... I've copied all of the cactus jars in the WEB-INF/libs (just to be on the safe side, but I doubt this is proper practise). Here is the fool stack trace as reported by HTTP 500: javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.cactus.server.runner.ServletTestRunner or a class it depends on [snip] root cause java.lang.ClassNotFoundException: org.apache.cactus.server.runner.ServletTestRunner [snip] The error reported is different from the one I got before copying all of the cactus libs to WEB-INF/lib, it can at least find HttpServlet! ;) Any ideas? Merci, Classloaders are the hardest thing to understand and I believe you have a classloader issue here. Am I right in thinking that you have a cactus jar in your System classpath or in jboss somewhere? If so, remove the cactus jar from all CPs and make sure that the only place it is put is in WEB-INF/lib of your webapp. Try that and it should work. -Vincent Mike On Wed, 2005-03-23 at 21:00 +0100, Vincent Massol wrote: Hi Mike, If you really want to try the tutorial as is without surprise I recommend using the suggest container, i.e. Tomcat 4.x (this is the first note of the page: This tutorial applies to Cactus 1.4 or greater and Tomcat 4.0 or greater.). Now if you're already familiar with Cactus and you want to make it work with JBoss 4.0 I have no idea but your problem seem to be one of classpath. In order to help you we would need the full stack trace. You're using the ServletTestRunner to start the Cactus tests, right? Are you using the J2EE 1.4 API or the 1.3 one (Cactus currently supports the 1.3 one only even though we have started implementing it for 1.4 and it's in 1.7 but it's not tested and not officially supported). Also, make sure you copy *all* Cactus-required libraries (for example the commons-httpclient version used in Cactus may be a newer version than the one shipped with JBoss 4.0.1). Thanks -Vincent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Losing Hair
Woohoo! :) Cela marche! Yes, on one hand: in the first place I didn't have all of the cactus jars in the JBoss paths as I was afraid they would mess with the JBoss ones (httpclient), but #2 it was the three jars that I left in the JBoss directory (with duplicates in WEB-INF/lib) that were messing things up. Keeping things clean, I don't put anything in CLASSPATH. Vince, clue me in... how do You find such bugs, is it just one of those hunches given the stack trace? I suppose if I placed _all_ (replacing ?old? JBoss ones) cactus jars at the JBoss scope it should work too (?). Wouldn't replacing the older version of commons-httpclient break JBoss? I now have to look into how to ant'ify the testing process; will look on the net as You suggested. Yes, the book is great, coming in very handy. I intend to use your PetStore version as my M.A.Sc of Eng. Thesis case-study :D Merci Beaucoup, Mike On Wed, 2005-03-23 at 21:51 +0100, Vincent Massol wrote: Hi Mike, -Original Message- From: Mike Sowka [mailto:[EMAIL PROTECTED] Sent: mercredi 23 mars 2005 21:45 To: Cactus Users List Subject: RE: Losing Hair Vincent, I tried the Quickstart app in order to trouble shoot Cactus+JBoss4, so yes I've already taken a good part of the week to familiarize myself with JUnit/Cactus with the help of your book (A BLESSING). Glad you liked it :-) Using Tomcat is out of the question as I'm interested purely in testing EJBs, but at this point I'm considering switching backwards to JBoss3 :|. That's correct, I'm using ServletTestRunner to start the tests. I've compiled the Quickstart app with 1.3 servlet.jar, and... I've copied all of the cactus jars in the WEB-INF/libs (just to be on the safe side, but I doubt this is proper practise). Here is the fool stack trace as reported by HTTP 500: javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.cactus.server.runner.ServletTestRunner or a class it depends on [snip] root cause java.lang.ClassNotFoundException: org.apache.cactus.server.runner.ServletTestRunner [snip] The error reported is different from the one I got before copying all of the cactus libs to WEB-INF/lib, it can at least find HttpServlet! ;) Any ideas? Merci, Classloaders are the hardest thing to understand and I believe you have a classloader issue here. Am I right in thinking that you have a cactus jar in your System classpath or in jboss somewhere? If so, remove the cactus jar from all CPs and make sure that the only place it is put is in WEB-INF/lib of your webapp. Try that and it should work. -Vincent Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Losing Hair
-Original Message- From: Mike Sowka [mailto:[EMAIL PROTECTED] Sent: mercredi 23 mars 2005 22:12 To: Cactus Users List Subject: RE: Losing Hair Woohoo! :) Cela marche! Yes, on one hand: in the first place I didn't have all of the cactus jars in the JBoss paths as I was afraid they would mess with the JBoss ones (httpclient), but #2 it was the three jars that I left in the JBoss directory (with duplicates in WEB-INF/lib) that were messing things up. Keeping things clean, I don't put anything in CLASSPATH. Vince, clue me in... how do You find such bugs, is it just one of those hunches given the stack trace? Experience... :-) To be honest this one is quite easy as it's a very common error. It has to do with the fact that if you put the cactus JAR in the system CL or any classloader higher in the hierarchy than the webapp classloader then when Cactus tries to instantiate your test class it fails because your test class is usually located in your WEB-INF/classes directory (thus in the webapp classloader). That said, it still works in some containers because those container sets the ContextClassLoader to be the webapp classloader and Cactus tries to load the user class is both the current classloader and in the context classloader too... ;-) I suppose if I placed _all_ (replacing ?old? JBoss ones) cactus jars at the JBoss scope it should work too (?). Nope, unless you also put your test classes there. Wouldn't replacing the older version of commons-httpclient break JBoss? I don't think so from the feedback I've had on the list. I now have to look into how to ant'ify the testing process; will look on the net as You suggested. Check the Ant integration page and use the cactus Ant task. However, before you ask :-), the cactus Ant task does not yet support JBoss 4.x (only JBoss 3.x - Someone has provided a patch but that's a bit involved if you want to apply it: http://issues.apache.org/jira/browse/CACTUS-152). That said you can use either a generic container or use the runservertests task. Check the doco online, it should get you started. Yes, the book is great, coming in very handy. I intend to use your PetStore version as my M.A.Sc of Eng. Thesis case-study :D Hey, great! -Vincent Merci Beaucoup, Mike On Wed, 2005-03-23 at 21:51 +0100, Vincent Massol wrote: Hi Mike, -Original Message- From: Mike Sowka [mailto:[EMAIL PROTECTED] Sent: mercredi 23 mars 2005 21:45 To: Cactus Users List Subject: RE: Losing Hair Vincent, I tried the Quickstart app in order to trouble shoot Cactus+JBoss4, so yes I've already taken a good part of the week to familiarize myself with JUnit/Cactus with the help of your book (A BLESSING). Glad you liked it :-) Using Tomcat is out of the question as I'm interested purely in testing EJBs, but at this point I'm considering switching backwards to JBoss3 :|. That's correct, I'm using ServletTestRunner to start the tests. I've compiled the Quickstart app with 1.3 servlet.jar, and... I've copied all of the cactus jars in the WEB-INF/libs (just to be on the safe side, but I doubt this is proper practise). Here is the fool stack trace as reported by HTTP 500: javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.cactus.server.runner.ServletTestRunner or a class it depends on [snip] root cause java.lang.ClassNotFoundException: org.apache.cactus.server.runner.ServletTestRunner [snip] The error reported is different from the one I got before copying all of the cactus libs to WEB-INF/lib, it can at least find HttpServlet! ;) Any ideas? Merci, Classloaders are the hardest thing to understand and I believe you have a classloader issue here. Am I right in thinking that you have a cactus jar in your System classpath or in jboss somewhere? If so, remove the cactus jar from all CPs and make sure that the only place it is put is in WEB- INF/lib of your webapp. Try that and it should work. -Vincent Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]