Re: Running Cactus tests in Eclipse
The cactus.properties file must be in the classpath. So you may change the file location and/or the build path in Eclipse so that it works. Hope it helps, Romain David Turley a écrit : At one point I was able to run my Cactus tests in Eclipse by starting up tomcat and running the tests as JUnit tests. Since then I changed my directory structure a bit to make things more sensible and convenient for the Ant integration, and now when I try to run an individual test in Eclipse, it complains about the cactus.contextURL. I have a cactus.properties file in my project's base directory, but something (the error and the fact that it doesn't work...;-) tells me that's not the right place... Where should I put it? What should I do with it? Is there another way to quickly run a test? It takes too long to build and cactify a war to make it convenient. Also, is anyone working on the Eclipse integration? I saw someone ask about downloading it a month ago or so, but there was never any response to his email. Thanks, David Turley - 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: Running Cactus tests in Eclipse
Hi Lawrence, Thanks for the info. I'll keep my eye on WTP and watch for Cactus integration. --David Lawrence Mandel wrote: Hi David, Wanted to let you know the Eclipse Web Tools Platform (WTP) project [1] has started working on Eclipse integration for Cactus. I've recently had some mailing list discussions (on cactus-dev) with the Cactus team (well, really with Vincent) about how Cactus and WTP can collaborate on this. The short story is there isn't currently much in the way of Cactus tooling in WTP but WTP should be able to pick up the slack on Cactus integration in Eclipse in the coming WTP releases. [1] http://www.eclipse.org/webtools Lawrence Mandel Software Developer IBM Rational Software Phone: 905 - 413 - 3814 Fax: 905 - 413 - 4920 [EMAIL PROTECTED] David Turley [EMAIL PROTECTED] 08/26/2005 04:51 PM Please respond to Cactus Users List To Cactus Users List cactus-user@jakarta.apache.org cc Subject Running Cactus tests in Eclipse At one point I was able to run my Cactus tests in Eclipse by starting up tomcat and running the tests as JUnit tests. Since then I changed my directory structure a bit to make things more sensible and convenient for the Ant integration, and now when I try to run an individual test in Eclipse, it complains about the cactus.contextURL. I have a cactus.properties file in my project's base directory, but something (the error and the fact that it doesn't work...;-) tells me that's not the right place... Where should I put it? What should I do with it? Is there another way to quickly run a test? It takes too long to build and cactify a war to make it convenient. Also, is anyone working on the Eclipse integration? I saw someone ask about downloading it a month ago or so, but there was never any response to his email. Thanks, David Turley - 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: Running Cactus tests in Eclipse
Okay, that makes sense. Thanks. Unfortunately that's not my only problem. For some reason I'm getting the following stack trace when I try to run my test cases: java.net.MalformedURLException: no protocol: /app/ServletRedirector at java.net.URL.init(URL.java:537) at java.net.URL.init(URL.java:434) at java.net.URL.init(URL.java:383) at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHelper.java:78) at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConnectionHelper.java:306) at org.apache.cactus.internal.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java) at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:162) at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:80) at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:306) at org.apache.cactus.internal.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java) at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runWebTest(HttpProtocolHandler.java:159) at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody0(HttpProtocolHandler.java:80) at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest_aroundBody1$advice(HttpProtocolHandler.java:306) at org.apache.cactus.internal.client.connector.http.HttpProtocolHandler.runTest(HttpProtocolHandler.java) at org.apache.cactus.internal.client.ClientTestCaseCaller.runTest(ClientTestCaseCaller.java:144) at org.apache.cactus.internal.AbstractCactusTestCase.runBareClient(AbstractCactusTestCase.java:215) at org.apache.cactus.internal.AbstractCactusTestCase.runBare(AbstractCactusTestCase.java:133) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) I have put all the servlet mapping stuff in my web.xml, but the error is the same with it in as it is without it. Anyone have any ideas why this is happening? It's probably something totally stupid I'm forgetting to do, but I can't figure it out :-P. Thanks, David Romain Thouvenin wrote: The cactus.properties file must be in the classpath. So you may change the file location and/or the build path in Eclipse so that it works. Hope it helps, Romain David Turley a écrit : At one point I was able to run my Cactus tests in Eclipse by starting up tomcat and running the tests as JUnit tests. Since then I changed my directory structure a bit to make things more sensible and convenient for the Ant integration, and now when I try to run an individual test in Eclipse, it complains about the cactus.contextURL. I have a cactus.properties file in my project's base directory, but something (the error and the fact that it doesn't work...;-) tells me that's not the right place... Where should I put it? What should I do with it? Is there another way to quickly run a test? It takes too long to build and cactify a war to make it convenient. Also, is anyone working on the Eclipse integration? I saw someone ask about downloading it a month ago or so, but there was never any response to his email. Thanks, David Turley - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running Cactus tests in Eclipse
-Original Message- From: David Turley [mailto:[EMAIL PROTECTED] Sent: lundi 29 août 2005 20:17 To: Cactus Users List Subject: Re: Running Cactus tests in Eclipse Please disregard that last email... It WAS something stupid. So stupid it would be too embarrassing to relate the problem. I realized the problem almost immediately after sending the message, but it was too late to call it back... Give me the prize for stupidity today :-). Don't worry! We're so happy when the problem is not a Cactus issue that we forgive you right away ;-) [snip - Deleted to prevent further embarrassment :-)] -Vincent ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running Cactus tests in Eclipse
Does anybody know how to make Cactus work with Jrun 3.0?? Thanks Anjali -Original Message- From: Vincent Massol [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 1:43 PM To: 'Cactus Users List' Subject: RE: Running Cactus tests in Eclipse -Original Message- From: David Turley [mailto:[EMAIL PROTECTED] Sent: lundi 29 août 2005 20:17 To: Cactus Users List Subject: Re: Running Cactus tests in Eclipse Please disregard that last email... It WAS something stupid. So stupid it would be too embarrassing to relate the problem. I realized the problem almost immediately after sending the message, but it was too late to call it back... Give me the prize for stupidity today :-). Don't worry! We're so happy when the problem is not a Cactus issue that we forgive you right away ;-) [snip - Deleted to prevent further embarrassment :-)] -Vincent ___ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com - 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]
More problems: Error finding class ...
Hello again, Yes, I'm still having problems, and most of them have nothing to do with computers. But this one does. When I first started playing with Cactus, I was just running things from Eclipse and the JUnit test runner, but then I wanted to automate things, so I spent a lot of time working with Ant. At first I had put my test classes in the same directories as the classes they were testing, but I decided that was messy and decided to make separate src and class directories for the test classes. That works great with ant because you could have your test classes on mars as long as you could tell ant where to find them. Not so with the JUnit integration in Eclipse. It cannot find my test classes. It worked fine when they were going to the WEB-INF/classes directory, but now they're in WEB-INF/test-classes and I get the following when I try to run tests: javax.servlet.ServletException: Error finding class [com.cleanbrain.cleantelligent.presentation.action.LoadActionCactusTest] using both the Context classloader and the webapp classloader. Possible causes include: - Your webapp does not include your test classes, - The cactus.jar is not located in your WEB-INF/lib directory and your Container has not set the Context classloader to point to the webapp one followed by the rest of the stack trace. Well, the cactus.jar is in the correct place. That's about all I know. I don't know much (anything) about classloaders, so maybe that's my problem. Maybe it's just another I.D.10T. error. :-) I'm learning Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: More problems: Error finding class ...
On Mon, 29 Aug 2005, David Turley wrote: Hi David, If you deploy that war, the classes NEED to be in WEB-INF/classes. You could also jar them up and put them in WEB-INF/lib/. Those are the only two places classes should be placed in web applications. If you run those classes directly from eclipse, you could add WEB-INF/test-classes as a source folder (or, if you have a separate source folder for the test-classes sources, modify .classpath and specify an output=.../WEB-INF/test-classes to the correct line; can't edit them from within eclipse). But, in the war, they really NEED to be in the classpath or else the Webapp classloader won't find them! And it really doesn't matter where your classes are, as long as your sources are nicely organized. HTH, Kenney Hello again, Yes, I'm still having problems, and most of them have nothing to do with computers. But this one does. When I first started playing with Cactus, I was just running things from Eclipse and the JUnit test runner, but then I wanted to automate things, so I spent a lot of time working with Ant. At first I had put my test classes in the same directories as the classes they were testing, but I decided that was messy and decided to make separate src and class directories for the test classes. That works great with ant because you could have your test classes on mars as long as you could tell ant where to find them. Not so with the JUnit integration in Eclipse. It cannot find my test classes. It worked fine when they were going to the WEB-INF/classes directory, but now they're in WEB-INF/test-classes and I get the following when I try to run tests: javax.servlet.ServletException: Error finding class [com.cleanbrain.cleantelligent.presentation.action.LoadActionCactusTest] using both the Context classloader and the webapp classloader. Possible causes include: - Your webapp does not include your test classes, - The cactus.jar is not located in your WEB-INF/lib directory and your Container has not set the Context classloader to point to the webapp one followed by the rest of the stack trace. Well, the cactus.jar is in the correct place. That's about all I know. I don't know much (anything) about classloaders, so maybe that's my problem. Maybe it's just another I.D.10T. error. :-) I'm learning Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: More problems: Error finding class ...
Hi Kenney, You said that if I'm running the classes straight from Eclipse (which I am) I could add WEB-INF/classes as a src directory. I have the test source directories added as source directories with the correct output folders. Here are the lines from my .classpath file: classpathentry excluding=**/CVS/ kind=src path=src/ classpathentry excluding=**/CVS/ output=web/WEB-INF/test-classes/cactus-classes kind=src path=test/cactus-src/ classpathentry excluding=**/CVS/ output=web/WEB-INF/test-classes/junit-classes kind=src path=test/junit-src/ Is that sort of what you meant? Should that work? It doesn't, unfortunately. If you can't see anything wrong with that, I'll just have Eclipse output my test classes into WEB-INF/classes... I'd rather not. Maybe I'm just stubborn. When I think something SHOULD work, I want it to :-). Kenney Westerhof wrote: On Mon, 29 Aug 2005, David Turley wrote: Hi David, If you deploy that war, the classes NEED to be in WEB-INF/classes. You could also jar them up and put them in WEB-INF/lib/. Those are the only two places classes should be placed in web applications. If you run those classes directly from eclipse, you could add WEB-INF/test-classes as a source folder (or, if you have a separate source folder for the test-classes sources, modify .classpath and specify an output=.../WEB-INF/test-classes to the correct line; can't edit them from within eclipse). But, in the war, they really NEED to be in the classpath or else the Webapp classloader won't find them! And it really doesn't matter where your classes are, as long as your sources are nicely organized. HTH, Kenney Hello again, Yes, I'm still having problems, and most of them have nothing to do with computers. But this one does. When I first started playing with Cactus, I was just running things from Eclipse and the JUnit test runner, but then I wanted to automate things, so I spent a lot of time working with Ant. At first I had put my test classes in the same directories as the classes they were testing, but I decided that was messy and decided to make separate src and class directories for the test classes. That works great with ant because you could have your test classes on mars as long as you could tell ant where to find them. Not so with the JUnit integration in Eclipse. It cannot find my test classes. It worked fine when they were going to the WEB-INF/classes directory, but now they're in WEB-INF/test-classes and I get the following when I try to run tests: javax.servlet.ServletException: Error finding class [com.cleanbrain.cleantelligent.presentation.action.LoadActionCactusTest] using both the Context classloader and the webapp classloader. Possible causes include: - Your webapp does not include your test classes, - The cactus.jar is not located in your WEB-INF/lib directory and your Container has not set the Context classloader to point to the webapp one followed by the rest of the stack trace. Well, the cactus.jar is in the correct place. That's about all I know. I don't know much (anything) about classloaders, so maybe that's my problem. Maybe it's just another I.D.10T. error. :-) I'm learning Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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: More problems: Error finding class ...
On Mon, 29 Aug 2005, David Turley wrote: Well client side it works fine, your setup is OK. However, you got a ServletException, indicating a server side error. And server side, those classes really can't be found. Even if they're in WEB-INF/classes/. Say you have com.mycompany.TestClass in WEB-INF/classes/test-classes/com/mycompany/TestClass.class. The webservice can't find that class because it's in the wrong dir. It looks for WEB-INF/classes/com/mycompany/TestClass.class. So in the server-side war you can only have those classes in WEB-INF/classes DIRECTLY, no extra directories! I suggest you just put all jars in WEB-INF/classes. Doesn't really matter where they are; if you are debugging, you can see the source location anyway which tells you immediately what kind of source it is. -- Kenney Hi Kenney, You said that if I'm running the classes straight from Eclipse (which I am) I could add WEB-INF/classes as a src directory. I have the test source directories added as source directories with the correct output folders. Here are the lines from my .classpath file: classpathentry excluding=**/CVS/ kind=src path=src/ classpathentry excluding=**/CVS/ output=web/WEB-INF/test-classes/cactus-classes kind=src path=test/cactus-src/ classpathentry excluding=**/CVS/ output=web/WEB-INF/test-classes/junit-classes kind=src path=test/junit-src/ Is that sort of what you meant? Should that work? It doesn't, unfortunately. If you can't see anything wrong with that, I'll just have Eclipse output my test classes into WEB-INF/classes... I'd rather not. Maybe I'm just stubborn. When I think something SHOULD work, I want it to :-). Kenney Westerhof wrote: On Mon, 29 Aug 2005, David Turley wrote: Hi David, If you deploy that war, the classes NEED to be in WEB-INF/classes. You could also jar them up and put them in WEB-INF/lib/. Those are the only two places classes should be placed in web applications. If you run those classes directly from eclipse, you could add WEB-INF/test-classes as a source folder (or, if you have a separate source folder for the test-classes sources, modify .classpath and specify an output=.../WEB-INF/test-classes to the correct line; can't edit them from within eclipse). But, in the war, they really NEED to be in the classpath or else the Webapp classloader won't find them! And it really doesn't matter where your classes are, as long as your sources are nicely organized. HTH, Kenney Hello again, Yes, I'm still having problems, and most of them have nothing to do with computers. But this one does. When I first started playing with Cactus, I was just running things from Eclipse and the JUnit test runner, but then I wanted to automate things, so I spent a lot of time working with Ant. At first I had put my test classes in the same directories as the classes they were testing, but I decided that was messy and decided to make separate src and class directories for the test classes. That works great with ant because you could have your test classes on mars as long as you could tell ant where to find them. Not so with the JUnit integration in Eclipse. It cannot find my test classes. It worked fine when they were going to the WEB-INF/classes directory, but now they're in WEB-INF/test-classes and I get the following when I try to run tests: javax.servlet.ServletException: Error finding class [com.cleanbrain.cleantelligent.presentation.action.LoadActionCactusTest] using both the Context classloader and the webapp classloader. Possible causes include: - Your webapp does not include your test classes, - The cactus.jar is not located in your WEB-INF/lib directory and your Container has not set the Context classloader to point to the webapp one followed by the rest of the stack trace. Well, the cactus.jar is in the correct place. That's about all I know. I don't know much (anything) about classloaders, so maybe that's my problem. Maybe it's just another I.D.10T. error. :-) I'm learning Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - 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] -- Kenney Westerhof http://www.neonics.com GPG public key: http://www.gods.nl/~forge/kenneyw.key - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]