views:

1835

answers:

4

Eclipse WTP creates its own server.xml file which it places in some folder which configures the tomcat instance you are running for your web project. If you double click on the server in the servers list you get a nice screen which makes it simple to configure some aspects of the server.xml file.

How do I configure a new connection to allow SSL connections on port 8443. Everytime I edit the server.xml file manually, eclipse overwrites my changes with the settings it has stored in the server properties page of the configuration and it seems there is no way to add a new connector from the interface that eclipse provides.

Is this possible? Here is the connector I want to add:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    keystoreFile="D:\apache-tomcat-6.0.18\keystore\key.ssl" keystorePass="pass"
    clientAuth="false" sslProtocol="TLS" />
+1  A: 

I figured it out. When you first create a new server in the Servers view by right clicking in it and selecting New > Server. Eclipse WTP takes your existing server.xml file from the tomcat installation and creates the new server.xml file for your project using the original as a template.

If you modify the original server.xml with the configuration you need BEFORE creating a new server in eclipse you will retain those settings.

It's too bad eclipse doesn't allow adding these types of configurations after the fact.

Peter D
+2  A: 

If you've already created the server, you can edit the server.xml template it copies. If you use the project explorer, It is under Other Projects->Servers->->server.xml

yincrash
+1  A: 

You should configure Eclipse to use the Tomcat installation instead of using workspace metadata. In the servers view, doubleclick the Tomcat instance in question, in the section Server locations you need to check Use Tomcat installation. This way the changes from either side will be reflected in both sides, instead of that one overwrites the other.

Note: if this section is grayed out, please read the head of this section: "Server must be published with no modules present to make changes." ;)

This should remove almost everyone's (ignorant) rant about "weird issues" with Tomcat in Eclispe.

BalusC
A: 

Just wanted to point out that yincrash's method works perfectly (but don't have enough rep to mod it up). Just edit the server.xml from Project Explorer -> Servers -> [your server] -> server.xml.

Janne Jalkanen