1

I need your help because I try to install eHour on my server (it is a windows server) without success:

as described in the documentation, there are two types of installations:

  • Standalone
  • War file (documentation link seems bad and go to old installation instructions, new is here )

First, I try Standalone way but even if eHour service was running, I didn't have any web pages.
So I uninstall eHour and try to use the War file way

as it is a new server, I install Apache Tomcat (version 10.0.4) and mysql Then, I copy WAR distribution and I unzip it to my C drive (I also renamed the folder from ehour-1.4.3 to ehour)
Then I create a setevn.bat file and create a variable EHOUR_HOME
set EHOUR_HOME="c:\ehour"

Then I download mysql connector and copy file mysql-connector-java-8.0.23.jar to Tomcat 10.0/lib directory

Finally, I rename the war file from ehour-1.4.3.war to ehour.war and copy it to Tomcat 10.0/webapps directory

I start apache and a directory ehour has been added to Tomcat 10.0/webapps directory but localhost:8080/ehour result is 404 : The requested resource [/ehour] is not available.

I look in catalina log but see nothing that help me

Any tips ?

it seems I do have same error than here : in file localhost.log I do have similar error:

EHOUR_HOME environment variable or context parameter not defined   
nested exception is java.io.FileNotFoundException: ${EHOUR_HOME}\conf\ehour.properties (The system cannot find the path specified)

Howerver, I do create a file setenv.bat in Tomcat/bin directory its contents is :
set EHOUR_HOME="c:\ehour"
something I miss?

DonKnacki
  • 427
  • 4
  • 11
  • Tomcat 10 implements Servlet 5.0, which is incompatible with most web applications. Check [Servlet 5.0 JAR throws compile error on javax.servlet.* but Servlet 4.0 JAR does not](https://stackoverflow.com/q/64387472/11748454). You should use Tomcat 9.0 instead. – Piotr P. Karwasz Mar 17 '21 at 14:06
  • it doesn't help but I do have some error in logs : INFO [http-nio-8080-exec-3] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. SEVERE [http-nio-8080-exec-3] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file – DonKnacki Mar 17 '21 at 14:33
  • You should add the logs by editing your question, not in a comment. The _"appropriate container log file"_ is `catalina..log`. – Piotr P. Karwasz Mar 17 '21 at 14:44
  • Check also `localhost. .log` for the details of the errors. – Piotr P. Karwasz Mar 17 '21 at 16:36
  • ok, I found new log in localhost..log file : seems ehour variable is not well set – DonKnacki Mar 18 '21 at 09:45

1 Answers1

0

You are using Windows, so you are probably using Procrun (Commons Daemon/Tomcat Monitor) to start Tomcat as a Windows service. Procrun doesn't use the *.bat files at all, everything is configured through the graphical interface prunmgr (check this answer for screenshots).

Unfortunately you can't configure environment variables through the graphical interface, so either:

  • add the environment variable globally (for all users) to your system,

  • or add the environment variable to procrun either:

    • run
      Tomcat10.exe update "++Environment=C:\ehour"
      
      (Tomcat10.exe is a copy of procrun and is in the bin directory of Tomcat's installation),
    • add to the windows registry key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\<service_name>\Parameters a new value named Environment of type REG_MULTI_SZ with data EHOUR_HOME=C:\ehour.

Edit: There are actually three different sources for the EHOUR_HOME configuration parameter (cf. EhourHomeUtil and EnvInitListener), which are looked up in this order:

  1. the Java system property EHOUR_HOME, which you can configure in e.g. $CATALINA_BASE/conf/catalina.properties,
  2. the OS environment variable EHOUR_HOME, configured as explained above,
  3. the servlet context init parameter EHOUR_HOME, which can be configured in the appropriate context file:
<Parameter name="EHOUR_HOME" value="/path/to/ehour" />
Piotr P. Karwasz
  • 12,857
  • 3
  • 20
  • 43
  • perfect! I create a windows registry key . Note that data shall be ```EHOUR_HOME=C:/ehour``` however it is reading as C:ehour – DonKnacki Mar 18 '21 at 13:39
  • `EHOUR_HOME=C:\ehour` will set the value of `EHOUR_HOME` to `C:\ehour`, but the program itself may choke on the quirks of Windows file path syntax. Java interprets `C:/ehour` and `/C:/ehour` as a synonim for `C:\ehour`. – Piotr P. Karwasz Mar 18 '21 at 17:24