**`NullPointerException` in `BundleRevisionImpl.getResourcesLocal` (`Content.hasEntry`) when opening MariaDB JDBC connection after upgrading to Lucee 7.1.2.184-RC / extension changes**

OS: Windows
Java Version: Java 25
Jeety Version: 12.1.13
Lucee Version: 7.1.2.184-RC

Write up compiled by Google Gemini.

Environment

  • Lucee Version: 7.1.2.184-RC (upgraded in-place from 7.1.1.16-RC)
  • Java Version: JDK 25.0.4+7 (64-bit)
  • Servlet Container: Eclipse Jetty 12.1.12 (ee11)
  • OS: Windows 10 / 11 (64-bit)
  • JDBC Driver / Extension: MariaDB JDBC Extension 3.5.3 (F2FA5DB2-0C27-499C-B1171D2D812FDAF9, org.mariadb.jdbc.Driver / mariadb-java-client:3.5.3)

Description

After upgrading Lucee from 7.1.1.16-RC to 7.1.2.184-RC (and removing/updating extensions in the Lucee Administrator without a full JVM restart), executing queryExecute() when the datasource connection pool creates a new MariaDB JDBC connection throws a java.lang.NullPointerException inside Apache Felix (org.apache.felix.framework.BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:558)):

text

lucee.runtime.exp.PageRuntimeException: Cannot invoke “org.apache.felix.framework.cache.Content.hasEntry(String)” because the return value of “java.util.List.get(int)” is null

Concurrently, lucee-server/context/logs/felix.log is flooded with:

text

ERROR:

Unable to get module class path.


What Happens Under the Hood

  1. During the in-place upgrade from 7.1.1.16-RC to 7.1.2.184-RC (and subsequent extension cleanup in deploy.log), Lucee updates/removes .lex extensions and OSGi bundles while the JVM is running.
  2. When DatasourceConnectionFactory.create() invokes org.mariadb.jdbc.Driver.connect(), the MariaDB driver (3.5.3) calls org.mariadb.jdbc.Configuration.loadCodecs(), which uses java.util.ServiceLoader to look up META-INF/services/org.mariadb.jdbc.plugin.Codec via the OSGi BundleClassLoader.
  3. BundleWiringImpl$BundleClassLoader.getResources() delegates to BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:558).
  4. Because the underlying OSGi bundle revision’s content path failed to resolve (logging Unable to get module class path. in felix.log), getContentPath() contains a null entry in its List<Content>, causing contentPath.get(i).hasEntry(name) at BundleRevisionImpl.java:558 to throw NullPointerException.

Relevant Log Entries

1. deploy.log

text

“INFO”,“qtp93314457-62553”,“10/23/2026”,“10:39:06”,“”,“Update-Engine”,“Installing Lucee version [7.1.2.184-RC] (previous version was [7.1.1.16-RC])”

…

“INFO”,“qtp93314457-62553”,“10/23/2026”,“10:39:09”,“”,“request”,“Successfully installed the following extensions: 37C61C0A-5D7E-4256-8572639BE0CF5838;groupId=org.lucee;artifactId=esapi-extension;version=3.1.0.1, 97EB5427-F051-4684-91EBA6DBB5C5203F;groupId=org.lucee;artifactId=scheduler-classic-extension;version=1.0.0.2, 212BA548-F15A-4EBD-8B1EEDF8DD8A844D;groupId=org.lucee;artifactId=mail-extension;version=1.1.0.17;since=7.1.0.0, 8D7FB0DF-08BB-1589-FE3975678F07DB17;groupId=org.lucee;artifactId=compress-extension;version=2.1.0.3, CED6227E-0F49-6367-A68D21AACA6B07E8;groupId=org.lucee;artifactId=administrator-extension;version=1.0.0.9, B737ABC4-D43F-4D91-8E8E973E37C40D1B;groupId=org.lucee;artifactId=image-extension;version=3.1.0.11”

…

“INFO”,“qtp93314457-4909”,“10/23/2026”,“11:47:48”,“”,“extension”,“Found the extension [F2FA5DB2-0C27-499C-B1171D2D812FDAF9;symbolic-name=F2FA5DB2-0C27-499C-B1171D2D812FDAF9;version=3.5.3] in the installed folder that is not present in the configuration in any version, so we will uninstall it”

“INFO”,“qtp93314457-4909”,“10/23/2026”,“11:47:48”,“”,“extension”,“remove admin/dbdriver/MariaDB.cfc”

“INFO”,“qtp93314457-4909”,“10/23/2026”,“11:47:48”,“”,“extension”,“Remove JDBC Driver [class:org.mariadb.jdbc.Driver;name:mariadb-java-client;version:3.5.3;] from extension [MariaDB:3.5.3]”

“INFO”,“qtp93314457-4909”,“10/23/2026”,“11:47:48”,“”,“extension”,“removed extension [F2FA5DB2-0C27-499C-B1171D2D812FDAF9;symbolic-name=F2FA5DB2-0C27-499C-B1171D2D812FDAF9;version=3.5.3]”

2. felix.log

text

ERROR [Fri Oct 23 10:39:07 CDT 2026]:

Error starting D:\Jetty-Bases\Jetty-Base-12\lucee-server\bundles\owasp-java-html-sanitizer-20260313.1.jar

ERROR [Fri Oct 23 10:39:29 CDT 2026]:

Unable to get module class path.

ERROR [Fri Oct 23 10:39:29 CDT 2026]:

Unable to get module class path.

3. Full Stack Trace (application.log)

text

