Home » Language IDEs » ServerTools (WTP) » tomcat starts, but cannot get to my webapp(receive 404 from tomcat)
|
Re: tomcat starts, but cannot get to my webapp [message #656482 is a reply to message #656468] |
Fri, 25 February 2011 20:20 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 2/25/2011 2:27 PM, Nilesh wrote:
> Hello,
> moving my topic from "newcomers" to here:
> http://www.eclipse.org/forums/index.php?t=msg&th=205144& amp;start=0&S=e5aa862d6195c9a3f13203059001cf7d
>
>
> here's the text reproduced:
> Hello,
> i set up, compiled and ran my webapp successfully on eclipse helios
> (Version: Helios Service Release 1
> Build id: 20100917-0705)
> the problem is tomcat starts successfully per console message, my
> application logs show that everything started as well, but when i go to
> localhost:8080/<my servletname>, i get a 404: resource not found from
> tomcat.
>
> [removed technically inaccurate piece of message]
>
> any ideas?
>
> Thanks,
> Nilesh
A URL like "localhost:8080/<my servletname>", instead of
"localhost:8080/<context(typically same as project name)>/<my
servletname's url-pattern>", implies you have deployed your project as
the default context. To do this you would have had to open the "Web
Project Settings" page in the project's Properties dialog and set the
"Context root" field to "/". If you did not do that then
"localhost:8080/<my servletname>" is the wrong URL and 404 is the
expected response.
Typically the servlet's url-pattern defaults to a "/" followed by the
servlet name. If this isn't true for your servlet, then it's the
url-pattern you will need in your URL. You can right-click on the
servlet in an editor or the Project Explorer view and select Run As ->
Run on Server and WTP should open the browser with the correct URL.
Cheers,
Larry
|
|
|
Re: tomcat starts, but cannot get to my webapp [message #656506 is a reply to message #656482] |
Fri, 25 February 2011 23:26 |
Nilesh Messages: 12 Registered: June 2010 |
Junior Member |
|
|
Aaah, the clarity afforded by actual knowledge...
Thanks Larry. you were right - i needed to use http://localhost:8080/<context>/<servlet name> - i haven't still understood this very well: in IntelliJ i'm not supplying the context name and it works but anyways! - now i can get to my webapp, so on with my next set of questions:
most of this again is how intellij works, so i need help with how eclipse works:
i created a dynamic web project.
added my src, and my external jars as user libraries
i went into project properties -> deployment assembly, and set up my user libraries and another folder to be deployed to specific locations within my deployment.
however, neither those user libraries (the jars in it) nor the contents of the other folder get copied into my deployment directory.
am i misunderstanding this property?
essentially, i want to specify all the different jars and other files that i'd like to be copied to my deployment dir before i run (like intellij does ) is that possible?
if not, what's the eclipse way of doing this?
THanks again,
Nilesh
|
|
|
Re: tomcat starts, but cannot get to my webapp [message #656775 is a reply to message #656506] |
Mon, 28 February 2011 14:19 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 2/25/2011 6:26 PM, Nilesh wrote:
> Aaah, the clarity afforded by actual knowledge...
>
> Thanks Larry. you were right - i needed to use
> http://localhost:8080/<context>/<servlet name> - i haven't still
> understood this very well: in IntelliJ i'm not supplying the context
> name and it works but anyways! - now i can get to my webapp, so on with
> my next set of questions:
>
> most of this again is how intellij works, so i need help with how
> eclipse works:
>
> i created a dynamic web project.
> added my src, and my external jars as user libraries
> i went into project properties -> deployment assembly, and set up my
> user libraries and another folder to be deployed to specific locations
> within my deployment.
> however, neither those user libraries (the jars in it) nor the contents
> of the other folder get copied into my deployment directory. am i
> misunderstanding this property?
>
> essentially, i want to specify all the different jars and other files
> that i'd like to be copied to my deployment dir before i run (like
> intellij does :p ) is that possible?
>
> if not, what's the eclipse way of doing this?
>
> THanks again,
> Nilesh
"Assembly" of the webapp occurs when you add the project to a server and
publish, or export the project as a WAR file. Assuming you have done
the former, where are you looking for the deployment directory? The
default location would be under
"<workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp?/wtpweba pps ".
Cheers,
Larry
|
|
|
Goto Forum:
Current Time: Thu Apr 18 07:59:56 GMT 2024
Powered by FUDForum. Page generated in 0.01870 seconds
|