facebook

Run multiple tomcat instances of different ports within IDE

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #343947 Reply

    Zenith.Nu
    Member

    In an Eclipse Java EE distro, I am able to create a Tomcat runtime and then create instances of that runtime. These instances can run on separate ports, have separate contexts, their own classpath, etc.

    I am able to create Tomcat servers in MyEclipse, but I am not able to find a way to specify separate instances to run on separate ports.

    MyEclipse 6.5 Blue Edition seems to have this functionality (see here http://www.myeclipseide.com/module-htmlpages-display-pid-357.html#multi).

    Does MyEclipse 2013 Professional Edition have similar functionality to achieve this for Tomcat?

    Just so it is clear, while editing the server config files directly is an option, I was wondering if an equivalent to the Eclipse approach (which is more modular and cleaner) was available.

    Thanks

    #343958 Reply

    Zenith,

    MyEclipse 6.5 Blue Edition seems to have this functionality (see here http://www.myeclipseide.com/module-htmlpages-display-pid-357.html#multi).

    The above link explains how to add multiple server instances for Websphere application server. This cannot be achieved with Tomcat server.

    However there is another approach to add multiple instances of Tomcat server in MyEclipse. Please follow these steps to add multiple tomcat instances with different ports in MyEclipse :
    1) You need to first set up multiple tomcat instances. Please take a look at this link which explains how to create multiple tomcat instances.
    2) Open MyEclipse, goto Window > Preferences > MyEclipse > Servers > Tomcat > Tomcat 7.x, browse the main tomcat location , select ‘Enable’ and click ‘Apply’ and ok. This will add Tomcat 7.x server to servers view.
    3) To add multiple instances of Tomcat 7.x, click the “Create Launch Configuration” button on the Launch page of the server connector configuration (Right click on tomcat 7.x server > select Configure server connector > Tomcat 7.x > Launch).
    4) On the configuration dialog, select ‘Arguments’ tab and change the -Dcatalina.base (under VM Arguments section) to the tomcat instance created in step 1.
    5) (Optional) Change the deployment base directory under server tab.
    6) Finally click on Apply and Run.

    This is the only way you can add multiple instances of Tomcat to MyEclipse. Hope this helps and let us know how it works for you.

    #347891 Reply

    razorSpirit
    Member

    I followed this procedure in this thread and I was able to configure multiple tomcat, however, I was not able to run each one. Apparently, each of my individual tomcat directories are missing something? I know eclipse is not issuing the startup.bat. Exactly what command is eclipse issuing to run tomcat? Outside of the directories: conf,logs,temp,work,webapps – what do I need? I used the following link to set up my separate tomcat instances, but no luck!

    Like to recommend myeclipse to the rest of my company but this issue needs to be resolved.

    regards, Tony

    #347914 Reply

    Tony,

    Can you please follow these steps (that I have followed) to run multiple tomcat instances with different port numbers within MyEclipse –
    1. Download ‘Apache Tomcat 7.x’ and extract it to folder named – ‘Tomcat-1’. (In my case the folder structure is C:\Servers\Tomcat-1\bin)
    2. Copy ‘webapps’,’temp’ and ‘conf’ folders from the above extracted zip file and paste it in a new folder named ‘Tomcat-2’. (The folder structure would be C:\Servers\Tomcat-2\conf)
    3. Open Tomcat-2\conf\server.xml file and make the changes mentioned in this video (2:34 to 2:45) and save the file.
    4. Open MyEclipse and navigate to Window > Preferences > MyEclipse > Servers > Tomcat > Tomcat 7.x > click ‘browse’ for ‘Tomcat home directory’ and select the folder ‘Tomcat-1’ > Select Enable > Click Apply > Expand Tomcat 7.x in the Preferences > select launch > click on ‘Create Launch configuration’, which opens ‘Debug configurations’ window.
    5. Change the Deployment base directory in the ‘Server’ tab to C:\Servers\Tomcat-2\webapps
    6. Select ‘Arguments’ tab and change -Dcatalina.base=C:\Servers\Tomcat-1 to -Dcatalina.base=C:\Servers\Tomcat-2
    7. Click Apply and Close.
    8. You will see two Tomcat instances named tomcat 7.x and tomcat 7.x [‘custom] created in servers view.

    Try running both the tomcat instances and let us know how it works for you.

    #348818 Reply

    razorSpirit
    Member

    Pradeep,

    Yes. That worked. Thanks.

    My mistake was that I was changing all the Apache Tomcat 7.0.11-ONE VM arguments
    to Apache Tomcat 7.0.11-TWO on my second tomcat installation.

    Here’s my working configuration:

    VM argruments:
    For Tomcat 7.0.11-ONE
    -Dcatalina.home=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE”
    -Dcatalina.base=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE”
    -Djava.endorsed.dirs=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE/common/endorsed”
    -Djava.io.tmpdir=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE/temp”
    -Djava.library.path=”C:/glassfish3/jdk/bin;D:/development/tomcats/Apache Tomcat 7.0.11-ONE/bin”

    For Tomcat 7.0.11-TWO
    -Dcatalina.home=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE”
    -Dcatalina.base=”D:/development/tomcats/Apache Tomcat 7.0.11-TWO”
    -Djava.endorsed.dirs=”D:/development/tomcats/Apache Tomcat 7.0.11-ONE/common/endorsed”
    -Djava.io.tmpdir=”D:/development/tomcats/Apache Tomcat 7.0.11-TWO/temp”
    -Djava.library.path=”C:/glassfish3/jdk/bin;D:/development/tomcats/Apache Tomcat 7.0.11-ONE/bin”

    #348827 Reply

    Tony,

    Glad that you got it working and thanks for posting your working configuration which might help other users who are having trouble with this.
    Let us know if you see any issues or have any further questions on MyEclipse.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Run multiple tomcat instances of different ports within IDE

You must be logged in to post in the forum log in