lucee.runtime.exp.NativeException: lucee.runtime.exp.PageRuntimeException:Cannot invoke “org.apache.felix.framework.cache.Content.hasEntry(String)” because the return value of “java.util.List.get(int)” is null

at lucee.commons.lang.ExceptionUtil.toIOException(ExceptionUtil.java:249)

at lucee.runtime.db.DatasourceConnectionFactory.create(DatasourceConnectionFactory.java:67)

at lucee.runtime.db.DatasourceConnectionFactory.create(DatasourceConnectionFactory.java:22)

at org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:68)

at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:557)

at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:299)

at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:231)

at lucee.runtime.config.DatasourceConnPool.borrowObject(DatasourceConnPool.java:41)

at lucee.runtime.db.DatasourceManagerImpl.getConnection(DatasourceManagerImpl.java:85)

at lucee.runtime.tag.Query.executeDatasoure(Query.java:1159)

at lucee.runtime.tag.Query._doEndTag(Query.java:714)

at lucee.runtime.tag.Query.doEndTag(Query.java:577)

at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:93)

at lucee.runtime.functions.query.QueryExecute.call(QueryExecute.java:57)

…

Caused by: lucee.runtime.exp.PageRuntimeException: Cannot invoke “org.apache.felix.framework.cache.Content.hasEntry(String)” because the return value of “java.util.List.get(int)” is null

at lucee.runtime.op.Caster.toPageRuntimeException(Caster.java:3631)

at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:110)

at lucee.runtime.db.DatasourceConnectionFactory.create(DatasourceConnectionFactory.java:61)

… 163 more

Caused by: lucee.runtime.exp.NativeException: Cannot invoke “org.apache.felix.framework.cache.Content.hasEntry(String)” because the return value of “java.util.List.get(int)” is null

at org.apache.felix.framework.BundleRevisionImpl.getResourcesLocal(BundleRevisionImpl.java:558)

at org.apache.felix.framework.BundleWiringImpl.findResourcesByDelegation(BundleWiringImpl.java:1201)

at org.apache.felix.framework.BundleWiringImpl.getResourcesByDelegation(BundleWiringImpl.java:1111)

at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.getResources(BundleWiringImpl.java:2550)

at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1074)

at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1099)

at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1142)

at java.base/java.util.ServiceLoader$1.hasNext(ServiceLoader.java:1164)

at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1246)

at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)

at org.mariadb.jdbc.Configuration.loadCodecs(Configuration.java:2283)

at org.mariadb.jdbc.Configuration.buildUrl(Configuration.java:1170)

at org.mariadb.jdbc.Configuration$Builder.build(Configuration.java:3571)

at org.mariadb.jdbc.Configuration.parseInternal(Configuration.java:732)

at org.mariadb.jdbc.Configuration.parse(Configuration.java:674)

at org.mariadb.jdbc.Driver.connect(Driver.java:99)

at org.mariadb.jdbc.Driver.connect(Driver.java:29)

at lucee.runtime.db.DataSourceSupport._getConnection(DataSourceSupport.java:124)

at lucee.runtime.db.DataSourceSupport.getConnection(DataSourceSupport.java:106)

… 164 more

Caused by: java.lang.NullPointerException: Cannot invoke “org.apache.felix.framework.cache.Content.hasEntry(String)” because the return value of “java.util.List.get(int)” is null

… 183 more


Also note one additional error currently firing in D:\Jetty-Bases\Jetty-Base-12\lucee-server\context\logs\application.log every minute from Lucee’s background SpoolerEngineImpl:

  • D:\Jetty-Bases\Jetty-Base-12\lucee-server\context\remote-client\open\*.tsk (java.nio.file.NoSuchFileException) — if you’d like me to check or clean up those orphaned .tsk references or include that in a separate ticket, just let me know!
1 Like

Thanks for the detailed write-up and the logs, they help a lot.

The important line is in your deploy.log at 11:47:48: Lucee uninstalled the MariaDB extension (3.5.3) because it was no longer in the configuration. Removing it also uninstalls the MariaDB driver bundle. Your datasource still had the old driver instance cached, so the next new connection used a driver whose bundle was already gone, and Felix fails with that NullPointerException. That’s a bug on our side. You should get a clear “driver not available” error, not an NPE, and the datasource should pick up the driver again. I’ve filed it as LDEV-6722.

To find out why the extension was removed, could you check a few things?

  1. Did you uninstall or update the MariaDB extension in the Administrator around 11:47, or did you only change other extensions? If so, which ones?
  2. Is MariaDB still listed under extensions in lucee-server/context/.CFConfig.json, and does extensionList() still show it?
  3. Is there an error in application.log or deploy.log just before 11:47:48 about loading the MariaDB extension?
  4. Does it work again after reinstalling the MariaDB extension and restarting Lucee?

As a workaround, reinstall the MariaDB extension and restart the JVM. After an in-place core upgrade, a full restart is recommended in general.

The owasp-java-html-sanitizer error in felix.log and the .tsk messages from the spooler are separate issues. Feel free to open a separate topic for the .tsk errors.

I reinstalled the MariaDB extension. Everything is working. While I can’t verify this but I think it was due to these extensions not defined in cfConfig.json. If I have time I will try to reproduce the issue.

Thanks for letting us know, Andrew, glad it’s working again. That fits the deploy.log line: Lucee removes an installed extension that isn’t listed in .CFConfig.json, which is what happened at 11:47:48. If you find a way to reproduce how MariaDB dropped out of the config, please post the steps here. The NullPointerException itself is tracked in LDEV-6722, so in future you’ll get a clear error instead.

on a related note: