KonaKart Community Forum

Installation / Configuration => Configuration of KonaKart => Topic started by: fizzlepop on June 22, 2010, 01:45:32 pm

Title: KonaKart throws exception on any action that requires an email be sent
Post by: fizzlepop on June 22, 2010, 01:45:32 pm
I am having a problem that only occurs on my production server konakart and konakart web applications.  These issues do not occur on my local version of tomcat that is packaged with the konakart distribution.

My web hosting company provides Tomcat 5.5. I have deployed the konakart and konakartadmin war files, and I am able to view all the web pages, add items to the shopping cart, etc.  The problems occur on any action requiring an email be sent, such as requesting a new password, registering a new user, placing an order, etc.  I get the following exception:


The details of the malfunction are :

Exception Name = com.konakart.app.KKException
Exception Message = org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.AvalonLogChute with the current runtime configuration.

I searched the forum and found this topic before. So I replaced the tomcat/conf/logging.properties file and tomcat/common/classes/log4j.properties file on the production Tomcat with the versions that came with the konakart distribution, but this did not fix the problem.

Do you have any recommendations on how to fix this problem?

Thanks.
Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: kate on June 22, 2010, 01:48:12 pm
Are you sure you haven't missed off some more information from that exception...?   
Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: fizzlepop on June 22, 2010, 04:23:39 pm
That is all that is displayed in the browser page.

In konakartadmin, when trying to reset a user's password in the Customers section, the complete exception is:

(org.apache.velocity.exception.VelocityException) - Failed to initialize an instance of org.apache.velocity.runtime.log.AvalonLogChute with the current runtime configuration.


Exception Stack Trace =
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:206)
at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:255)
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:795)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:250)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:615)
at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:121)
at com.konakartadmin.bl.AdminHtmlMgr.getVelocityEngine(Unknown Source)
at com.konakartadmin.bl.AdminEmailMgr.sendNewPasswordEmail(Unknown Source)
at com.konakartadmin.bl.AdminCustomerMgr.resetCustomerPassword(Unknown Source)
at com.konakartadmin.bl.AdminCustomerMgr.resetCustomerPassword(Unknown Source)
at com.konakartadmin.bl.KKAdmin.resetCustomerPassword(Unknown Source)
at com.konakartadmin.server.KKAdminGWTServiceImpl.resetCustomerPassword(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)

Exception Cause =
at org.apache.velocity.runtime.log.AvalonLogChute.initTarget(AvalonLogChute.java:119)
at org.apache.velocity.runtime.log.AvalonLogChute.init(AvalonLogChute.java:89)
at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:255)
at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:795)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:250)
at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:615)
at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:121)
at com.konakartadmin.bl.AdminHtmlMgr.getVelocityEngine(Unknown Source)
at com.konakartadmin.bl.AdminEmailMgr.sendNewPasswordEmail(Unknown Source)
at com.konakartadmin.bl.AdminCustomerMgr.resetCustomerPassword(Unknown Source)
at com.konakartadmin.bl.AdminCustomerMgr.resetCustomerPassword(Unknown Source)
at com.konakartadmin.bl.KKAdmin.resetCustomerPassword(Unknown Source)
at com.konakartadmin.server.KKAdminGWTServiceImpl.resetCustomerPassword(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)

Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: fizzlepop on June 22, 2010, 07:38:50 pm
If this helps...

JVM Version: 1.5.0_21-b01
Tomcat Version: 5.5.28
Linux kernel: 2.6.27.18-22

Again, this works fine on my local installation of konakart 4.2.0.1.  The problems occur when I deploy the konakart.war to my web host's tomcat server.

Any guidance would be greatly appreciated.
Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: kate on June 22, 2010, 08:07:08 pm
look at the exceptions in the logs..  do you see any more useful information?   Anything about not being able to write a velocity.log file for example?
Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: fizzlepop on June 22, 2010, 09:41:37 pm
Hi, yes, i found this just now:

Caused by: java.lang.Exception: Error configuring AvalonLogChute : java.io.FileNotFoundException: /usr/local/tomcat/apache-tomcat-5.5.28/bin/velocity.log (Permission denied)
        at org.apache.velocity.runtime.log.AvalonLogChute.initTarget(AvalonLogChute.java:119)
        at org.apache.velocity.runtime.log.AvalonLogChute.init(AvalonLogChute.java:89)
        at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
        ... 32 more


I do not have access to write to this directory - where can I configure Velocity to not put its log file there?

Thanks
Title: Re: KonaKart throws exception on any action that requires an email be sent
Post by: fizzlepop on June 23, 2010, 12:10:31 am
Hi Kate,

I resolved the issue by placing the following settings in the konakart_velocity.properties file.  I think it would be good for these to be in there by default, since it keeps the velocity.log from being written to the tomcat/bin directory. 

Joe

runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
runtime.log.logsystem.log4j.category=velocity