netbeans 7 - Apache Velocity Initialised error -


i have maven project built using netbeans 7.2 , runs on glassfish 3. thought try luck @ upgraded netbeans 7.2 7.3 yesterday transition has caused error apache velocity. if run in 7.2 works fine, if run in 7.3 following errors

severe: there unspecified exception whilst sending email java.lang.runtimeexception: velocity not initialized!     @ org.apache.velocity.runtime.runtimeinstance.requireinitialization(runtimeinstance.java:307)     @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:1196)     @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:1181)     @ org.apache.velocity.runtime.runtimeinstance.evaluate(runtimeinstance.java:1297)     @ org.apache.velocity.runtime.runtimeinstance.evaluate(runtimeinstance.java:1265)     @ org.apache.velocity.app.velocity.evaluate(velocity.java:180)     @ tv.tarka.dastraxweb.integration.email.velocity.combine(velocity.java:111)     @ tv.tarka.dastraxweb.integration.email.emailconstructor.build(emailconstructor.java:93)     @ tv.tarka.dastraxweb.object.ticket.manualticketobj.create(manualticketobj.java:267)     @ tv.tarka.dastraxweb.service.tickets.newmanualticketmb.opennewticket(newmanualticketmb.java:51)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:601)     @ javax.el.beanelresolver.invokemethod(beanelresolver.java:779)     @ javax.el.beanelresolver.invoke(beanelresolver.java:528)     @ javax.el.compositeelresolver.invoke(compositeelresolver.java:257)     @ com.sun.el.parser.astvalue.invoke(astvalue.java:248)     @ com.sun.el.methodexpressionimpl.invoke(methodexpressionimpl.java:302)     @ org.jboss.weld.util.el.forwardingmethodexpression.invoke(forwardingmethodexpression.java:39)     @ org.jboss.weld.el.weldmethodexpression.invoke(weldmethodexpression.java:50)     @ com.sun.faces.facelets.el.tagmethodexpression.invoke(tagmethodexpression.java:105)     @ javax.faces.component.methodbindingmethodexpressionadapter.invoke(methodbindingmethodexpressionadapter.java:87)     @ com.sun.faces.application.actionlistenerimpl.processaction(actionlistenerimpl.java:101)     @ javax.faces.component.uicommand.broadcast(uicommand.java:315)     @ javax.faces.component.uiviewroot.broadcastevents(uiviewroot.java:791)     @ javax.faces.component.uiviewroot.processapplication(uiviewroot.java:1256)     @ com.sun.faces.lifecycle.invokeapplicationphase.execute(invokeapplicationphase.java:81)     @ com.sun.faces.lifecycle.phase.dophase(phase.java:101)     @ com.sun.faces.lifecycle.lifecycleimpl.execute(lifecycleimpl.java:118)     @ javax.faces.webapp.facesservlet.service(facesservlet.java:593)     @ org.apache.catalina.core.standardwrapper.service(standardwrapper.java:1550)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:343)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.primefaces.webapp.filter.fileuploadfilter.dofilter(fileuploadfilter.java:79)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:61)     @ org.apache.shiro.web.servlet.advicefilter.executechain(advicefilter.java:108)     @ org.apache.shiro.web.servlet.advicefilter.dofilterinternal(advicefilter.java:137)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:66)     @ org.apache.shiro.web.servlet.advicefilter.executechain(advicefilter.java:108)     @ org.apache.shiro.web.servlet.advicefilter.dofilterinternal(advicefilter.java:137)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:66)     @ org.apache.shiro.web.servlet.abstractshirofilter.executechain(abstractshirofilter.java:449)     @ org.apache.shiro.web.servlet.abstractshirofilter$1.call(abstractshirofilter.java:365)     @ org.apache.shiro.subject.support.subjectcallable.docall(subjectcallable.java:90)     @ org.apache.shiro.subject.support.subjectcallable.call(subjectcallable.java:83)     @ org.apache.shiro.subject.support.delegatingsubject.execute(delegatingsubject.java:383)     @ org.apache.shiro.web.servlet.abstractshirofilter.dofilterinternal(abstractshirofilter.java:362)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:279)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175)     @ org.apache.catalina.core.standardpipeline.doinvoke(standardpipeline.java:655)     @ org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:595)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:161)     @ org.apache.catalina.connector.coyoteadapter.doservice(coyoteadapter.java:331)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:231)     @ com.sun.enterprise.v3.services.impl.containermapper$adaptercallable.call(containermapper.java:317)     @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:195)     @ com.sun.grizzly.http.processortask.invokeadapter(processortask.java:860)     @ com.sun.grizzly.http.processortask.doprocess(processortask.java:757)     @ com.sun.grizzly.http.processortask.process(processortask.java:1056)     @ com.sun.grizzly.http.defaultprotocolfilter.execute(defaultprotocolfilter.java:229)     @ com.sun.grizzly.defaultprotocolchain.executeprotocolfilter(defaultprotocolchain.java:137)     @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:104)     @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:90)     @ com.sun.grizzly.http.httpprotocolchain.execute(httpprotocolchain.java:79)     @ com.sun.grizzly.protocolchaincontexttask.docall(protocolchaincontexttask.java:54)     @ com.sun.grizzly.selectionkeycontexttask.call(selectionkeycontexttask.java:59)     @ com.sun.grizzly.contexttask.run(contexttask.java:71)     @ com.sun.grizzly.util.abstractthreadpool$worker.dowork(abstractthreadpool.java:532)     @ com.sun.grizzly.util.abstractthreadpool$worker.run(abstractthreadpool.java:513)     @ java.lang.thread.run(thread.java:722) caused by: org.apache.velocity.exception.velocityexception: error initializing log: failed initialize instance of org.apache.velocity.runtime.log.log4jlogchute current runtime configuration.     @ org.apache.velocity.runtime.runtimeinstance.initializelog(runtimeinstance.java:875)     @ org.apache.velocity.runtime.runtimeinstance.init(runtimeinstance.java:262)     @ org.apache.velocity.runtime.runtimeinstance.requireinitialization(runtimeinstance.java:302)     ... 77 more caused by: org.apache.velocity.exception.velocityexception: failed initialize instance of org.apache.velocity.runtime.log.log4jlogchute current runtime configuration.     @ org.apache.velocity.runtime.log.logmanager.createlogchute(logmanager.java:220)     @ org.apache.velocity.runtime.log.logmanager.updatelog(logmanager.java:269)     @ org.apache.velocity.runtime.runtimeinstance.initializelog(runtimeinstance.java:871)     ... 79 more caused by: java.lang.runtimeexception: error configuring log4jlogchute :      @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)     @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57)     @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45)     @ java.lang.reflect.constructor.newinstance(constructor.java:525)     @ org.apache.velocity.util.exceptionutils.createwithcause(exceptionutils.java:67)     @ org.apache.velocity.util.exceptionutils.createruntimeexception(exceptionutils.java:45)     @ org.apache.velocity.runtime.log.log4jlogchute.initappender(log4jlogchute.java:133)     @ org.apache.velocity.runtime.log.log4jlogchute.init(log4jlogchute.java:85)     @ org.apache.velocity.runtime.log.logmanager.createlogchute(logmanager.java:157)     ... 81 more caused by: java.io.filenotfoundexception: velocity.log (permission denied)     @ java.io.fileoutputstream.open(native method)     @ java.io.fileoutputstream.<init>(fileoutputstream.java:212)     @ java.io.fileoutputstream.<init>(fileoutputstream.java:136)     @ org.apache.log4j.fileappender.setfile(fileappender.java:273)     @ org.apache.log4j.rollingfileappender.setfile(rollingfileappender.java:156)     @ org.apache.log4j.fileappender.<init>(fileappender.java:97)     @ org.apache.log4j.rollingfileappender.<init>(rollingfileappender.java:60)     @ org.apache.velocity.runtime.log.log4jlogchute.initappender(log4jlogchute.java:118)     ... 83 more  severe: there unspecified exception whilst sending email java.lang.nullpointerexception     @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:1198)     @ org.apache.velocity.runtime.runtimeinstance.parse(runtimeinstance.java:1181)     @ org.apache.velocity.runtime.runtimeinstance.evaluate(runtimeinstance.java:1297)     @ org.apache.velocity.runtime.runtimeinstance.evaluate(runtimeinstance.java:1265)     @ org.apache.velocity.app.velocity.evaluate(velocity.java:180)     @ tv.tarka.dastraxweb.integration.email.velocity.combine(velocity.java:111)     @ tv.tarka.dastraxweb.integration.email.emailconstructor.build(emailconstructor.java:99)     @ tv.tarka.dastraxweb.object.ticket.manualticketobj.create(manualticketobj.java:267)     @ tv.tarka.dastraxweb.service.tickets.newmanualticketmb.opennewticket(newmanualticketmb.java:51)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:601)     @ javax.el.beanelresolver.invokemethod(beanelresolver.java:779)     @ javax.el.beanelresolver.invoke(beanelresolver.java:528)     @ javax.el.compositeelresolver.invoke(compositeelresolver.java:257)     @ com.sun.el.parser.astvalue.invoke(astvalue.java:248)     @ com.sun.el.methodexpressionimpl.invoke(methodexpressionimpl.java:302)     @ org.jboss.weld.util.el.forwardingmethodexpression.invoke(forwardingmethodexpression.java:39)     @ org.jboss.weld.el.weldmethodexpression.invoke(weldmethodexpression.java:50)     @ com.sun.faces.facelets.el.tagmethodexpression.invoke(tagmethodexpression.java:105)     @ javax.faces.component.methodbindingmethodexpressionadapter.invoke(methodbindingmethodexpressionadapter.java:87)     @ com.sun.faces.application.actionlistenerimpl.processaction(actionlistenerimpl.java:101)     @ javax.faces.component.uicommand.broadcast(uicommand.java:315)     @ javax.faces.component.uiviewroot.broadcastevents(uiviewroot.java:791)     @ javax.faces.component.uiviewroot.processapplication(uiviewroot.java:1256)     @ com.sun.faces.lifecycle.invokeapplicationphase.execute(invokeapplicationphase.java:81)     @ com.sun.faces.lifecycle.phase.dophase(phase.java:101)     @ com.sun.faces.lifecycle.lifecycleimpl.execute(lifecycleimpl.java:118)     @ javax.faces.webapp.facesservlet.service(facesservlet.java:593)     @ org.apache.catalina.core.standardwrapper.service(standardwrapper.java:1550)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:343)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.primefaces.webapp.filter.fileuploadfilter.dofilter(fileuploadfilter.java:79)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:61)     @ org.apache.shiro.web.servlet.advicefilter.executechain(advicefilter.java:108)     @ org.apache.shiro.web.servlet.advicefilter.dofilterinternal(advicefilter.java:137)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:66)     @ org.apache.shiro.web.servlet.advicefilter.executechain(advicefilter.java:108)     @ org.apache.shiro.web.servlet.advicefilter.dofilterinternal(advicefilter.java:137)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.shiro.web.servlet.proxiedfilterchain.dofilter(proxiedfilterchain.java:66)     @ org.apache.shiro.web.servlet.abstractshirofilter.executechain(abstractshirofilter.java:449)     @ org.apache.shiro.web.servlet.abstractshirofilter$1.call(abstractshirofilter.java:365)     @ org.apache.shiro.subject.support.subjectcallable.docall(subjectcallable.java:90)     @ org.apache.shiro.subject.support.subjectcallable.call(subjectcallable.java:83)     @ org.apache.shiro.subject.support.delegatingsubject.execute(delegatingsubject.java:383)     @ org.apache.shiro.web.servlet.abstractshirofilter.dofilterinternal(abstractshirofilter.java:362)     @ org.apache.shiro.web.servlet.onceperrequestfilter.dofilter(onceperrequestfilter.java:125)     @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256)     @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:217)     @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:279)     @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:175)     @ org.apache.catalina.core.standardpipeline.doinvoke(standardpipeline.java:655)     @ org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:595)     @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:161)     @ org.apache.catalina.connector.coyoteadapter.doservice(coyoteadapter.java:331)     @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:231)     @ com.sun.enterprise.v3.services.impl.containermapper$adaptercallable.call(containermapper.java:317)     @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:195)     @ com.sun.grizzly.http.processortask.invokeadapter(processortask.java:860)     @ com.sun.grizzly.http.processortask.doprocess(processortask.java:757)     @ com.sun.grizzly.http.processortask.process(processortask.java:1056)     @ com.sun.grizzly.http.defaultprotocolfilter.execute(defaultprotocolfilter.java:229)     @ com.sun.grizzly.defaultprotocolchain.executeprotocolfilter(defaultprotocolchain.java:137)     @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:104)     @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:90)     @ com.sun.grizzly.http.httpprotocolchain.execute(httpprotocolchain.java:79)     @ com.sun.grizzly.protocolchaincontexttask.docall(protocolchaincontexttask.java:54)     @ com.sun.grizzly.selectionkeycontexttask.call(selectionkeycontexttask.java:59)     @ com.sun.grizzly.contexttask.run(contexttask.java:71)     @ com.sun.grizzly.util.abstractthreadpool$worker.dowork(abstractthreadpool.java:532)     @ com.sun.grizzly.util.abstractthreadpool$worker.run(abstractthreadpool.java:513)     @ java.lang.thread.run(thread.java:722) 

the actual line of code triggers error is:

org.apache.velocity.app.velocity.evaluate(context, writer, "velocity log tag", emailtemplate); 

the line find interesting is:

caused by: java.io.filenotfoundexception: velocity.log (permission denied) 

i reading posts , velocity docs , appears error might caused when velocity trying log file not have permission write to.

this in fact issue logging permissions. assuming using separate instances velocityengine need specify property prevent logging:

velocityengine ve = new velocityengine(); ve.setproperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.nulllogsystem"); ve.init(); 

thats it!

nb. don't love answer switches off velocity logging velocity , running if having problems.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -