Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » [Resolved] Problem setting up tomcat7 server with Luna WTP(Tomcat7 is running, but eclipse WTP does not recognize it.)
[Resolved] Problem setting up tomcat7 server with Luna WTP [message #1403128] Mon, 21 July 2014 14:10 Go to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
Hi,

I have experience using Eclipse for C/C++ and java. I got a recommendation to use Eclipse for web development so I have started to investigate WTP in Luna. I'm having a problem with the startup.

I have started a 'helloworld' project and when creating the project, I had a screen similar to my first attachment, 'newDynamcicWebProject.png'. Note that in that screen shot, the tomcat7 server is designated as the 'target runtime'. The tomcat7 server is running and installed on my computer. When I originally brought up Eclipse, I went to [Windows --> preferences --> server --> runtime environment] screen and added the tomcat7 server to the runtime environment. So I think my instance of Eclipse should know about the tomcat7 server at this point.

I'm following the instructions for running an html program using WTP, and it says to select my html program, 'helloworld.html' and then right click and select [RunAs --> Run On Server]. When selected, the page shown in the 'runOnServerTomcat7.png' attachment is displayed. Note that in this screen shot, the server name is blank, and the only button available to click is the 'cancel' button, implying that the tomcat7 selection is not valid.

But on that same screen, if I click on the 'Tomcat v8.0 server' as shown in the 'runOnServerTomcat8.png' attachment, the server name appears and all of the buttons are enabled, implying tomcat 8 is a valid selection.

I'm confused because I have the tomcat7 server up and running but Eclipse does not seem to recognize that. But it does seem to recognize tomcat8 which it not installed nor running on my host.

Can anyone help explain how I can configure Eclipse to run using the tomcat7 server on my host?

Regards,
Jim Anderson

[Updated on: Thu, 31 July 2014 09:56] by Moderator

Report message to a moderator

Re: Problem setting up tomcat7 server with Luna WTP [message #1403274 is a reply to message #1403128] Mon, 21 July 2014 16:31 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/21/2014 10:11 AM, Jim Anderson wrote:
> Hi,
>
> I have experience using Eclipse for C/C++ and java. I got a recommendation to use Eclipse for web development so I have started to investigate WTP in Luna. I'm having a problem with the startup.
>
> I have started a 'helloworld' project and when creating the project, I had a screen similar to my first attachment, 'newDynamcicWebProject.png'. Note that in that screen shot, the tomcat7 server is designated as the 'target runtime'. The tomcat7 server is running and installed on my computer. When I originally brought up Eclipse, I went to [Windows --> preferences --> server --> runtime environment] screen and added the tomcat7 server to the runtime environment. So I think my instance of Eclipse should know about the tomcat7 server at this point.
>
> I'm following the instructions for running an html program using WTP, and it says to select my html program, 'helloworld.html' and then right click and select [RunAs --> Run On Server]. When selected, the page shown in the 'runOnServerTomcat7.png' attachment is displayed. Note that in this screen shot, the server name is blank, and the only button available to click is the 'cancel' button, implying that the tomcat7 selection is not valid.
>
> But on that same screen, if I click on the 'Tomcat v8.0 server' as shown in the 'runOnServerTomcat8.png' attachment, the server name appears and all of the buttons are enabled, implying tomcat 8 is a valid selection.
>
> I'm confused because I have the tomcat7 server up and running but Eclipse does not seem to recognize that. But it does seem to recognize tomcat8 which it not installed nor running on my host.
>
> Can anyone help explain how I can configure Eclipse to run using the tomcat7 server on my host?
>
> Regards,
> Jim Anderson
>

What happens if you try to define a new Tomcat 7 server using the
Servers view?

Cheers,
Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1403313 is a reply to message #1403274] Tue, 22 July 2014 20:45 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
I assume that by the 'Server view', you mean the 'Server' tab in the center of the lower window in 'main.screen.png' file that I have attached. If I click on the link "No servers are available. Click this link to create a new server.", I get directed to the same pages, 'runOnServerTomcat7.png' and 'runOnServerTomcat8.png' that I included with my original post.

It gives me an alternate way to get to the same problem, i.e. tomcat7 is not available.

Jim
Re: Problem setting up tomcat7 server with Luna WTP [message #1403405 is a reply to message #1403313] Wed, 23 July 2014 13:00 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/22/2014 4:45 PM, Jim Anderson wrote:
> I assume that by the 'Server view', you mean the 'Server' tab in the center of the lower window in 'main.screen.png' file that I have attached. If I click on the link "No servers are available. Click this link to create a new server.", I get directed to the same pages, 'runOnServerTomcat7.png' and 'runOnServerTomcat8.png' that I included with my original post.
>
> It gives me an alternate way to get to the same problem, i.e. tomcat7 is not available.
>
> Jim
>

Thanks. Since your screen shot seems to show a Linux OS, it the Tomcat
runtime created from a package install of Tomcat or a binary obtained
from tomcat.apache.org? If a package, try downloading a binary from
tomcat.apache.org. Some Tomcat packages are known to be setup in a way
that while they can serve as a Tomcat runtime, they aren't usable as a
server. Also, if this is the case, you will need to delete the current
Tomcat runtime before creating the new Tomcat runtime and server. There
is a quirk in the new server wizard in that it will try to create an
default initial server using the first Tomcat runtime it finds. If that
runtime is a "problem" one, like you may have, it can prevent the wizard
from working properly.

If you display the Error Log, you might see something related to the
assumed "problem" with your current Tomcat runtime. HTH.

Cheers,
Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1403645 is a reply to message #1403405] Thu, 24 July 2014 18:42 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member

I am running Linux and I had been running tomcat6, installed as a package. I recently had problems using Struts2, only to learn the problem was with my installed package. So recently I installed tomcat7 as a downloaded binary. This is the server I am currently running and I have complete removed from my system.

Since Luna was installed before tomcat6 was removed, I took the precaution to remove Luna and reinstall it. But I still get the same problem when I try to set the server, meaning I still get the images that I included with my original post, 'runOnServerTomcat7.png' and 'runOnServerTomcat8.png'.

Thanks for the suggestion.

Jim
Re: Problem setting up tomcat7 server with Luna WTP [message #1403702 is a reply to message #1403645] Fri, 25 July 2014 12:50 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/24/2014 2:42 PM, Jim Anderson wrote:
>
> I am running Linux and I had been running tomcat6, installed as a
> package. I recently had problems using Struts2, only to learn the
> problem was with my installed package. So recently I installed tomcat7
> as a downloaded binary. This is the server I am currently running and I
> have complete removed from my system.
>
> Since Luna was installed before tomcat6 was removed, I took the
> precaution to remove Luna and reinstall it. But I still get the same
> problem when I try to set the server, meaning I still get the images
> that I included with my original post, 'runOnServerTomcat7.png' and
> 'runOnServerTomcat8.png'.
>
> Thanks for the suggestion.
>
> Jim

I don't have any guesses as to what is unique with your setup that is
causing this. Is anything related showing up in the Error Log view?
Also, which version of Tomcat 7 are you using?

Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1403809 is a reply to message #1403702] Sun, 27 July 2014 22:10 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member

I am running tomcat 7.0.54.

I could not find an Error Log view. I looked at the documentation and it said that the error log view reports errors for plug-ins. I installed the eclipse luna binary on my PC, but I have not installed any plug-ins, so I don't think the Error Log view is available.

I have a 'Marker' view which has displayed some errors, but I have cleared up the errors and none are currently reported.
Jim A.
Re: Problem setting up tomcat7 server with Luna WTP [message #1403940 is a reply to message #1403809] Mon, 28 July 2014 16:20 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/27/2014 6:10 PM, Jim Anderson wrote:
>
> I am running tomcat 7.0.54.
>
> I could not find an Error Log view. I looked at the documentation and it
> said that the error log view reports errors for plug-ins. I installed
> the eclipse luna binary on my PC, but I have not installed any plug-ins,
> so I don't think the Error Log view is available.
>
> I have a 'Marker' view which has displayed some errors, but I have
> cleared up the errors and none are currently reported.
> Jim A.

The Error Log view in some perspectives can be shown with Window ->
"Show View" -> "Error Log". The Java EE perspective isn't one of them.
In this case, you use Window -> "Show View:" -> "Other..." ->
"General" -> "Error Log". You can also examine the ".log" file in your
"<workspace>/.metadata" folder, which is where the "Error Log" view gets
its input.

Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1403977 is a reply to message #1403809] Mon, 28 July 2014 21:19 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
Wow - quite a path to find the error log, but it was there as you indicated.
Thank you for the pointer.

There is a large amount of error messages, so I cannot get a screen shot that shows everything. I did one screenshot that shows the first batch of messages, but
unfortunately I had to truncate most of the 'plug-in' column to show you the
'message' column. The screen shot is attached as 'error.log.message.png'.

I'm hoping this gives you enough of a hint on what the problem may be. If needed,
I can send you the entire error log in pieces, but it will not be easy to patch the
pieces together if I go this route.

I also did a right click on one of the error messages and selected 'open log' and a '.log' view opened up. I copied and pasted this into an external text file, 'error07272014.log.txt' and I have attached that file. I have not done a thorough
comparison, but when I eye-ball it, it looks like the information from the
'error log' view is captured in this file.

Jim
Re: Problem setting up tomcat7 server with Luna WTP [message #1404139 is a reply to message #1403128] Tue, 29 July 2014 21:55 Go to previous messageGo to next message
Pablo Pellecchia is currently offline Pablo PellecchiaFriend
Messages: 1
Registered: July 2014
Junior Member
I also have a bug using Luna after i tried to configure a new tomcat 7 server. First i had this bug where when i select the tomcat 7 option on the [RunAs --> Run On Server] and the name text box still blank. I "solved" it deleting the

org.eclipse.jst.server.tomcat.core.prefs and

org.eclipse.wst.server.core.prefs

files on \workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings folder

I upgraded to Luna and now i'm facing the problem that when i select the RunAs --> Run On Server tab eclipse closes.

I'm working on Linux Mint. I attach de log file
Re: Problem setting up tomcat7 server with Luna WTP [message #1404208 is a reply to message #1404139] Wed, 30 July 2014 12:56 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
Pablo,

Thank you for the suggestion. Rather than deleting the two files that you mentioned,
I moved them out of the workspace in case I want to restore them later.

At this point, I am not sure if this change worked or not. The wizard did find my tomcat 7 server and now the server view shows:

Tomcat v7.0 Server at localhost [Stopped, Republish]

There were new errors in the 'Error Log' tab, so that is a positive. I'm not sure
what '[Stopped, Republish]' means at this point, but it does not seem like it
would be a normal message. To me it means that the tomcat server is not running.
I right clicked on the message and selected 'Clean Tomcat Work Directory' and got the
following message:

An error occurred while cleaning Tomcat v7.0 Server at localhost work directory.
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete.


As far as I know, my tomcat server is configured and working. I have been able to use it outside of Eclipse without a problem. My guess is that there is something in my Linux configuration (I am running CrunchBang Linux) that does not sit well with Eclipse. BTW, downloaded and installed a tomcat7 binary and did not install tomcat as a CrunchBang (Debian) package.

The above error message indicates to me that Eclipse was trying to load something from the tomcat 7 server but could not do it. Perhaps my version of the server does not have what Eclipse is looking for, or it found what is was looking for, but for some reason could not load it 'localhost-config'. I will have to research and see if
I can find what 'localhost-config' refers to. Possibly there is a permission problem and Eclipse did not have the privilege to read some of the tomcat7 area.

Jim
Re: Problem setting up tomcat7 server with Luna WTP [message #1404238 is a reply to message #1404139] Wed, 30 July 2014 15:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/29/2014 7:39 PM, Pablo Pellecchia wrote:
> I also have a bug using Luna after i tried to configure a new tomcat 7 server. First i had this bug where when i select the tomcat 7 option on the [RunAs --> Run On Server] and the name text box still blank. I "solved" it deleting the
>
> org.eclipse.jst.server.tomcat.core.prefs and
>
> org.eclipse.wst.server.core.prefs
>
> files on \workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings folder
>
> I upgraded to Luna and now i'm facing the problem that when i select the RunAs --> Run On Server tab eclipse closes.
>
> I'm working on Linux Mint. I attach de log file
>

It's crashing somewhere in GTK. I would try downloading a JRE or JDK
from Oracle. That appears to be what the Eclipse project uses for
testing. See:

http://www.eclipse.org/projects/project-plan.php?planurl=http://www.eclipse.org/eclipse/development/plans/eclipse_project_plan_4_4.xml#target_environments

Cheers,
Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1404239 is a reply to message #1403977] Wed, 30 July 2014 15:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/28/2014 5:19 PM, Jim Anderson wrote:
> Wow - quite a path to find the error log, but it was there as you indicated.
> Thank you for the pointer.
>
> There is a large amount of error messages, so I cannot get a screen shot that shows everything. I did one screenshot that shows the first batch of messages, but
> unfortunately I had to truncate most of the 'plug-in' column to show you the
> 'message' column. The screen shot is attached as 'error.log.message.png'.
>
> I'm hoping this gives you enough of a hint on what the problem may be. If needed,
> I can send you the entire error log in pieces, but it will not be easy to patch the
> pieces together if I go this route.
>
> I also did a right click on one of the error messages and selected 'open log' and a '.log' view opened up. I copied and pasted this into an external text file, 'error07272014.log.txt' and I have attached that file. I have not done a thorough
> comparison, but when I eye-ball it, it looks like the information from the
> 'error log' view is captured in this file.
>
> Jim
>

Of what you show, none of those errors are related to Server usage, so
no help there.

Based on your post to Pablo, you have confirmed that the problem is that
the WTP server support is unhappy with something about your Tomcat 7
installation. The difficulty is the error handling isn't cooperating
with showing what the underlying problem is.

I've played with this some and I think I have found an path to get the
underlying problem to show itself. Try following these steps:

1. Start or restart Eclipse and create a new workspace.
2. Go to the Servers view and click on the "create a new server" link
3. In the Define a New Server dialog, select "Tomcat v7.0 Server" and
click next.
4. In the Tomcat Server dialog, click Browse and select you Tomcat 7
directory.
5. Click Finish

A Server Error dialog should pop up saying your configuration "may be
corrupt or incomplete". This dialog should have a Details button.
Click on this button and the text displayed should state what it is
about your Tomcat 7 that it is unhappy with. If what is wrong isn't
clear, post back with what it says.

Cheers,
Larry
Re: Problem setting up tomcat7 server with Luna WTP [message #1404240 is a reply to message #1404208] Wed, 30 July 2014 15:23 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/30/2014 8:56 AM, Jim Anderson wrote:
> Pablo,
>
> Thank you for the suggestion. Rather than deleting the two files that
> you mentioned,
> I moved them out of the workspace in case I want to restore them later.
>
> At this point, I am not sure if this change worked or not. The wizard
> did find my tomcat 7 server and now the server view shows:
>
> Tomcat v7.0 Server at localhost [Stopped, Republish]
>
> There were new errors in the 'Error Log' tab, so that is a positive.
> I'm not sure
> what '[Stopped, Republish]' means at this point, but it does not seem
> like it
> would be a normal message. To me it means that the tomcat server is not
> running.

Jim

This is normal. The first item within "[]" is the state of the server,
i.e. Stopped, Starting, Started, Debugging, Stopping. The second item
indicates whether publishing is needed to apply changes in your
workspace to what Tomcat will be or is currently serving. For details
about the Tomcat support in WTP, see:

http://wiki.eclipse.org/WTP_Tomcat_FAQ.

> I right clicked on the message and selected 'Clean Tomcat Work
> Directory' and got the
> following message:
>
> An error occurred while cleaning Tomcat v7.0 Server at localhost work
> directory.
> Could not load the Tomcat server configuration at /Servers/Tomcat v7.0
> Server at localhost-config. The configuration may be corrupt or incomplete.
> Could not load the Tomcat server configuration at /Servers/Tomcat v7.0
> Server at localhost-config. The configuration may be corrupt or incomplete.

I have posted a response to your other thread to help determine the
underlying cause for this "The configuration may be corrupt or
incomplete" error.
>
> As far as I know, my tomcat server is configured and working. I have
> been able to use it outside of Eclipse without a problem. My guess is
> that there is something in my Linux configuration (I am running
> CrunchBang Linux) that does not sit well with Eclipse. BTW, downloaded
> and installed a tomcat7 binary and did not install tomcat as a
> CrunchBang (Debian) package.
>
> The above error message indicates to me that Eclipse was trying to load
> something from the tomcat 7 server but could not do it.

When you create a new Tomcat server, a copy of your Tomcat's current
configuration is made to a folder under the "Servers" folder in your
workspace. It is something with respect to the copied files that Eclipse
is having trouble dealing with.

> Perhaps my
> version of the server does not have what Eclipse is looking for, or it
> found what is was looking for, but for some reason could not load it
> 'localhost-config'. I will have to research and see if
> I can find what 'localhost-config' refers to.

The "/Servers/Tomcat v7.0 Server at localhost-config" is the path in
your workspace that the Tomcat configuration files were copied to. The
WTP server support keeps local copies of configuration files so that
they can be modified while the server is running without disturbing the
server. When you run or restart the server, these files will be copied
to the Tomcat instance so changes can take effect.

> Possibly there is a
> permission problem and Eclipse did not have the privilege to read some
> of the tomcat7 area.

That is a possible cause that could interfere with Server creation, i.e.
one of the required configuration files couldn't be copied. However, I
would not expect this to happen with a downloaded Tomcat binary.

Larry

>
> Jim
[Rsolved] Re: Problem setting up tomcat7 server with Luna WTP [message #1404333 is a reply to message #1404240] Thu, 31 July 2014 09:55 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member

Larry, I followed your instructions to restart Eclipse and start a new work space and everything worked fine! We can close this issues. I am a bit baffled as to why this would work now because I have restarted Eclipse and the workspace several times over the past week. But it works, repeatedly now, so I am a happy camper.

I do have a number of questions yet since I am still not at the point where I can run
code in WTP. My next steps are to go back to the tutorial and to do more reading of the documentation and hopefully that will get me up and running.

Thank your for your help and the others that have contributed to getting me past this issues.

Regards,
Jim
Re: [Rsolved] Re: Problem setting up tomcat7 server with Luna WTP [message #1404357 is a reply to message #1404333] Thu, 31 July 2014 13:20 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 7/31/2014 5:55 AM, Jim Anderson wrote:
>
> Larry, I followed your instructions to restart Eclipse and start a new
> work space and everything worked fine! We can close this issues. I am a
> bit baffled as to why this would work now because I have restarted
> Eclipse and the workspace several times over the past week. But it
> works, repeatedly now, so I am a happy camper.
>
> I do have a number of questions yet since I am still not at the point
> where I can run
> code in WTP. My next steps are to go back to the tutorial and to do more
> reading of the documentation and hopefully that will get me up and running.
>
> Thank your for your help and the others that have contributed to getting
> me past this issues.
>
> Regards,
> Jim

If the Tomcat FAQ doesn't cover something, feel free to ask. I forgot
to mention that based on your original post in the other thread, you
aren't using the Dynamic Web Project quite right. You may have already
discovered this, but you have placed the helloworld.html under the
project's "src" folder. This file should be under the "WebContent"
folder. Java code for your web application (i.e. servlets, listeners,
filters, etc.) would go under the "src" folder. The default is that the
Java classes will be compiled to "build/classes" in your project. When
the project gets published to the server, the files under
"build/classes" get copied to the "WEB-INF/classes" of the published
webapp. What's under the "WebContent" folder gets copied to the base of
the published webapp.

Cheers,
Larry
Previous Topic:Context docBase path being updated incorrectly
Next Topic:Eternal publishing in Tomcat
Goto Forum:
  


Current Time: Tue Apr 16 14:07:40 GMT 2024

Powered by FUDForum. Page generated in 1.36276 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top