• Welcome to KonaKart Community Forum. Please login or sign up.
 

Installation on windows

Started by chrisderham, July 08, 2009, 04:29:14 pm

Previous topic - Next topic

chrisderham

I would like to configure konakart to start as a windows service. Have I missed some documentation? What do I need to do?

I have used tomcat in the passed, so I went into the c:\program files\konakart\bin directory and ran service install tomcatKonakart, which works fine. However I think that there are some memory tweaks that you guys use in the start up scripts that won't be picked up using this. Any pointers appreciated

Thanks

Brian

Look at startkonakart.bat script in the bin directory.

In that you will find:

set CATALINA_OPTS=-XX:PermSize=256m -XX:MaxPermSize=256m -Xmx800m

You should adjust the memory settings to suit your own environment.

chrisderham

So to clarify for others, open a command prompt. Assuming a default installation cd into the c:\program files\konakart, and run the following commands

set CATALINA_HOME=c:\program files\konakart
service install tomcatKonakart

The last parameter is the name to appear in the servivce list. You can call it anything you like. Then execute the following to bring up the tomcat service gui.

tomcat6w //ES//tomcatKonakart

Navigate to the java tab, and on a new line append the following

-XX:MaxPermSize=256m

Also update the maximum memory pool setting to 800. Then on the general tab, change the startup type to Automatic, and click start. The new service should now be configured to start when the computer starts, with the recommended memory settings.

chrisderham

Ok - well that does and doesn't work. The service comes up, and serves requests for a while. However after an unknown period of time, tomcat dies. Nothing is logged in tomcat as it dies. I understand that this can be a known problem with tomcat when it runs out of memory.

Am I trying to do something odd? Is no one else trying to run konakart deployed on tomcat as a service? By default the install routines will create an icon for you on the desktop. You can run this, but if the server reboots due to windows updates, the process dies. How does everyone else run the tomcat web server for konakart? I can't believe that no-one else has hit this issue

Thanks for any help anyone can provide

Brian

I'm puzzled that you don't get useful information in the log.   How about in the Microsoft Events log - anything in there?

If you suspect that it's running short of memory why not just give it some more (although -Xmx800m should be ample for a small site)

I have never had problems running tomcat as a service but I haven't used tomcat6w before.

Rather than calling tomcat6w have you tried, even as an experiment, simply calling the normal startkonakart.bat - this way it will run the same way as it does interactively.  Maybe this will give you some clues about your problem with tomcat6w ?

Other ideas would be to redirect stdout (--StdOutput) and stderr (--StdError)  - if you aren't getting diagnostic information. 

chrisderham

The is nothing useful in the event logs.

I believe that the steps above would setup a service with 800mb max memory. Currently we are trying to run four stores within a single tomcat process. From reading other posts, I thought that this would be ok. The problem manifested itself when we only had two stores. Perhaps this is indicates that I have not configured the multi stores in a single tomcat instance properly. All we did was to copy the konakart, konakartadmin and birtviewer folders, renaming each for each site we wanted. Then go into them and edit the konakartadmin.properties files to point to different database schemas, and edited the birtviewer/reports/lib/konakart.rptlibrary file to point to the correct location of the konakartadmin folder.

When you say you have not had problems running tomcat as a service before, but haven't used tomcat6w, can you please elaborate on how you setup it up as a service?

When you suggest "simply calling the normal startkonakart.bat" I don't understand. On Unix/Linux systems using run levels it is easy to call arbitrary code to startup as the machine starts. No one needs to logon. Nice and easy. On Windows AFAIK this can only be achieved by configuring the code to run as a service. If no one is logged onto the windows machine, then you can't run an arbitrary batch file. Can you please explain what you meant?

As I understand using tomcat6w will redirect standard out and error to the log files directory. We see files labelled stdout_20090721.log in the konakart logs directory. These contain the startup licence messages etc displayed when you run startkonakart.bat interactively.

In one of the log files we do see the following message. I guess SEVERE is the clue - this means that is is an uncaught exception right? From a little googling, this appears to be caused by running out of connections to the database. In the kanakart.properties file, I notice that the maxActive is set to 0, which means no limit. So presumably we have to set a limit here, such that the database is happy with the total number of connections from each shop, e.g. if db is happy with 40 connections, and 4 shops, then set maxActive for each shop to 10 - right?

21-Jul-2009 11:57:02 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: ServletException in
'/WEB-INF/jsp/NewProductsWithDetailBody.jsp':
com.konakart.app.KKException: org.apache.torque.TorqueException:
org.apache.commons.dbcp.SQLNestedException: Could not retrieve
connection info from pool
       at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
       at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
       at org.apache.jsp.WEB_002dINF.jsp.MainLayout_jsp._jspx_meth_tiles_005finsert_005f9(MainLayout_jsp.java:519)
       at org.apache.jsp.WEB_002dINF.jsp.MainLayout_jsp._jspService(MainLayout_jsp.java:207)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
       at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
       at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
       at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
       at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
       at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
       at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
       at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
       at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
       at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
       at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
       at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
       at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
       at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:419)
       at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:378)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
       at java.lang.Thread.run(Thread.java:619)

chrisderham

Just bumping this. Hoping for a reply