Http://localhost:4990/crowd page is not loading because of missing org.hsqldb.jdbc.JDBCDriver

Hi,

I am trying to spool up a localhost instance of crowd. I created crowd plugin skeleton with the command ‘atlas-create-crowd-plugin’, modified crowd.version property to 6.1.1.

With this setup, when I spool up localhost instance with the command ‘atlas-debug’ and visit the http://localhost:4990/crowd url in browser, I see following error page

Upon looking at atlassian-crowd.log file, I see following errors.

Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275) ~[hibernate-core-5.4.33.Final.jar:5.4.33.Final]
...................................................................................................................
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: HHH010003: JDBC Driver class not found: org.hsqldb.jdbc.JDBCDriver
	at org.hibernate.c3p0.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:130) ~[hibernate-c3p0-5.4.33.Final.jar:5.4.33.Final]
	at com.atlassian.crowd.util.persistence.hibernate.connection.DelegatingConnectionProvider.configure(DelegatingConnectionProvider.java:74) ~[crowd-persistence-hibernate5-6.1.1.jar:?]
....................................................................................................
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hsqldb.jdbc.JDBCDriver]
	at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:133) ~[hibernate-core-5.4.33.Final.jar:5.4.33.Final]
	at org.hibernate.c3p0.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:127) ~[hibernate-c3p0-5.4.33.Final.jar:5.4.33.Final]
.........................................................................................................
Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hsqldb.jdbc.JDBCDriver
	at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:210) ~[hibernate-core-5.4.33.Final.jar:5.4.33.Final]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
	at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
	at java.base/java.lang.Class.forName(Class.java:467) ~[?:?]
...........................................................................................................
2025-03-07 15:53:06,370 main ERROR [ContainerBase.[Catalina].[localhost].[/crowd]] Exception sending context initialized event to listener instance of class [com.atlassian.crowd.console.listener.StartupListener]
java.lang.NullPointerException: Cannot invoke "com.atlassian.spring.container.ContainerContext.getComponent(Object)" because the return value of "com.atlassian.spring.container.ContainerManager.getContainerContext()" is null
	at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:43) ~[atlassian-spring-3.0.2.jar:?]
	at com.atlassian.crowd.console.listener.StartupListener.getLicenseManager(StartupListener.java:293) ~[classes/:?]
	at com.atlassian.crowd.console.listener.StartupListener.isLicenseValid(StartupListener.java:238) ~[classes/:?]
	at com.atlassian.crowd.console.listener.StartupListener.checkLicenseAndPerformUpgrade(StartupListener.java:132) ~[classes/:?]
	at com.atlassian.crowd.console.listener.StartupListener.lambda$contextInitialized$2(StartupListener.java:76) ~[classes/:?]
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:198) ~[?:?]
	at com.atlassian.crowd.console.listener.StartupListener.contextInitialized(StartupListener.java:71) ~[classes/:?]
.........................................................................................................


2025-03-07 15:53:06,455 main INFO [ContainerBase.[Catalina].[localhost].[/crowd]] Closing Spring root WebApplicationContext
2025-03-07 15:53:06,604 main INFO [com.atlassian.crowd.startup] Stopping Crowd

Here are the contents of the pom.xml file

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>com.rc.alm</groupId>
	<artifactId>crowdtest</artifactId>
	<version>1.0.0-SNAPSHOT</version>

	<name>crowdtest</name>
	<description>This is the com.rc.alm:crowdtest plugin for Atlassian Crowd.</description>
	<packaging>atlassian-plugin</packaging>
	<properties>
		<crowd.version>6.1.1</crowd.version>
		<crowd.data.version>6.1.1</crowd.data.version>
		<amps.version>8.2.3</amps.version>
		<plugin.testrunner.version>2.0.2</plugin.testrunner.version>
		<osgi.javaconfig.version>0.2.0</osgi.javaconfig.version>
		<gson.version>2.9.1</gson.version>
		<!-- This property ensures consistency between the key in
		atlassian-plugin.xml and the OSGi bundle's key. -->
		<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<spring.version>5.3.19</spring.version>
		<atlassian.spring.scanner.version>3.0.1</atlassian.spring.scanner.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>4.0.1</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.atlassian.plugin</groupId>
			<artifactId>atlassian-spring-scanner-annotation</artifactId>
			<version>${atlassian.spring.scanner.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.hsqldb</groupId>
			<artifactId>hsqldb</artifactId>
			<version>2.7.3</version>
		</dependency>
		<!-- WIRED TEST RUNNER DEPENDENCIES -->
		<dependency>
			<groupId>com.atlassian.plugins</groupId>
			<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
			<version>${plugin.testrunner.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.atlassian.maven.plugins</groupId>
				<artifactId>crowd-maven-plugin</artifactId>
				<version>${amps.version}</version>
				<extensions>true</extensions>
				<configuration>
					<productVersion>${crowd.version}</productVersion>
					<productDataVersion>${crowd.data.version}</productDataVersion>
					<enableQuickReload>true</enableQuickReload>

					<!-- See here for an explanation of default instructions: -->
					<!--
					https://developer.atlassian.com/docs/advanced-topics/configuration-of-instructions-in-atlassian-plugins -->
					<instructions>
						<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
						<!-- Add package to export here -->
						<Export-Package>
							com.rc.alm.api,
						</Export-Package>
						<!-- Add package import here -->
						<Import-Package>
							org.springframework.osgi.*;resolution:="optional",
							org.eclipse.gemini.blueprint.*;resolution:="optional",
							*
						</Import-Package>
						<!-- Ensure plugin is spring powered -->
						<Spring-Context>*</Spring-Context>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

I’m having trouble figuring out why the Crowd instance isn’t loading correctly.

Any assistance would be greatly appreciated

Hello @AnilKumar. I’m Patryk, one of the developers working on Crowd. I can reproduce your issue and have identified the root cause.

What happens is that crowd-maven-plugin 8.2.3, which is used in the plugin’s build process, does not support Crowd versions which use HSQL 2.x, and Crowd 6.1.1 is one of these versions. You’ll need to upgrade crowd-maven-plugin to at least 8.12.0 in order to start Crowd 6.1.1 without additional modifications to the configuration. Technically it would be possible to configure crowd-maven-plugin to copy the missing HSQL 2.x JAR to Tomcat libraries, however there may be other problems later down the line, which is why I strongly advise to upgrade crowd-maven-plugin. You can do so by modifying the amps.version Maven property. The latest version at the time of writing my reply is 9.2.6 - I was able to successfully start a basic plugin skeleton using that version.

I see that you also have a dependency on org.hsqldb:hsqldb in your project, most likely added when trying to troubleshoot that issue. I recommend removing it - compile time dependencies are copied into the built plugin jar, which means that your plugin would end up with its own copy of hsqldb, which would increase its size and potentially cause runtime issues later down the line.

Best regards
Patryk