title: Config problems with Spring 3 and Thymeleaf template Engine
body: <p>I have added the following JARs from <a href="https://github.com/thymeleaf/thymeleaf-dist/downloads" rel="nofollow">Thymeleaf GitHub </a>to my build path.<br/>
   - lib/javassist-3.16.1-GA<br/>
   - lib/ognl-3.0.5<br/>
   - lib/slf4j-api-1.6.1<br/>
   - dist/thymeleaf-spring3-2.0.8</p>
  
  <p>Here is my application-context-config.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
      xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="http://www.springframework.org/schema/aop 
      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
      http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
      &lt;!-- It allow us to use @Autowire, @Required and @Qualifier annotations. --&gt;
      &lt;context:annotation-config /&gt;
  
      &lt;context:component-scan base-package="com.company"&gt;
          &lt;context:exclude-filter expression="org.springframework.stereotype.Controller"
              type="annotation" /&gt;
      &lt;/context:component-scan&gt;
  
      &lt;aop:aspectj-autoproxy proxy-target-class="true" /&gt;
  
      &lt;bean id="messageSource"
          class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
          &lt;property name="basenames"&gt;
              &lt;list&gt;
                  &lt;value&gt;ui&lt;/value&gt;
                  &lt;value&gt;messages&lt;/value&gt;
                  &lt;value&gt;exceptions&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="multipartResolver"
          class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /&gt;
  
      &lt;bean id="issuerValidator"
          class="com.company.console.validators.MyValidator" /&gt;
  
      &lt;bean id="templateResolver"
          class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/templates/" /&gt;
          &lt;property name="suffix" value=".html" /&gt;
          &lt;property name="templateMode" value="HTML5" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine"&gt;
          &lt;property name="templateResolver" ref="templateResolver" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>I get the following error when starting my app (It started fine before adding <em>templateResolver</em> and <em>templateEngine</em> to my application-context-config.xml.</p>
  
  <pre><code>DEBUG [2012-07-17 09:31:29,517] [Thread-2] (XmlBeanDefinitionReader) - Loaded 13 bean definitions from location pattern [/WEB-INF/Resources/*-config.xml]
  DEBUG [2012-07-17 09:31:29,517] [Thread-2] (XmlWebApplicationContext) - Bean factory for Root WebApplicationContext: org.springframework.beans.factory.support.DefaultListableBeanFactory@4add8e0d: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,dateFormatter,issuerDaoOilImpl,issuerServiceImpl,org.springframework.aop.config.internalAutoProxyCreator,messageSource,multipartResolver,issuerValidator,templateResolver,templateEngine]; root of factory hierarchy
  DEBUG [2012-07-17 09:31:29,547] [Thread-2] (DefaultListableBeanFactory) - Ignoring bean class loading failure for bean 'templateResolver'
  org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.thymeleaf.templateresolver.ServletContextTemplateResolver] for bean with name 'templateResolver' defined in ServletContext resource [/WEB-INF/Resources/applicationContext-config.xml]; nested exception is java.lang.ClassNotFoundException: org.thymeleaf.templateresolver.ServletContextTemplateResolver
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:317)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:396)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:612)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      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)
  Caused by: java.lang.ClassNotFoundException: org.thymeleaf.templateresolver.ServletContextTemplateResolver
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
      at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
      ... 17 more
  DEBUG [2012-07-17 09:31:29,549] [Thread-2] (DefaultListableBeanFactory) - Ignoring bean class loading failure for bean 'templateEngine'
  org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.thymeleaf.spring3.SpringTemplateEngine] for bean with name 'templateEngine' defined in ServletContext resource [/WEB-INF/Resources/applicationContext-config.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/thymeleaf/TemplateEngine
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1265)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
      at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:317)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:396)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:612)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      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)
  Caused by: java.lang.NoClassDefFoundError: org/thymeleaf/TemplateEngine
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
      at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
      at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
      ... 17 more
  Caused by: java.lang.ClassNotFoundException: org.thymeleaf.TemplateEngine
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      ... 29 more
  </code></pre>
  
  <p>Any ideas what's wrong here?</p>
  
  <p>Thanks</p>