Eclipse - cannot create tomcat server

Discussion in 'Java' started by Laura Schmidt, Oct 27, 2012.

  1. Hello,

    I had a working configuration with eclipse (Juno) and tomcat 6. Then, I
    wanted to switch to tomcat 7 and modified my configuration. Now, I have
    no working tomcat server within eclipse.

    There are two tomcat installations under /opt:

    drwxr-xr-x 9 root root 4096 Oct 2 05:45 apache-tomcat-6.0.29
    drwxr-xr-x 9 root root 4096 Oct 2 05:43 apache-tomcat-7.0.30

    I always used the tomcat 6 installation without problems.

    Within eclipse, I am able to define a runtime configuration for both
    tomcat installations:

    Window -> Preferences -> Server -> Runtime Configurations

    For example, I can define a new runtime configuration like this:

    Name: "Apache Tomcat v6.0"
    Directory: /opt/apache-tomcat-6.0.29

    (Same vor tomcat 7).

    So far, so good. But when I try to define a server, I run into problems:

    File -> New -> Other -> Server -> Server

    I can choose the server type, e. g.:

    Tomcat v6.0 Server or
    Tomcat v7.0 Server

    The server's host name is preset to "localhost".
    The server's name is empty and I cannot edit it (disabled).

    The "Next" and "Finish" buttons are disabled.

    So I cannot define a new tomcat server.

    Remember: I had a working configuration, where I could run my dynamic
    web projects with "Run -> Run on Server", and the only thing I did was
    to remove the tomcat 6 server.

    What is the problem here?

    I would be glad if some experts could help me.

    Thank you a lot!
    Laura
    Laura Schmidt, Oct 27, 2012
    #1
    1. Advertising

  2. Laura Schmidt

    Arne Vajhøj Guest

    On 10/27/2012 11:39 AM, Laura Schmidt wrote:
    > I had a working configuration with eclipse (Juno) and tomcat 6. Then, I
    > wanted to switch to tomcat 7 and modified my configuration. Now, I have
    > no working tomcat server within eclipse.
    >
    > There are two tomcat installations under /opt:
    >
    > drwxr-xr-x 9 root root 4096 Oct 2 05:45 apache-tomcat-6.0.29
    > drwxr-xr-x 9 root root 4096 Oct 2 05:43 apache-tomcat-7.0.30
    >
    > I always used the tomcat 6 installation without problems.
    >
    > Within eclipse, I am able to define a runtime configuration for both
    > tomcat installations:
    >
    > Window -> Preferences -> Server -> Runtime Configurations
    >
    > For example, I can define a new runtime configuration like this:
    >
    > Name: "Apache Tomcat v6.0"
    > Directory: /opt/apache-tomcat-6.0.29
    >
    > (Same vor tomcat 7).
    >
    > So far, so good. But when I try to define a server, I run into problems:
    >
    > File -> New -> Other -> Server -> Server
    >
    > I can choose the server type, e. g.:
    >
    > Tomcat v6.0 Server or
    > Tomcat v7.0 Server
    >
    > The server's host name is preset to "localhost".
    > The server's name is empty and I cannot edit it (disabled).
    >
    > The "Next" and "Finish" buttons are disabled.
    >
    > So I cannot define a new tomcat server.
    >
    > Remember: I had a working configuration, where I could run my dynamic
    > web projects with "Run -> Run on Server", and the only thing I did was
    > to remove the tomcat 6 server.
    >
    > What is the problem here?
    >
    > I would be glad if some experts could help me.


    Not an answer to your question.

    But have you considered whether you really need that integration?

    I always run Eclipse and Tomcat completely separate and then
    use ant to build and deploy to Tomcat.

    Ant is integrated fine in Eclipse. And I like the
    separation.

    Arne
    Arne Vajhøj, Oct 27, 2012
    #2
    1. Advertising

  3. On 10/27/2012 05:49 PM, Arne Vajhøj wrote:
    > On 10/27/2012 11:39 AM, Laura Schmidt wrote:


    > Not an answer to your question.
    >
    > But have you considered whether you really need that integration?
    >
    > I always run Eclipse and Tomcat completely separate and then
    > use ant to build and deploy to Tomcat.
    >
    > Ant is integrated fine in Eclipse. And I like the
    > separation.


    Hello Arne,

    I am used to test my site with "Run -> Run on Server" locally, before
    deploying it with ant.

    Without a local server one would have to use the deployment server for
    testing.

    Laura
    Laura Schmidt, Oct 27, 2012
    #3
  4. Laura Schmidt

    Arne Vajhøj Guest

    On 10/27/2012 1:20 PM, Laura Schmidt wrote:
    > On 10/27/2012 05:49 PM, Arne Vajhøj wrote:
    >> On 10/27/2012 11:39 AM, Laura Schmidt wrote:

    >
    >> Not an answer to your question.
    >>
    >> But have you considered whether you really need that integration?
    >>
    >> I always run Eclipse and Tomcat completely separate and then
    >> use ant to build and deploy to Tomcat.
    >>
    >> Ant is integrated fine in Eclipse. And I like the
    >> separation.

    >
    > Hello Arne,
    >
    > I am used to test my site with "Run -> Run on Server" locally, before
    > deploying it with ant.
    >
    > Without a local server one would have to use the deployment server for
    > testing.


    You can deploy to a local test Tomcat on your PC with ant.

    Arne
    Arne Vajhøj, Oct 27, 2012
    #4
  5. On 10/27/2012 12:39 PM, Laura Schmidt wrote:
    > Hello,
    >
    > I had a working configuration with eclipse (Juno) and tomcat 6. Then, I
    > wanted to switch to tomcat 7 and modified my configuration. Now, I have
    > no working tomcat server within eclipse.
    >
    > There are two tomcat installations under /opt:
    >
    > drwxr-xr-x 9 root root 4096 Oct 2 05:45 apache-tomcat-6.0.29
    > drwxr-xr-x 9 root root 4096 Oct 2 05:43 apache-tomcat-7.0.30
    >
    > I always used the tomcat 6 installation without problems.
    >
    > Within eclipse, I am able to define a runtime configuration for both
    > tomcat installations:
    >
    > Window -> Preferences -> Server -> Runtime Configurations
    >
    > For example, I can define a new runtime configuration like this:
    >
    > Name: "Apache Tomcat v6.0"
    > Directory: /opt/apache-tomcat-6.0.29
    >
    > (Same vor tomcat 7).
    >
    > So far, so good. But when I try to define a server, I run into problems:
    >
    > File -> New -> Other -> Server -> Server
    >
    > I can choose the server type, e. g.:
    >
    > Tomcat v6.0 Server or
    > Tomcat v7.0 Server
    >
    > The server's host name is preset to "localhost".
    > The server's name is empty and I cannot edit it (disabled).
    >
    > The "Next" and "Finish" buttons are disabled.
    >
    > So I cannot define a new tomcat server.
    >
    > Remember: I had a working configuration, where I could run my dynamic
    > web projects with "Run -> Run on Server", and the only thing I did was
    > to remove the tomcat 6 server.
    >
    > What is the problem here?
    >
    > I would be glad if some experts could help me.
    >
    > Thank you a lot!
    > Laura


    I don't know exactly what the problem is, but Eclipse (any version) is
    buggy just like any other piece of software. Anyone who has done dozens
    or hundreds of server definitions in Eclipse has eventually seen all
    sorts of problems.

    Yet, with the exception of completely unsupported servers/versions, if
    it's on the list of server adapters you can make it work - ultimately.
    And any combinations thereof.

    I had a pristine Eclipse Juno on my new OpenSUSE setup so I just now
    installed Tomcat 7 on JDK 7, and then Tomcat 6 on JDK 6. I did
    everything from the Windows->Preferences->Server->Runtime Environments
    menu, including checking "Create a new local server" so that I didn't
    have to do it under the Servers tab later.

    This was just to remind myself of the steps in a successful
    configuration of 2 versions of Tomcat.

    My feeling is that you may have to take things back to a clean slate.
    Download and unzip a new Eclipse Juno if you have to, it's not painful
    these days.

    One related note on Eclipse server configurations: I've never had a good
    time with the default Server overview setting of "Use workspace
    metadata" for Server Locations.

    A note regarding deployment options: don't forget that you always have
    IDE options to export work as WAR's, JAR's or EAR's. I often do Tomcat
    or other Java app server app deployments through their management
    consoles, using a WAR or EAR. Sometimes this is the only way I can do
    it, actually. But it's never a bad way to do it, because in production
    that's how operations staff will often deploy new builds.

    AHS
    Arved Sandstrom, Oct 27, 2012
    #5
  6. On 10/27/2012 11:10 PM, Arved Sandstrom wrote:
    > On 10/27/2012 12:39 PM, Laura Schmidt wrote:


    > Yet, with the exception of completely unsupported servers/versions, if
    > it's on the list of server adapters you can make it work - ultimately.
    > And any combinations thereof.


    Well, it worked out of the box when I created it. There was nothing
    special about it.

    > My feeling is that you may have to take things back to a clean slate.
    > Download and unzip a new Eclipse Juno if you have to, it's not painful
    > these days.


    After of your posting, I reinstalled eclipse, but without effects. When
    I then first started eclipse, I found an old Tomcat 6 runtime
    definition. So I assume that all this stuff must be stored within the
    workspace.

    So creating a new workspace would be another idea. But I don't want to
    make all the editor settings again (and I don't know how to
    export/import them).

    Another point is: I am able to successfully create a new tomcat server
    when I install eclipse as root. #-)

    > A note regarding deployment options: don't forget that you always have
    > IDE options to export work as WAR's, JAR's or EAR's.


    Yes, this is what I do when I deploy things onto the productive server.
    But for a quick test I always used "Run -> Run on server".

    Laura
    Laura Schmidt, Oct 27, 2012
    #6
  7. On 10/27/2012 07:20 PM, Laura Schmidt wrote:
    > On 10/27/2012 11:10 PM, Arved Sandstrom wrote:
    >> On 10/27/2012 12:39 PM, Laura Schmidt wrote:

    >
    >> Yet, with the exception of completely unsupported servers/versions, if
    >> it's on the list of server adapters you can make it work - ultimately.
    >> And any combinations thereof.

    >
    > Well, it worked out of the box when I created it. There was nothing
    > special about it.


    No, there wouldn't have been. But with an application as complicated as
    Eclipse there have got to be a whole bunch of buggy execution paths. And
    sooner or later the complicated state machine that backs up the GUI will
    get out of whack...which is why you had buttons that showed up disabled
    when they ought to have been enabled.

    If IDE restarts or trying different means to the same end don't work,
    then cleaning ferociously is sometimes the only option.

    I tend to avoid using Eclipse (or NB) for certain things, like
    complicated version control tasks, some SOAP web services tasks, WAR/EAR
    deployment etc. Too many problems over the years. YMMV.

    >> My feeling is that you may have to take things back to a clean slate.
    >> Download and unzip a new Eclipse Juno if you have to, it's not painful
    >> these days.

    >
    > After of your posting, I reinstalled eclipse, but without effects. When
    > I then first started eclipse, I found an old Tomcat 6 runtime
    > definition. So I assume that all this stuff must be stored within the
    > workspace.
    >
    > So creating a new workspace would be another idea. But I don't want to
    > make all the editor settings again (and I don't know how to
    > export/import them).


    I tend to use the vanilla settings myself (with the exception of a
    handful of settings like "show line numbers" that are trivial). I'm
    aware though of the generalities if Eclipse settings export/import.

    If you look at IDE options under Preferences, e.g. Java->Code Style
    options, you'll see that a number of option groups have import/export
    capability.

    Also, while this is dated
    (http://eclipse.dzone.com/news/create-new-eclipse-workspace-w) I suspect
    that experimentation along the lines of the article will work for Indigo
    or Juno also. This is probably more what you want.

    > Another point is: I am able to successfully create a new tomcat server
    > when I install eclipse as root. #-)
    >
    >> A note regarding deployment options: don't forget that you always have
    >> IDE options to export work as WAR's, JAR's or EAR's.

    >
    > Yes, this is what I do when I deploy things onto the productive server.
    > But for a quick test I always used "Run -> Run on server".
    >
    > Laura


    I agree that for Tomcat in particular this is nice to be able to do.

    AHS
    Arved Sandstrom, Oct 28, 2012
    #7
  8. SOLVED: Eclipse - cannot create tomcat server

    Hi,

    maybe it helps someone. This is the solution:

    chmod -R o+r /opt/apache-tomcat-7.0.30

    (It would have saved me many hours if eclipse prompted a comprehensive
    error message.)

    Laura
    Laura Schmidt, Oct 31, 2012
    #8
  9. Laura Schmidt

    markspace Guest

    Re: SOLVED: Eclipse - cannot create tomcat server

    On 10/31/2012 11:00 AM, Laura Schmidt wrote:
    > Hi,
    >
    > maybe it helps someone. This is the solution:
    >
    > chmod -R o+r /opt/apache-tomcat-7.0.30
    >
    > (It would have saved me many hours if eclipse prompted a comprehensive
    > error message.)



    Curious: how did you determine this might be the problem?

    I agree that error messages could often be better, but I'm interested
    what tipped you off that the issue was user permissions.
    markspace, Oct 31, 2012
    #9
  10. Re: SOLVED: Eclipse - cannot create tomcat server

    On 10/31/2012 07:18 PM, markspace wrote:

    > Curious: how did you determine this might be the problem?


    > I agree that error messages could often be better, but I'm interested
    > what tipped you off that the issue was user permissions.


    I found that creating a tomcat server worked fine when eclipse was
    started as root. And the only relevant difference is that root has full
    access to the tomcat folder and files.

    Laura
    Laura Schmidt, Nov 5, 2012
    #10
  11. Re: SOLVED: Eclipse - cannot create tomcat server

    On 11/03/2012 05:20 PM, jebblue wrote:
    > On Wed, 31 Oct 2012 19:00:00 +0100, Laura Schmidt wrote:


    > For your solution I'm not clear you won't run into new problems
    > by having Tomcat located in /opt but it might be fine.


    What do you think could be problems resulting from the location of tomcat?

    Laura
    Laura Schmidt, Nov 5, 2012
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page