Re: [h2] H2DB breaks GraalVM native image production

2022-01-05 Thread Noel Grandin
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnV73jadeeMvF4UnKCLWLnjLQeUeMLQ5ooCCjdos5fKeoQ%40mail.gmail.com.


[h2] H2DB breaks GraalVM native image production

2022-01-05 Thread Behrang
Hi,

I am working on a small project where I use h2db as an embedded database. I 
want to compile this project using graalvm and use the produced binary.

However the dependency breaks the build. Are there any workarounds 
available?

*Sample build log:*

$ mvn -Pnative clean package
[INFO] Scanning for projects...
[INFO] 
[INFO] -< xyz.behrang:xyz-fs 
>-
[INFO] Building xyz-fs 1.0-SNAPSHOT
[INFO] [ jar 
]-
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xyz-fs ---
[INFO] Deleting 
/home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
xyz-fs ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ xyz-fs ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, 
i.e. build is platform dependent!
[INFO] Compiling 4 source files to 
/home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) 
@ xyz-fs ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
/home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
xyz-fs ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ xyz-fs ---
[INFO] No tests to run.
[INFO] 
[INFO] --- native-maven-plugin:0.9.9:test (test-native) @ xyz-fs ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ xyz-fs ---
[INFO] Building jar: 
/home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/target/xyz-fs-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- native-maven-plugin:0.9.9:build (build-native) @ xyz-fs ---
[INFO] ImageClasspath Entry: com.h2database:h2:jar:2.0.204:compile 
(file:///home/behrangsa/.m2/repository/com/h2database/h2/2.0.204/h2-2.0.204.jar)
[INFO] ImageClasspath Entry: commons-codec:commons-codec:jar:1.15:compile 
(file:///home/behrangsa/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar)
[INFO] ImageClasspath Entry: commons-io:commons-io:jar:2.11.0:compile 
(file:///home/behrangsa/.m2/repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar)
[INFO] ImageClasspath Entry: xyz.behrang:xyz-fs:jar:1.0-SNAPSHOT 
(file:///home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/target/xyz-fs-1.0-SNAPSHOT.jar)
[INFO] Executing: 
/home/behrangsa/.sdkman/candidates/java/current/bin/native-image -cp 
/home/behrangsa/.m2/repository/com/h2database/h2/2.0.204/h2-2.0.204.jar:/home/behrangsa/.m2/repository/commons-codec/commons-codec/1.15/commons-codec-1.15.jar:/home/behrangsa/.m2/repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:/home/behrangsa/Documents/Projects/github.com/behrangsa/xyz-fs/target/xyz-fs-1.0-SNAPSHOT.jar
 
-H:Class=xyz.behrang.fs.Main -H:Name=findex
[findex:56102]classlist: 614.69 ms,  0.96 GB
[findex:56102](cap): 377.03 ms,  0.96 GB
[findex:56102]setup:   1,329.99 ms,  0.96 GB
[findex:56102] analysis:   3,875.41 ms,  2.31 GB
Fatal error:com.oracle.graal.pointsto.util.AnalysisError$ParsingError: 
Error encountered while parsing 
org.h2.value.ValueToObjectConverter.valueToObject(java.lang.Class, 
org.h2.value.Value, org.h2.jdbc.JdbcConnection) 
Parsing context:
   at 
org.h2.value.ValueToObjectConverter.valueToObject(ValueToObjectConverter.java:281)
   at org.h2.schema.FunctionAlias$JavaMethod.execute(FunctionAlias.java:474)
   at 
org.h2.schema.FunctionAlias$JavaMethod.getValue(FunctionAlias.java:345)
   at org.h2.expression.function.JavaFunction.getValue(JavaFunction.java:40)
   at org.h2.command.dml.Call.update(Call.java:52)
   at org.h2.command.CommandList.executeRemaining(CommandList.java:49)
   at org.h2.command.CommandList.update(CommandList.java:66)
   at org.h2.command.Command.executeUpdate(Command.java:252)
   at org.h2.engine.Engine.openSession(Engine.java:258)
   at org.h2.engine.Engine.createSession(Engine.java:201)
   at 
org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:338)
   at org.h2.jdbc.JdbcConnection.(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.commands.Init.run(Init.java:35)
   at xyz.behrang.fs.Main.main(Main.java:28)
   at com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:147)
   at 

Re: [h2] Re: Create table error in 2.x, unsure how to interpret: expected "IDENTITY, BIGSERIAL, SERIAL, data type"

2022-01-05 Thread Vladimir Dzhuvinov
Thanks Andrei. I wasn't aware the "[*]" had that significance.

I posted a suggestion in the H2 website git repo to consider indicating the
applicable H2 version on the top of the ref pages.

On Wed, 5 Jan 2022 at 03:35, Andrei Tokar  wrote:

> Hi Vladimir,
>
> Please take a look at your error message again:
> ... amr ARRAY*[*]*, creation_ts ...
> Marker [*] shows where parser had choked, and something of sort "IDENTITY,
> BIGSERIAL, SERIAL, data type" is expected instead.
> At this point, it should be pretty clear that ARRAY has to be typed, and
> that is indeed a new requirement in 2.x, in line with SQL standard.
> You can consult documentation for exact syntax:
> https://h2database.com/html/datatypes.html#array_type
> And yes, syntax diagrams are supposed to be up to date.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/KOE7A1de1p0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> h2-database+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/fbc0af26-5d0b-41f2-9681-5df89ba0e514n%40googlegroups.com
> 
> .
>


-- 
Vladimir Dzhuvinov :: vladi...@dzhuvinov.com

-- 
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 h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CA%2BdqsRKE2gtobfKJXggZqc1y1ZVunEBh82pMuwA1TCc2Y0Xx7w%40mail.gmail.com.