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 |
Jim Anderson 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 |
Larry Isaacs 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 #1403405 is a reply to message #1403313] |
Wed, 23 July 2014 13:00 |
Larry Isaacs 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 #1404208 is a reply to message #1404139] |
Wed, 30 July 2014 12:56 |
Jim Anderson 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 #1404239 is a reply to message #1403977] |
Wed, 30 July 2014 15:23 |
Larry Isaacs 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 |
Larry Isaacs 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
|
|
| |
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 |
Larry Isaacs 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
|
|
|
Goto Forum:
Current Time: Fri Apr 26 03:32:24 GMT 2024
Powered by FUDForum. Page generated in 0.03756 seconds
|