*
The moose likes Spring and the fly likes Creating a simple Spring MVC app .. Getting Request not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Creating a simple Spring MVC app .. Getting Request not found error" Watch "Creating a simple Spring MVC app .. Getting Request not found error" New topic
Author

Creating a simple Spring MVC app .. Getting Request not found error

Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
This is my controller


my web.xml



my springapps-servlet.xml



My View file Hello.jsp




And my Build.xml



my console is as follows

Oct 4, 2012 5:52:08 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:springapp' did not find a matching property.
Oct 4, 2012 5:52:08 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:springapps' did not find a matching property.
Oct 4, 2012 5:52:08 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_07\bin;.;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.5.0_07/bin/client;C:/Program Files/Java/jre1.5.0_07/bin;C:\Program Files\CA\SC\CAWIN\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\PROGRA~1\CA\SC\CAM\bin;C:\Program Files\CA\DSM\bin;C:\Program Files\TortoiseSVN\bin
Oct 4, 2012 5:52:08 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Oct 4, 2012 5:52:08 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 330 ms
Oct 4, 2012 5:52:08 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 4, 2012 5:52:08 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Oct 4, 2012 5:52:09 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Oct 4, 2012 5:52:09 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 4, 2012 5:52:09 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/17 config=null
Oct 4, 2012 5:52:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 314 ms

Could anyone please help me...
Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

It seems that the package you have declared in controller class and specified in XML file is different.

its springapp.web in controller while its springapps.web in springapps-servlet.xml (difference of 's' character) .

Please correct it once and try. Also, may be you also need to mention the "springapps-servlet.xml " in web.xml to search the action url.


Alok Agrawal
Learn Thru PPT Sports Info
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Also, may be you also need to mention the "springapps-servlet.xml " in web.xml to search the action url


This is wrong. The Spring looks for the configuration file whose name would be <servlet-name>-servlet.xml. So you have created the dispatcherServlet with name springapps and your configuration file name is springapps-servlet.xml. So all set there.


Ashwin Sridhar
SCJP | SCWCD | OCA
Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
Hey actually my package name is springapp.web without s and the name of the project is springapps..




[Capture.PNG]

Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

in your controller class HelloController, see line no . 1, which is


and in your springapps-servlet.xml file, see line no. 10, which is


update above code with below:



got the idea?
Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
Hey thanks..

changed it to

<bean name="/hello.htm" class="springapp.web.HelloController"/>

in the springapps-servlet.xml,

But still getting the same error...
Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

the only thing that left is now build.xml. I am not much sure about the issue but here in build.xml also the project name is springapp while the actual name is springapps.

are you sure that you still getting same exception message?

Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
Hey changed that too thanks..
Really silly mistakes... sorry..
But alas the output is still the same
Can you find any other problem?
Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

you have to show the whole exception stake trace so that issue can be figure out.. because the exception message you showed before does not contain any error or exception messages.
Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
The problem is i don't have any error messages the one i shared is all the stack trace i got..

However in the problems tab i am getting many warnings of Class Dependency Validator Messages saying the jar will not be exported or published.
I tried to quickfix them but still the error isnt solved.
I have taken this example from springsource.org mvc step by step..
Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

There are some configurations missed in springapps-servlet.xml file which are responsible to handling requests.

Please refer below link and see the enteries in dispatch-servlet.xml file


Spring example

there are 2 enteries that you are missing in that:





Deepti Ghate
Greenhorn

Joined: Jun 20, 2012
Posts: 8
Hey thats not working either..
No prob..
Thanks for your help though
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating a simple Spring MVC app .. Getting Request not found error
 
Similar Threads
Ant list -- Build Failed
Install task cannot find file
Spring coniguration
Error The requested resource is not available
Configuring Tomcat 7 with Eclipse, Ant