NoClassDefFoundError: Could not initialize class freemarker.template.Configuration when configuring custom spring modules in JBoss EAP 6

Solution Verified - Updated -


Hello, I've setup some modules for Spring. I have an application with a jboss-deployment-structure.xml in an application that has dependencies on spring and freemarker modules, however I'm getting this exception below:

WARN  [] (MSC service thread 1-2) FactoryBean threw exception from getObjectType, despite the contract saying that it should return null if the type of its object cannot be determined yet: java.lang.NoClassDefFoundError: Could not initialize class freemarker.template.Configuration
  at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_30]
  at java.lang.Class.forName( [rt.jar:1.6.0_30]
  at org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean.class$( [spring.jar:2.5.6]
  at org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean.getObjectType( [spring.jar:2.5.6]
  at [spring.jar:2.5.6]
  at [spring.jar:2.5.6]
  at [spring.jar:2.5.6]

My Spring module looks like this:

<module xmlns="urn:jboss:module:1.1" name="spring" slot="2.5.6">
        <resource-root path="aspectjrt.jar"/>
        <resource-root path="aspectjweaver.jar"/>
        <resource-root path="jaxws-spring-1.8.jar"/>
        <resource-root path="spring.jar"/>
        <resource-root path="xbean-spring-2.7.jar"/>
        <resource-root path="spring-webmvc-2.5.6.jar"/>

        <module name="javax.api" export="true"/>
        <module name="javaee.api" export="true"/>
        <module name="org.apache.commons.logging"/>


  • JBoss Enterprise Application Platform (EAP)
    • 6.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content