Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3230770
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:57:58+00:00 2026-05-17T16:57:58+00:00

I am using Spring MVC for my web application and I am integrating Velocity

  • 0

I am using Spring MVC for my web application and I am integrating Velocity for templating my emails.

I am getting the following 500 error when It attempts to send my email.

org.apache.velocity.exception.ResourceNotFoundException: 
Unable to find resource '/WEB-INF/velocity/registrationEmail.vm'

I am aware of what this means and what I need to do, but I know that I must be doing something wrong and I cant figure out why it cant find my .vm files.

I have configured velocity in my applicationContext.xml file as below, but I believe I might be leaving necessary properties out that Velocity needs to find the file.

<bean id="velocityEngine" 
    class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
        <property name="velocityProperties">
             <value>
              resource.loader=class
               class.resource.loader.class=
               org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
             </value>
        </property>
    </bean>
    <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
     <property name="resourceLoaderPath" value="/WEB-INF/velocity/"/>
    </bean>

I believe this might be where I need to make some changes/additions but I am not sure.

The path to my template files is WEB-INF/velocity/templateName.vm

I specify this when using the velocityEngine bean in my controller as well such as the following

String text = VelocityEngineUtils.mergeTemplateIntoString(
                       velocityEngine, "/WEB-INF/velocity/registrationEmail.vm", test);

Is there something I need to do in my build.xml file to make sure that it is able to find my template files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:57:59+00:00Added an answer on May 17, 2026 at 4:57 pm

    I think the problem is that WEB-INF is not part of CLASSPATH. You can’t expect the ClasspathResourceLoader to find something that isn’t in the CLASSPATH.

    WEB-INF/classes and all the JARs in WEB-INF/lib are in the CLASSPATH. Try moving your folder with the .vm files under WEB-INF/classes and see if that helps.

    Best idea of all is to follow the Spring docs:

    http://static.springsource.org/spring/docs/2.5.x/reference/view.html#view-velocity

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a MVC web application (using the Spring MVC framework), and I'm a
I am using Spring MVC to build my web application, and I have a
I am using Spring MVC for a web application and I am working with
In a web application written using spring-MVC, I want to allow users to change
I am using Jboss and Netbeans to create Spring MVC web application on windows.
So I've got a simple web application using Spring MVC + Hibernate and am
i'm creating a very simple (hello World quality) web application using spring mvc 3.0.
I'm writing a web application using Spring MVC. Although Spring MVC comes with a
I am integrating the displaytag library into my Spring MVC Application. I am using
I am using Spring MVC for my web application and I am using my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.