My application is a servlet, spring 4 application where the spring jar is in the tomcat lib. Freemarker jar is in WEB-INF/lib.
I am getting this error when starting the server java.lang.ClassNotFoundException: freemarker.template.TemplateHashModelEx
This error disappears when I move the freemarker jar to tomcat lib directory.
It appears to me that spring 4 webmvc jar which contains Configurer class is unable to see WEB-INF/lib freemarker jar. I do not understand why freemarker jar in WEB-INF/lib folder is not visible to spring jar in tomcat lib folder.
What may I do to resolve this situation. My spring configuration is as follows
<bean id="freemarkerConfiguration" class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
<!--Turn this off to always load via SpringTemplateLoader-->
<property name="preferFileSystemAccess" value="false"></property>
<property name="templateLoaderPath" value="classpath:/"></property>
</bean>
<bean id="freemarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="configuration" ref="freemarkerConfiguration" />
</bean>