aspose file tools*
The moose likes Spring and the fly likes HelloWeb is not working in Tomcat 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "HelloWeb is not working in Tomcat 6" Watch "HelloWeb is not working in Tomcat 6" New topic
Author

HelloWeb is not working in Tomcat 6

shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
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

Joined: Jan 05, 2010
Posts: 177
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
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).


Ping & DNS - my free Android networking tools app
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 498

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.


PM Me If You Want to get Urgent Help on Java Programming
shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
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

Joined: Jan 05, 2010
Posts: 177
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

Few people are going to download your code. It'd be best if you post the configuration here.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61662
    
  67

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

Joined: Jan 05, 2010
Posts: 177
Still not clear. Please comment!!!
shai ban
Ranch Hand

Joined: Jan 05, 2010
Posts: 177
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HelloWeb is not working in Tomcat 6