[undertow-dev] java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader

Stuart Douglas sdouglas at redhat.com
Wed Mar 9 18:00:10 EST 2016


Hmm, this looks like a bug, I have created https://issues.jboss.org/browse/WFLY-6346

For now if you want to use freemarker you would need to add the jar to the modules/system/layers/base/io/undertow/js/main/ folder (and the corresponding module.xml).

Stuart

----- Original Message -----
> From: "Shiva Saxena" <shivasaxena999 at gmail.com>
> To: "Stuart Douglas" <sdouglas at redhat.com>
> Cc: undertow-dev at lists.jboss.org
> Sent: Thursday, 10 March, 2016 7:37:34 AM
> Subject: Re: [undertow-dev] java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader
> 
> Hi,
> 
> I did add the freemarker maven dependency in the project, and after the
> build its there in the WEB-INF/lib folder too, yet the issue persists.
> 
> Am I missing the something, or something more is expected?
> 
> PS: The project can be found @
> https://github.com/shivasaxena/undertow-js-example
> 
> On Tue, Mar 8, 2016 at 3:44 AM, Stuart Douglas <sdouglas at redhat.com> wrote:
> 
> > Wildfly only bundles the mustache template library by default, if you want
> > to use Freemarker you need to bundle it in your deployment.
> >
> > Stuart
> >
> > ----- Original Message -----
> > > From: "Shiva Saxena" <shivasaxena999 at gmail.com>
> > > To: undertow-dev at lists.jboss.org
> > > Sent: Saturday, 5 March, 2016 9:51:06 PM
> > > Subject: [undertow-dev] java.lang.NoClassDefFoundError:
> >  freemarker/cache/TemplateLoader
> > >
> > > Hi,
> > >
> > > I am just creating a Hello world example of undertow.js like so
> > >
> > > $undertow
> > > .onGet("/hello-freemarker",
> > > {template: '/resources/hello.ftl','template_type': 'freemarker', headers:
> > > {"content-type": "text/plain"}},
> > > [function ($exchange) {
> > > return {data: 'Hello World!'};
> > > }]);
> > > When deploying the project I am getting the following exception
> > >
> > > ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 2)
> > > MSC000001: Failed to start service
> > >
> > jboss.undertow.deployment.default-server.default-host./undertowjs-example:
> > > org.jboss.msc.service.StartException in service
> > >
> > jboss.undertow.deployment.default-server.default-host./undertowjs-example:
> > > java.util.ServiceConfigurationError:
> > > io.undertow.js.templates.TemplateProvider: Provider
> > > io.undertow.js.templates.freemarker.FreemarkerTemplateProvider could not
> > be
> > > instantiated
> > > at
> > >
> > org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
> > > at
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> > > at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> > > at
> > >
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> > > at
> > >
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> > > at java.lang.Thread.run(Thread.java:745)
> > >
> > > I have also added the freemarker jar file in the modules folder but it
> > still
> > > doesn't help. Please let me know what I might be doing wrong or is come
> > > extra conf required.
> > >
> > > --
> > > Best Regards
> > > Shiva Saxena
> > > Mobile : +91-9889787094
> > > Blog | Linkedin | StackOverflow
> > >
> > > _______________________________________________
> > > undertow-dev mailing list
> > > undertow-dev at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/undertow-dev
> >
> 
> 
> 
> --
> Best Regards
> *Shiva Saxena*
> *Mobile : +91-9889787094                            *
> *Blog <http://metalop.com/> | Linkedin
> <http://in.linkedin.com/in/shivasaxena/> | StackOverflow
> <http://stackoverflow.com/users/2490343/shiva>*
> 


More information about the undertow-dev mailing list