fresh install results in servlet exception

starting from a fresh debian virtual machine,

(in my case from cloud.debian.org/images/cloud/trixie/20260316-2418/debian-13-generic-amd64-20260316-2418.qcow2 )

  1. install dependecies:

sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes default-jdk-doc default-jdk-headless git mariadb-server maven vim-nox

  1. configure database root password

  2. clone core repo:

git clone -o upstream https://github.com/openmrs/openmrs-core.git


  1. cd openmrs-core, ./mvnw clean package -DforkCount=8

  2. cd webapp; ../mvnw jetty:run

  3. browse to vm’s 8080

  4. simple install,

which the first three progress bars complete

Then see a ServletException (below)

Also, I notice this in the xml, application.data.directory is empty.

I suspect that we need a step to set some data directory parameters including a jdbc url

HTTP ERROR 500 jakarta.servlet.ServletException: openmrs==org.openmrs.web.DispatcherServlet@b4b564e4{jsp=null,order=-1,inst=true,async=false,src=DESCRIPTOR:file:///work/src/openmrs-core/webapp/target/jetty/WEB-INF/web.xml,STARTED}

URI: /openmrs/index.htm
STATUS: 500
MESSAGE: jakarta.servlet.ServletException: openmrs==org.openmrs.web.DispatcherServlet@b4b564e4{jsp=null,order=-1,inst=true,async=false,src=DESCRIPTOR:file:///work/src/openmrs-core/webapp/target/jetty/WEB-INF/web.xml,STARTED}
SERVLET: openmrs
CAUSED BY: jakarta.servlet.ServletException: openmrs==org.openmrs.web.DispatcherServlet@b4b564e4{jsp=null,order=-1,inst=true,async=false,src=DESCRIPTOR:file:///work/src/openmrs-core/webapp/target/jetty/WEB-INF/web.xml,STARTED}
CAUSED BY: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘openmrsEventListeners’ defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean ‘adminService’ while setting bean property ‘globalPropertyListeners’ with key [6]
CAUSED BY: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘adminService’: Unsatisfied dependency expressed through field ‘dao’: Error creating bean with name ‘adminDAO’ defined in file [/work/src/openmrs-core/api/target/classes/org/openmrs/api/db/hibernate/HibernateAdministrationDAO.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContext-service.xml]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set ‘jakarta.persistence.jdbc.url’ for common cases or ‘hibernate.dialect’ when a custom Dialect implementation must be provided)
CAUSED BY: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘adminDAO’ defined in file [/work/src/openmrs-core/api/target/classes/org/openmrs/api/db/hibernate/HibernateAdministrationDAO.class]: Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContext-service.xml]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set ‘jakarta.persistence.jdbc.url’ for common cases or ‘hibernate.dialect’ when a custom Dialect implementation must be provided)
CAUSED BY: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [applicationContext-service.xml]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set ‘jakarta.persistence.jdbc.url’ for common cases or ‘hibernate.dialect’ when a custom Dialect implementation must be provided)
CAUSED BY: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to determine Dialect without JDBC metadata (please set ‘jakarta.persistence.jdbc.url’ for common cases or ‘hibernate.dialect’ when a custom Dialect implementation must be provided)
CAUSED BY: org.hibernate.HibernateException: Unable to determine Dialect without JDBC metadata (please set ‘jakarta.persistence.jdbc.url’ for common cases or ‘hibernate.dialect’ when a custom Dialect implementation must be provided)

As an experiment, after cloning, if I:

git checkout 2.8.5

And then change the calls from “mvnw” to “mvn”, the setup completes as expected.

Thus, this seems to be an issue with the current state of the master branch.

1 Like

Thanks for sharing the fix @eric_herman