Hi Noel,

Adding that dependency solved that problem, but the program still breaks at 
runtime, this time with another error.

I have uploaded some sample code 
here: https://github.com/behrangsa/xyz-fs/tree/feature/graal

When I run the program with plain old Java, it runs fine and creates an 
empty database at ~/Crash.

When I run it through native-image, the executable crashes with:

org.h2.jdbc.JdbcSQLNonTransientException: (Message HY000 not found) 
[50000-204]
        at 
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:340)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:117)
        at org.h2.Driver.connect(Driver.java:59)
        at java.sql.DriverManager.getConnection(DriverManager.java:681)
        at java.sql.DriverManager.getConnection(DriverManager.java:252)
        at xyz.behrang.fs.Main.main(Main.java:10)
Caused by: java.lang.NullPointerException
        at org.h2.store.fs.FilePath.get(FilePath.java:87)
        at org.h2.store.fs.FileUtils.isAbsolute(FileUtils.java:139)
        at org.h2.engine.ConnectionInfo.getName(ConnectionInfo.java:457)
        at org.h2.engine.Engine.openSession(Engine.java:49)
        at org.h2.engine.Engine.openSession(Engine.java:222)
        at org.h2.engine.Engine.createSession(Engine.java:201)
        at 
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338)

I run this program under Linux. Under another OS it may work. But looks 
like native image doesn't like something about the way FilePath class is 
written.

On Wednesday, January 5, 2022 at 11:02:30 PM UTC+11 Noel Grandin wrote:

> You're missing the the JTS geometry classes
>
> Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: 
> com.oracle.graal.pointsto.constraints.UnresolvedElementException: 
> Discovered unresolved type during parsing: 
> org.locationtech.jts.geom.Geometry. 
> To diagnose the issue you can use the --allow-incomplete-classpath option. 
> The missing type is then reported at run time when it is accessed the first 
> time.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/318c581a-5965-4dfb-a69f-3c9fab887e8dn%40googlegroups.com.

Reply via email to