Connection refused problems in Cactus+jetty+eclipse test

Source: Internet
Author: User
http://www.manning-sandbox.com/thread.jspa?messageID=483

Gastonw

Posts:1
registered:1/3/04
Using the Eclipse plugin for Cactus
Posted:jan 4, 1:25 PM
Reply

Hi

The say I am really enjoying JUnit in Action. It ' s been a great help to me in learning about JUnit and Cactus. I bought JUnit in Action mainly to learn about Cactus, and I ' ve currently read the book, downloaded the source and do Al L The examples up to Chapter 9. So far good.

Since I do most's my development and unit testing in Eclipse, I wanted to try running the examples from Chapter 9, using The Eclipse plugin, instead of Maven. Here are the steps I did:

1) from a clean workspace, imported the Junitbook-servlets, Junitbook-container (as a reference) and Junitbook-repository Projects from the ' JUnit in Action ' source into Eclipse.

2) downloaded and installed the last nightly builds for the two Eclipse plug-ins, jakarta-cactus-eclipse-webapp-20030909.z IP and Jakarta-cactus-eclipse-runner-13-1.6dev-20030907.zip. These were the latest builds I could find.

3) I added the jars to the Junitbook-servlets project as described in the Cactus Eclipse Plugin configuration at http: Jakarta.apache.org/cactus/integration/eclipse/index.html using the versions of the jars from the Junitbook-repository Project imported from the JUnit in Action source files.

Now for my question. What is the "next step" to run the Cactus unit tests in Eclipse with Jetty?

I tried running the Testadminservlet.java unit test by selecting it and selecting Run->run as->cactus test from th E menu, I get the following error:java.net.ConnectException:Connection Refused:connect.

The My guess is, this is, because Jetty did not start before the Cactus unit test ran.

Do I need to configure the Cactus plugin somehow to tell it to automatically start Jetty for me before running the Cactus Tests? Do I need to set up something into Cactus Preferences or in a Cactus properties file? I went to the prefences for Cactus and the checkbox for Jetty is checked.

(I was able to create a Testallwithjetty.java class and run the Cactus tests for Chapter 9 that way, but I ' d as to learn How to use the Eclipse plugin. i ' ve also searched through the book and the index, and although the plugin-mentioned several-places, I haven ' t found a Example on "How to" use it.)

I am I am I ' m overlooking something simple, and I hope all I need are a push in the right direction.

Much,
Gaston

Vmassol

Posts:51
Registered:12/7/03
"
re:using the Eclipse plugin for Cactus
Posted:jan 8 , 5:09 AM   in response to:gastonw
&n BSP; Reply

H I Gaston,

I ' m really glad you like the book!

WRT the Eclipse plugin for Cactus, your have to know this it is very experimental (it's one of the reason I didn ' t Expand on it in the book). However I do believe it's working at least with Jetty. Let me try it and come back to you (I'll need a few days-say 3-4 days).

I ' d also suggest we continue this discussion on the Cactus mailing list as it may is useful to others and they Also provide feedback about their own experience about using the Eclipse plugin.

"
-vincent

Vmassol

Posts:51
Registered:12/7/03
re:using the Eclipse plugin for Cactus
Posted:jan 7:33 AM in response to:gastonw
Reply

Hi Gaston,

appear to is doing everything right except one little item.

I believe the reason for the "java.net.ConnectException:Connection Refused:connect" error are because you haven ' t pro Vided a web.xml containing the Cactus redirectors. Need to right click your project and then select "Properties". Then go to the "Web Applications" entry and set the path to your Web.xml file (click Http://jakarta.apache.org/cactus/integr ation/eclipse/webapp_plugin.html).

Unfortunately, the Eclipse plugin currently does not automatically add the Cactus redirector so I ll need to add them manually in this file, as explained on http://jakarta.apache.org/cactus/integration/howto_config.html#serverside< br>

-vincent
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.