简体   繁体   中英

Getting error-404 in tomcat while running application from eclipse

I am trying to run a spring3 application from the eclipse(indigo) by using tomcat6.0. Right click on the project -> run on server -> gives me error 404(The requested source is not available).

Edit from comments

<!-- Dispatcher Servlet Mapping --> 
<servlet>   
  <servlet-name>SNBServlet</servlet-name>
  <servlet-class>org.springfr‌​amework.web.servlet.DispatcherServlet</servlet-class>
  <load-on-startup>1</load-on-‌​startup>
</servlet>
<servlet-mapping>
  <servlet-name>SNBServlet</servlet-name>
  <url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
  <listener-class>org.springframework.web.util.Log4jC‌​onfigListener</listener-class>
</listener> 
<!-- Welcome File --> 
<welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

Check the URL that is being hit in the browser. Most probably it will be something like http://somehost:port/yourApplicationContext/ which means it is attempting to access a resource on the root of the application that is not present or configured by you.

Either configure some welcome-file in the deployment descriptor of the application or simply request a resource that is already present.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM