Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HelloWeb is not working in Tomcat 6

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Created my first Spring MVC HelloWeb service based on http://www.tutorialspoint.com/spring/spring_web_mvc_framework.htm. I am running it in Tomcat 6. Added the below spring 3.2 jars into Tomcat's lib folder:

NOTE: Not able to attach. Please download the war file from the link http://www.sendspace.com/file/r6q5kb

commons-logging-1.1.3.jar
jsp-api.jar
servlet-api.jar spring-aop-3.2.3.RELEASE.jar
spring-aspects-3.2.3.RELEASE.jar spring-beans-3.2.3.RELEASE.jar
spring-build-src-3.2.3.RELEASE.jar spring-context-3.2.3.RELEASE.jar
spring-context-support-3.2.3.RELEASE.jar spring-core-3.2.3.RELEASE.jar
spring-expression-3.2.3.RELEASE.jar spring-instrument-3.2.3.RELEASE.jar
spring-instrument-tomcat-3.2.3.RELEASE.jar spring-jdbc-3.2.3.RELEASE.jar
spring-jms-3.2.3.RELEASE.jar spring-orm-3.2.3.RELEASE.jar
spring-oxm-3.2.3.RELEASE.jar spring-struts-3.2.3.RELEASE.jar
spring-test-3.2.3.RELEASE.jar spring-tx-3.2.3.RELEASE.jar
spring-web-3.2.3.RELEASE.jar spring-webmvc-3.2.3.RELEASE.jar
spring-webmvc-portlet-3.2.3.RELEASE.jar

But still the url "http://localhost:8080/HelloWeb/hello"; is giving HTTP 404 error (The requested resource is not available)!!!
Anybody?

Thanks.
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring libraries I added through setting a USER DEFINED variable.
And when I deploy the application in the eclipse's embedded tomcat server, then it is working fine!!! I am not able to get it why it is not working in earlier case?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't use either approach. Such libraries should go into the WEB-INF/lib directory of your web app (apart from the servlet API and JSP API, which are included in the Tomcat distribution and should not be moved or included anywhere else).
 
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's giving HTTP 404 probably means that you configure the controller's URL mapping improperly. I only can guess because you still keep your code in secret.
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Nam Ha Minh wrote:It's giving HTTP 404 probably means that you configure the controller's URL mapping improperly. I only can guess because you still keep your code in secret.



Mapping is not wrong. It is working in Tomcat embedded in eclipse!!! For code I have shared the spring source url.
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You shouldn't use either approach. Such libraries should go into the WEB-INF/lib directory of your web app (apart from the servlet API and JSP API, which are included in the Tomcat distribution and should not be moved or included anywhere else).



Then you will end up separate copies of libraries in each web application. I doubt this is correct practice?

2nd thing, even I move apps what you said then also what is the difference between both methods? why it is working when deploying directly in the Tomcat embedded in eclipse.

Thanks.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Few people are going to download your code. It'd be best if you post the configuration here.
 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

shai ban wrote:Then you will end up separate copies of libraries in each web application. I doubt this is correct practice?


It is most certainly a good practice. That makes each web application modular and not dependent upon others or arbitrary external dependencies.
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still not clear. Please comment!!!
 
shai ban
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked. May be because of log4j.xml where I didn't include the DOCTYPE declaration.

NOTE: I just reverted the log4j.xml again but the error didn't come again!!! Means, still we don't know why that error was coming.
Please let me know if anybody has idea.

Thanks.
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic