Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » eclipse/tomcat server/port confusion
eclipse/tomcat server/port confusion [message #216233] Thu, 26 June 2008 18:07 Go to next message
Eclipse User
Originally posted by: cuco2772.gmail.com

Hi everybody. I'm stuck again and looking for some helpful advice.
I'm not understanding the following behaviour:
If I start tomcat, ie /usr/share/tomcat5.5/bin/startup.sh,
then go to localhost:8080, I get the the apache-tomcat-5.5.26 page
you'd expect on startup. Then I go to eclipse and try to run the server by
clicking the start arrow where it says Tomcat v5.5 Server @ localhost.
That will generate the following error from eclipse:

'Several ports (8005, 8009) rerquired be Tomcat v5.5 Server @ localhost
are already in use. The server may already be running in another process,
or system processes may be using the port. To start this server you will
need to stop the other proceses or change the port number(s).'

So then if I shutdown tomcat (from the command line, not within eclipse),
then go back to eclipse and click the green start arrow to start the server
within eclipse again, it appears to start correctly, for ex. it says
'Tomcat Server v5.5 @ loalhost Status Started State Synchronized'
For one thing, I'm not sure if the state being synchronized is a good
thing or
not. This time if I go to localhost:8080/tutorial/snoop I get
'unable to connect' as I had shutdown tomcat from the terminal.
But if I go to localhost:8180/tutorial/snoop I get 'HTTP Status 404,
The requested resource is not available Apache Tomcat/5.5.26'
So for one thing the 'Tomcat Server v5.5 @ localhost' is running on a
different port but I didn't try to configure it this way. I'm just using
whatever the defaults are.

So is eclipse running another instance of tomcat ? How does it do this ?
I did try reading some of the descriptions of this in the WTP wiki, but I'm
not quite sure I understand it all that well. To run another instance of
tomcat,are you basically just copying some config files over and running
them on a different port in another process ?
I guess this would sort of explain what's going on but doesn't bring
me any closer at the moment to figuring out what I need to do to get this
simple tutorial working. Any suggestions would be greatly appreciated,
thanks.

Adam
Posner
Re: eclipse/tomcat server/port confusion [message #216250 is a reply to message #216233] Thu, 26 June 2008 21:18 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3121
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Adam Posner wrote:
> Hi everybody. I'm stuck again and looking for some helpful advice.
> I'm not understanding the following behaviour:
> If I start tomcat, ie /usr/share/tomcat5.5/bin/startup.sh,
> then go to localhost:8080, I get the the apache-tomcat-5.5.26 page
> you'd expect on startup. Then I go to eclipse and try to run the server by
> clicking the start arrow where it says Tomcat v5.5 Server @ localhost.
> That will generate the following error from eclipse:
>
> 'Several ports (8005, 8009) rerquired be Tomcat v5.5 Server @ localhost
> are already in use. The server may already be running in another process,
> or system processes may be using the port. To start this server you will
> need to stop the other proceses or change the port number(s).'
>
> So then if I shutdown tomcat (from the command line, not within eclipse),
> then go back to eclipse and click the green start arrow to start the server
> within eclipse again, it appears to start correctly, for ex. it says
> 'Tomcat Server v5.5 @ loalhost Status Started State Synchronized'
> For one thing, I'm not sure if the state being synchronized is a good
> thing or not. This time if I go to localhost:8080/tutorial/snoop I get
> 'unable to connect' as I had shutdown tomcat from the terminal.
> But if I go to localhost:8180/tutorial/snoop I get 'HTTP Status 404,
> The requested resource is not available Apache Tomcat/5.5.26'
> So for one thing the 'Tomcat Server v5.5 @ localhost' is running on a
> different port but I didn't try to configure it this way. I'm just using
> whatever the defaults are.
>
> So is eclipse running another instance of tomcat ? How does it do this ?
> I did try reading some of the descriptions of this in the WTP wiki, but I'm
> not quite sure I understand it all that well. To run another instance of
> tomcat,are you basically just copying some config files over and running
> them on a different port in another process ?
> I guess this would sort of explain what's going on but doesn't bring
> me any closer at the moment to figuring out what I need to do to get
> this simple tutorial working. Any suggestions would be greatly
> appreciated, thanks.
>
> Adam
> Posner
>
In my very meager experience, a 404 results from a missing file in the
deployment. For example, if I accidentally create some JSP or XHTML file
on the path WebContent/WEB-INF/thing.xhtml, then try to access it via
http://localhost:8080/ProjectName/thing.jsf (or .seam, etc.), then I get
a 404. I go back and realize my eyesight was bad and that I wasn't
paying too close attention when I created the file.

I hope this helps though there are probably other ways of getting a 404.

Best of luck,
Russ Bateman
Re: eclipse/tomcat server/port confusion [message #216258 is a reply to message #216250] Thu, 26 June 2008 21:22 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3121
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Windofkeltia wrote:
> Adam Posner wrote:
>> [snip]
>> For one thing, I'm not sure if the state being synchronized is a good
>> thing or not. This time if I go to localhost:8080/tutorial/snoop I get
>> 'unable to connect' as I had shutdown tomcat from the terminal.
>> But if I go to localhost:8180/tutorial/snoop I get 'HTTP Status 404,
>> The requested resource is not available Apache Tomcat/5.5.26'
>> So for one thing the 'Tomcat Server v5.5 @ localhost' is running on a
>> different port but I didn't try to configure it this way. I'm just
>> using whatever the defaults are.
>>
>> So is eclipse running another instance of tomcat ? How does it do this ?
>> I did try reading some of the descriptions of this in the WTP wiki,
>> but I'm
>> not quite sure I understand it all that well. To run another instance
>> of tomcat,are you basically just copying some config files over and
>> running them on a different port in another process ?
>> I guess this would sort of explain what's going on but doesn't
>> bring me any closer at the moment to figuring out what I need to do to
>> get this simple tutorial working. Any suggestions would be greatly
>> appreciated, thanks.
>>
>>
>> Adam Posner
>>
> In my very meager experience, a 404 results from a missing file in the
> deployment. [snip]

Oh yeah, I just remembered another instance in which I've got a 404:
when you create and start working with a new project and while you've
created the server, you've never associated the project with the server.
Often, the Console at the bottom of the workbench displays black instead
of red text when the server is started, but there's no associated projects.

Russ Bateman
Re: eclipse/tomcat server/port confusion [message #216266 is a reply to message #216233] Fri, 27 June 2008 08:21 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1296
Registered: July 2009
Senior Member
Adam Posner wrote:
> Hi everybody. I'm stuck again and looking for some helpful advice.
> I'm not understanding the following behaviour:
> If I start tomcat, ie /usr/share/tomcat5.5/bin/startup.sh,
> then go to localhost:8080, I get the the apache-tomcat-5.5.26 page
> you'd expect on startup. Then I go to eclipse and try to run the server by
> clicking the start arrow where it says Tomcat v5.5 Server @ localhost.
> That will generate the following error from eclipse:
>
> 'Several ports (8005, 8009) rerquired be Tomcat v5.5 Server @ localhost
> are already in use. The server may already be running in another process,
> or system processes may be using the port. To start this server you will
> need to stop the other proceses or change the port number(s).'
>
> So then if I shutdown tomcat (from the command line, not within eclipse),
> then go back to eclipse and click the green start arrow to start the server
> within eclipse again, it appears to start correctly, for ex. it says
> 'Tomcat Server v5.5 @ loalhost Status Started State Synchronized'
> For one thing, I'm not sure if the state being synchronized is a good
> thing or not. This time if I go to localhost:8080/tutorial/snoop I get
> 'unable to connect' as I had shutdown tomcat from the terminal.
> But if I go to localhost:8180/tutorial/snoop I get 'HTTP Status 404,
> The requested resource is not available Apache Tomcat/5.5.26'
> So for one thing the 'Tomcat Server v5.5 @ localhost' is running on a
> different port but I didn't try to configure it this way. I'm just using
> whatever the defaults are.
>
> So is eclipse running another instance of tomcat ? How does it do this ?
> I did try reading some of the descriptions of this in the WTP wiki, but I'm
> not quite sure I understand it all that well.

Hopefully, you are referring to http://wiki.eclipse.org/WTP_Tomcat_FAQ.
If so, what needs clarification?

Cheers,
Larry

> To run another instance of
> tomcat,are you basically just copying some config files over and running
> them on a different port in another process ?
> I guess this would sort of explain what's going on but doesn't bring
> me any closer at the moment to figuring out what I need to do to get
> this simple tutorial working. Any suggestions would be greatly
> appreciated, thanks.
>
> Adam
> Posner
>
Re: eclipse/tomcat server/port confusion [message #216291 is a reply to message #216266] Fri, 27 June 2008 19:31 Go to previous messageGo to next message
Eclipse User
Originally posted by: cuco2772.gmail.com

Perhaps I wasn't being clear about what my question was. I do want to read
that
wiki again and ask more specific questions about that, but
I think before I start talking about the wiki I need to take a step back
and think about why I am getting the 'HTTP Status 404' 'The resource
/tutorial/snoop is not available'. Here's the servlet mapping from web.xml:

<servlet>
<servlet-name>Snoop Servlet</servlet-name>
<servlet-class>org.eclipse.wtp.tutorial.SnoopServlet</servlet-class >
</servlet>
<servlet-mapping>
<servlet-name>Snoop Servlet</servlet-name>
<url-pattern>/snoop/*</url-pattern>
</servlet-mapping>

I'm typing in localhost:8180/tutorial/snoop or
localhost:8080/tutorial/snoop
and getting this HTTP error. The difference is that when I use the
installed
version of tomcat, meaning I manually startup tomcat I can go
localhost:8080,
whereas if I start tomcat from within eclipse, I need to go to
localhost:8180.
But each time it does the same thing, can't find the resource.

One thing I notice is that even when I'm just running tomcat from within
eclipse and I shut down the server I get this error message at the console
window in eclipse:

INFO: Pausing Coyote HTTP/1.1 on http-8180
Jun 27, 2008 4:02:53 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Jun 27, 2008 4:02:53 PM org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8180
Jun 27, 2008 4:02:53 PM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime

Anybody have any clue about what that could mean ?

Everything looks correct in how I've configured the project in eclipse.
For example, when I click on the project WTP-Tutorial-1 in the Project
Explorer
and then select Properties it brings up a window called
'Properties for WTP-Tutorial-1'. I click on Server and I see
'Tomcat v5.5 Server @ localhost' selected as the default server.
The I click on Targeted Runtime and I see 'Apache Tomcat v5.5(3)' as the
targeted runtime, which is my installed apache-tomcat-5.5.26.

One other reason I think mmaybe I'm getting this error could be following:
In my Project Explorer window it has listed the project WTP-Tutuorial-1.
Then under that it has the package Java Resources: src, then within that
another package org.eclipse.wtp.tutorial which is actually where this
SnoopServlet resides. I'm not sure how eclipse reconciles this with the
servlet mapping in the deployment descriptor above, maybe this is just how
eclipse does it.
But given this organization, could the url-pattern element not be right ?
For your info, this tutorial I got from the following URL:

http://www.eclipse.org/webtools/community/tutorials/BuildJ2E EWebApp/BuildJ2EEWebApp.html

Could it be outdated ?
Anyway, thanks. I know this is a lot of info. Just trying to get some
clues on where to go with this.
Re: eclipse/tomcat server/port confusion [message #216299 is a reply to message #216291] Fri, 27 June 2008 22:19 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3121
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Adam Posner wrote:
> Perhaps I wasn't being clear about what my question was. I do want to
> read that wiki again and ask more specific questions about that, but
> I think before I start talking about the wiki I need to take a step back
> and think about why I am getting the 'HTTP Status 404' 'The resource
> /tutorial/snoop is not available'. Here's the servlet mapping from web.xml:
>
> <servlet>
> <servlet-name>Snoop Servlet</servlet-name>
> <servlet-class>org.eclipse.wtp.tutorial.SnoopServlet</servlet-class >
> </servlet>
> <servlet-mapping>
> <servlet-name>Snoop Servlet</servlet-name>
> <url-pattern>/snoop/*</url-pattern>
> </servlet-mapping>
>
> I'm typing in localhost:8180/tutorial/snoop or
> localhost:8080/tutorial/snoop
> and getting this HTTP error. The difference is that when I use the
> installed
> version of tomcat, meaning I manually startup tomcat I can go
> localhost:8080,
> whereas if I start tomcat from within eclipse, I need to go to
> localhost:8180.
> But each time it does the same thing, can't find the resource.
>
> One thing I notice is that even when I'm just running tomcat from within
> eclipse and I shut down the server I get this error message at the console
> window in eclipse:
>
> INFO: Pausing Coyote HTTP/1.1 on http-8180
> Jun 27, 2008 4:02:53 PM org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> Jun 27, 2008 4:02:53 PM org.apache.coyote.http11.Http11BaseProtocol destroy
> INFO: Stopping Coyote HTTP/1.1 on http-8180
> Jun 27, 2008 4:02:53 PM org.apache.catalina.core.AprLifecycleListener
> lifecycleEvent
> INFO: Failed shutdown of Apache Portable Runtime
>
> Anybody have any clue about what that could mean ?
>
> Everything looks correct in how I've configured the project in eclipse.
> For example, when I click on the project WTP-Tutorial-1 in the Project
> Explorer
> and then select Properties it brings up a window called
> 'Properties for WTP-Tutorial-1'. I click on Server and I see
> 'Tomcat v5.5 Server @ localhost' selected as the default server.
> The I click on Targeted Runtime and I see 'Apache Tomcat v5.5(3)' as the
> targeted runtime, which is my installed apache-tomcat-5.5.26.
>
> One other reason I think mmaybe I'm getting this error could be following:
> In my Project Explorer window it has listed the project WTP-Tutuorial-1.
> Then under that it has the package Java Resources: src, then within that
> another package org.eclipse.wtp.tutorial which is actually where this
> SnoopServlet resides. I'm not sure how eclipse reconciles this with the
> servlet mapping in the deployment descriptor above, maybe this is just
> how eclipse does it.
> But given this organization, could the url-pattern element not be right ?
> For your info, this tutorial I got from the following URL:
>
> http://www.eclipse.org/webtools/community/tutorials/BuildJ2E EWebApp/BuildJ2EEWebApp.html
>
>
> Could it be outdated ?
> Anyway, thanks. I know this is a lot of info. Just trying to get some
> clues on where to go with this.
>
Yes, it's very outdated. I tried this tutorial last February and was
unable to make it work. At the time, I was learning JSPs and servlets
myself.

I ended up writing my own tutorial after spending a great deal of time
working through the problems which included purchasing a book by the
author. I felt I didn't have the "right" to redo this tutorial and so
did my own. You're welcome to it if you want.

It was finished in April and used Eclipse 3.3.2 plus the WTP version
prior to the latest (3.0.0). It also used Tomcat 6.0 and JDK 1.6. It
covers installing all that software. I have no doubt that it still
works. It also lists a great many resources in the bibliography as well
as links to various tutorials I studied and tried before or as I did mine.

Then I moved on to JSF, Facelets and Seam.

http://www.windofkeltia.com/j2ee/wtp-tutorial.html

Russ
Re: eclipse/tomcat server/port confusion [message #216360 is a reply to message #216299] Sun, 29 June 2008 20:41 Go to previous message
Eclipse User
Originally posted by: cuco2772.gmail.com

Thanks a bunch, Russ. Your tutorial worked !
The first time I ran it using eclipse's browser I got an HTTP 404 (again !)
when trying to submit the color. Then I ran it in debug mode and it worked.
After that I ran it normally and it still worked.
I also ran it by going to Firefox and entering
localhost:8180/wtp-tutorial_6-29/greeting.jsp and that worked too.

The only thing that was different is I used the installs I already had:
I downloaded and java_ee_sdk-5_05-linux.bin and ran it my
/usr/lib directory which created a new /jdk folder and installed
everything there.

I had previously installed eclipse using apt-get (which gave me version
3.2.2),
then used the SoftwareUpdates feature from within eclipse to install the
WTP.
Because of this version of eclipse I have, I ended up not being able to use
the tomcat 6 I had installed previously (which worked fine with JSP pages
written using kate, a very good text editor by the way, but no substitute
for
an IDE), so I had to download apache-tomcat.5.5.26 into /usr/share.
One other thing I had to do was from the Synaptic update manager download
the java-6-sun-jdk package from the ubuntu repositories.
(In my Preferences->Installed JREs I have the location /usr/lib/jdk/jre,
I'm
a little confused about why I needed to install the ubuntu package, but it
works now so I'm not complaining.)

I did try downloading the latest version of eclipse into my home directory
-
Ganymede RC3 - but unfortunately wasn't able to get that to work.
I may come back to trying that again once I've worked with eclipse a little
while. Anyway, thanks again. I'm sure others will find your tutorial to be
a
useful resource.

It's nice to finally be able to move on to actually using eclipse instead
of pulling my hair out !
Previous Topic:Porting a JSF based application from Netbeans 6.1 to Eclipse Ganymede 3.4
Next Topic:Using local javascript files in webtools project
Goto Forum:
  


Current Time: Wed Jul 23 14:11:12 EDT 2014

Powered by FUDForum. Page generated in 0.02076 seconds