NullPointerException with Lucee, sqlite.jar

Created a super-fresh, super-minimal site. I dumbed this down as much as possible to try to solve my issue. Would appreciate any insight y’all might be able to offer.

Here’s the content of the entire site.
image

Application.cfc:


component{
	this.datasources["jdbcTest"] = {
		class: 'org.sqlite.JDBC'
		, bundleName: 'org.sqlite.JDBC'
		, connectionString: 'jdbc:sqlite:./db/test.db'
	};
}

server.json:

{
    "app":{
        "cfengine":"lucee@5.4.3.2",
        "libDirs":"C:\\Websites\\jdbc\\lib"
    },
    "name":"jdbc"
}

…and index.cfm:


<cfdump var='#createObject("java", "org.sqlite.JDBC")#' />

<cfquery name="qTest" datasource="jdbcTest">
	SELECT * FROM entries LIMIT 5;
</cfquery>

I can 100% dump the createObject() return. But EVERY time I try to do the query, I just get:

I also tried all of these for the URL (I believe the last commented one is the most correct):

		// , connectionString: 'jdbc:sqlite:./db/test.db'
		// , connectionString: 'jdbc:sqlite:c:\\Websites\\jdbc\\db\\test.db'
		// , connectionString: 'jdbc:sqlite:c:/Websites/jdbc/db/test.db'
		, connectionString: 'jdbc:sqlite:c://Websites//jdbc//db//test.db'

I’m going to beat it all with a stick for a while, see what happens, but maybe one of y’all in the forums here has the immediate answer.

I just did an update to the latest Lucee 5 and got this instead:
The OSGi Bundle with name [org.sqlite.JDBC] for [] is not available locally [ (C:\Users\Capta\.CommandBox\server\558AB14FC8D758785C5D0B089FBC84E3-jdbc\lucee-5.4.6.9\WEB-INF\lucee-server\bundles)] or from the update provider [ (https://update.lucee.org)].

Not sure if there’s something different I’m supposed to be doing?

The issue appears to be that the bundle is returning null from its getVersion() call and Lucee doesn’t account for this, thus the NPE. I’m a little confused though as the SQL Lite JDBC driver does appear to be an OSGI bundle, but the symbolic name is org.xerial.sqlite-jdbc not org.sqlite.JDBC.

Did you find that config somewhere online, or are you just guessing as to the values?

That said, isn’t this a question better fit for the Lucee forum or Lucee bug tracker? It doesn’t seem related to any Ortus products.

Well, looks like I got it here from my history. Guessing that “xerial” label isn’t the OFFICIAL version then?
https://github.com/xerial/sqlite-jdbc/releases

I don’t know much about it, I assumed that was the proper location. Glad it didn’t have a virus. Derp.

Oh, @bdw429s I meant to add that I went through all the effort, too, to try this on H2.

image

	this.datasources["h2Test"] = {
		class: 'org.h2.Driver'
		, bundleName: 'org.h2.Driver'
		, connectionString: 'jdbc:h2:./db/test'
		, username: 'sa'

Well, H2 is different entirely. Lucee has its own OSGI bundled version of H2, but their bundle symbolic name is org.lucee.h2. It’s not really clear where you got the H2 jar from, or what documentation you followed that told you the bundle name would be org.h2.Driver.

Hah. Good catch. Unsure… BUT I did see YOU saying "H2 was bundled with Lucee a million years ago.

Obviously I didn’t read further, or I would’ve seen hsqldb instead of h2.
I tried your last comment on that post, too… org.lucee.h2 Same result.

		class: 'org.hsqldb.Driver'
		, bundleName: 'org.hsqldb.jdbcDriver'
		, connectionString: 'jdbc:hsqldb:file:./db/test'
		, username: 'sa'

and

	this.datasources["h2Test"] = {
		class: 'org.lucee.h2'
		, bundleName: 'org.lucee.h2'
		, connectionString: 'jdbc:h2:file:./db/test'
		// , connectionString: 'jdbc:h2:c:/Websites/jdbc/db/test'
		, username: 'sa'
	};

`lucee.commons.lang.ClassException: In the OSGi Bundle with the name [org.lucee.h2] was no class with name [org.lucee.h2] found. org.lucee.h2 not found by [45]

Truth is, I’m “coding by coincidence” here. I can’t find a really good setup guide anyway.
`

Edited after likely notification emails were sent.

The class name doesn’t change when you use the Lucee bundle. The class name and the OSGI bundle name aren’t the same thing.

Do you have a working example of a server.json config (or straight code) on how to setup an H2 datasource and what .jar I should be using?