Post Tomcat 8.0.53, when I install Tomcat (9.0.30 or 8.5.50) and install it as service (Using service.bat), it gets installed but with "Log on" as "Local Service" instead of "Local System account".
This can be seen under services in windows.
Because of this, when I run the service, the application is not able to read a file.
If I manually go to services, open properties for my service, then change the Log on as "Local System" and save, everything works perfectly.
--User
and --Password
as mentioned in the 8.5 and 9.0 documentation.These programs are located in Tomcat's /bin/ directory. Tomcat6 is the actual service wrapper program that allows Tomcat to be run as a service, and will run entirely in the background after it has been installed, and accepts a long list of command line parameters that allow precise configuration of the Tomcat service.
Use a browser to check whether Tomcat is running on URL http://localhost:8080 , where 8080 is the Tomcat port specified in conf/server. xml. If Tomcat is running properly and you specified the correct port, the browser displays the Tomcat homepage.
This appears to be a result of these issues: 55969 and 63310. The update to Commons Daemon 1.2.0 seems to be the cause, and it does not appear that one can modify this setting during installation.
However, it can be set to Local System afterwards from an administrator command prompt with the following command:
sc config Tomcat8 obj=LocalSystem
Hoping Google will pick this up so the next user can find this 3 hours quicker...
For me this error manifested itself with a Chrome console message:
net::ERR_CONTENT_LENGTH_MISMATCH 200
...and this error was only raised after my html called some css using relative path.
As shown above, the problem was solved by changing the windows service to a local system account which can interact with desktop.
Does any stackoverflow superuser know how to get that message into the question title above? That's what it Chrome shows when Tomcat "is not able to read a file".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With