• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Deepti Ghate
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepti Ghate
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey actually my package name is springapp.web without s and the name of the project is springapps..

Capture.PNG
[Thumbnail for Capture.PNG]
Project Directory Structure.
 
Alok Agrawal
Greenhorn
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thats not working either..
No prob..
Thanks for your help though
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic