Translate

Friday, October 15, 2021

Tomcat - Unable to locate persistence units error

I recently was working on updating the libraries for a Java web application and was unable to connect to the database. Stepping through the program in Tomcat I saw that it was giving me the "Unable to locate persistence units" error. This puzzled me for a long time, so I decided to take a closer look as I stepped through the application. The actual error message in the exception was "unrecognized persistence.xml version 2.2"! So I reverted back to version 2.1!

Tomcat - Service will not start, incorrect function error in Windows System Log

The Tomcat service would not start. I checked the Windows System Log and found the following error.
This was caused by Java version on the system not matching the Java version in Tomcat. Check the current Java version in Windows by opening a command prompt and executing "Java - version". Then check the version in Tomcat by executing Tomcat#w.exe, where # is the Tomcat version number, located in the bin folder under your Tomcat install. Check the Java tab and check the entry for Java Virtual Machine. These are my settings with the corrected setting in Tomcat: