Page 1 of 1

Unable to create Windows Tomcat Service

PostPosted:Fri Mar 01, 2013 7:37 am
by mariot
I have successfully installed openKM on Windows 7 using the wizard. At the moment to startup/shutdown openKM I use the shortcuts created on the desktop. My preference is to create a windows service but am unable to get this working. Has anyone succeeded in creating a windows service to start/stop openKM on Windows?

Re: Unable to create Windows Tomcat Service

PostPosted:Sun Mar 03, 2013 9:05 am
by jllort
You can take a look here : http://wiki.openkm.com/index.php/Config ... at_service we propose install tomcat installer which will configure as service and then overwrite with openkm tomcat files ( it's the most easies way for get it ). Other more elegant solution is here http://tomcat.apache.org/tomcat-7.0-doc ... howto.html

Re: Unable to create Windows Tomcat Service

PostPosted:Tue Mar 05, 2013 1:26 pm
by mariot
Thank you for your response.

I would like to get the Tomcat service configured using your first recommendation as it 'appears' to be quite straight forward. Navigating to the link you mentioned (http://wiki.openkm.com/index.php/Config ... at_service) it actually states that you should not over write the tomcat bundle with the tomcat windows service installer. To confirm this I ran the installer and specified the existing directories for the jre and tomcat (ie. C:\openkm-6.2.2-community\java\jre and C:\openkm-6.2.2-community\tomcat). I then ran the bat file C:\openkm-6.2.2-community\tomcat\bin\startup.bat to startup OpenKM. This resulted in java errors being displayed in numerous log files. I then navigated to http://localhost:8080/OpenKM and the error 'HTTP Status 404 - /OpenKM' was displayed. I also attempted to startup the Tomcat 7 service but this failed. A check of the event log showed the following errors:

The Apache Tomcat Tomcat7 service terminated with service-specific error The operation completed successfully..

- EventData
param1 Apache Tomcat Tomcat7
param2 %%0


Can you please suggest which directories I should specified when running the apache-tomcat-7.0.27.exe Windows Service Installer?

NOTE: I initially ran openkm-6.2.2-community-windows-installer.exe to successfully install OpenKM and was then able to login into http://localhost:8080/OpenKM

Re: Unable to create Windows Tomcat Service

PostPosted:Wed Mar 06, 2013 9:56 pm
by jllort
The description in wiki is a fast way to configure tomcat, in your case I think the idea should be:
1- intall openkm at -> c:\openkm -> which will contains folder tomcat
2- rename c:\openkm\tomcat to tomcat_old
3- use tomcat installer and install to c:\openkm\tomcat
4- test start / stop service
5- ( with tomcat service stopped ) copy all contents into c:\openkm\tomcat_old to c:\openkm\tomcat

As you can see it's not a very clean and professional way to get tomcat installed as service, but is the easiest I can suggest now. The other way is described in tomcat website page where's indicated how register tomcat using command line tool ( more complex and needs understanding where's java path etc... )

Re: Unable to create Windows Tomcat Service

PostPosted:Tue Mar 12, 2013 12:38 pm
by mariot
Your first recommendation worked. Thank you for all your help.

Re: Unable to create Windows Tomcat Service

PostPosted:Fri Jul 03, 2020 9:49 am
by sammy
OpenKM Service Failure To Start with an Error message

Good morning Members,

I really do need help at this time?
Kindly go through my explanation below and provide me with assistance to best way in resolving the OpneKM service failure issue i encounter

OpenKM & Tomcat was installed successful, but Open KM service failed to start as shown below.
Code: Select all
SUCCESS: Specified value was saved.
- Configure service
Installing the service 'OpenKM' ...
Using CATALINA_HOME:    "C:\tomcat-8.5.34"
Using CATALINA_BASE:    "C:\tomcat-8.5.34"
Using JAVA_HOME:        "C:\Program Files\Java\jdk1.8.0_231"
Using JRE_HOME:         "C:\Program Files\Java\jdk1.8.0_231\jre"
Using JVM:              "C:\Program Files\Java\jdk1.8.0_231\jre\bin\server\jvm.dll"
Failed installing 'OpenKM' service
Following several other advice from different forums, some of the forums are shown in the link below.

1. See the link below and its steps

https://docs.openkm.com/kcenter/view/ok ... asaservice

https://support.eset.com/en/kb5550-apac ... sue-era-6x

https://stackoverflow.com/questions/458 ... ror-incorr


2. After battling with this for such a long time, i then repeated one of the step again which is;
In the java tab of the "openkmw" config file i changed the drop down option in "Mode" section from jvm to Java

I then restarted the service from service management console and it did restarted, like two hours later when I checked i then discovered that the service had gone down again.

The error message displayed when i tried to restart the service is ;

For Error Code 1

""Windows could not start the OpenKM on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to the service-specific error code 1.""

In Event Viewer the code 1 error shows this in System Event log/Viewer;

The OpenKM service terminated with the following service-specific error:
Incorrect function.

All this happens when Java mode is selected in Startup Tab & when Use Default is selected in the Java Tab
________________________
For Error Code 4

""Windows could not start the OpenKM on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to the service-specific error code 4.""

In Event Viewer the code 4 error shows this in System Event log/Viewer;

The OpenKM service terminated with the following service-specific error:
The system cannot open the file.

All this happens when jvm mode is selected in Startup/Shutdown Tab & when Use Default is selected in the Java Tab

Regards

Re: Unable to create Windows Tomcat Service

PostPosted:Sat Jul 04, 2020 8:13 am
by jllort
1- Did you installed the application with Administrator user? because it is mandatory to registering services.
2- Did you have a previous Tomcat or OpenKM service, you should remove it before trying to install newer.

My suggestion is revert all the service changes:
1- Ensure your JAVA_HOME point to JDK either JRE ( check your environment variables , you should have one named JAVA_HOME )
2- Open a terminal with administrator
3- go into TomcatXXX/bin folder and execute the command line
service.bat delete ( I do not remember if it is delete or remove, install etc... if you execute service.bat alone you will see the available parameters )
4- execute the command line "service.bat install" to register the service
5- execute the next command lines to register JVM in the service
Code: Select all
openkm //US//OpenKM ++JvmOptions="XX:+UseG1GC"
openkm //US//OpenKM ++JvmOptions="-Djava.awt.headless=true"
openkm //US//OpenKM ++JvmOptions="-Djava.net.preferIPv4Stack=true"
openkm //US//OpenKM ++JvmOptions="-Dfile.encoding=utf-8"
openkm //US//OpenKM ++JvmOptions="-Dsun.jnu.encoding=UTF-8"
openkm //US//OpenKM ++JvmOptions="-Dmail.mime.ignoreunknownencoding=true"