File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring" Watch "javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring" New topic
Author

javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring

vineet bindal
Greenhorn

Joined: Aug 04, 2011
Posts: 9
Hi,


I am setting up a simple project with spring and apache velocity,

below is my servlet file.





below is my web.xml





i am using Spring source tool and I have created a spring MVC Template project.

I am getting the below error....


NFO : com.peanuts.blackboard.HomeController - Welcome home! the client locale is en_US
ERROR: org.apache.velocity.app.VelocityEngine - ResourceManager : unable to find resource '/WEB-INF/views/home.vm' in any resource loader.
Aug 29, 2011 5:11:12 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/Blackboard] threw exception [Could not resolve view with name 'home' in servlet with name 'appServlet'] with root cause
javax.servlet.ServletException: Could not resolve view with name 'home' in servlet with name 'appServlet'
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1029)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve.invoke(HttpRequestOperationCollectionValve.java:84)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Aug 29, 2011 5:24:11 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/Blackboard]



please help.



vineet bindal
Greenhorn

Joined: Aug 04, 2011
Posts: 9
I found the solution.

there was an error in My servlet

it was

<beans:bean name ="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">

<beans:property name="prefix" value=" /WEB-INF/velocity" />
<beans:property name="suffix" value=".vm" />
<!-- <beans:property name="exposeSpringMacroHelpers" value="true"/> -->

</beans:bean>


the property should be <beans:property name="prefix" value="" />
Pijush Kanti Das
Greenhorn

Joined: Sep 09, 2013
Posts: 1

That has worked for me. Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring