platonai / PulsarRPA

Automate webpages at scale, scrape web data completely and accurately with high performance, distributed AI-RPA.
Apache License 2.0
778 stars 118 forks source link

Function "DOM_LOCATION" not found; SQL statement #22

Closed ScalaFirst closed 2 years ago

ScalaFirst commented 2 years ago

I use StaticH2SQLContext().executeQuery(sql) in ide, it work complete. but when I use mvn package and java -jar to start project. it throw this problem: Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) Caused by: org.h2.jdbc.JdbcSQLException: Function "DOM_LOCATION" not found; SQL statement: select xxx from xxx at org.h2.message.DbException.getJdbcSQLException(DbException.java:357) at org.h2.message.DbException.get(DbException.java:179) at org.h2.message.DbException.get(DbException.java:155) at org.h2.command.Parser.readJavaFunction(Parser.java:2699) at org.h2.command.Parser.readFunction(Parser.java:2756) at org.h2.command.Parser.readTerm(Parser.java:3102) at org.h2.command.Parser.readFactor(Parser.java:2587) at org.h2.command.Parser.readSum(Parser.java:2574) at org.h2.command.Parser.readConcat(Parser.java:2544) at org.h2.command.Parser.readCondition(Parser.java:2370) at org.h2.command.Parser.readAnd(Parser.java:2342) at org.h2.command.Parser.readExpression(Parser.java:2334) at org.h2.command.Parser.parseSelectSimpleSelectPart(Parser.java:2245) at org.h2.command.Parser.parseSelectSimple(Parser.java:2277) at org.h2.command.Parser.parseSelectSub(Parser.java:2133) at org.h2.command.Parser.parseSelectUnion(Parser.java:1946) at org.h2.command.Parser.parseSelect(Parser.java:1919) at org.h2.command.Parser.parsePrepared(Parser.java:463) at org.h2.command.Parser.parse(Parser.java:335) at org.h2.command.Parser.parse(Parser.java:307) at org.h2.command.Parser.prepareCommand(Parser.java:278) at org.h2.engine.Session.prepareLocal(Session.java:626) at org.h2.engine.Session.prepareCommand(Session.java:564) at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247) at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78) at ai.platon.pulsar.ql.context.AbstractSQLContext.executeQuery(AbstractSQLContext.kt:89) ... 10 more

when I use ScentSQLContext.create() to package , it work complete, But SQLContexts.create() is error. How can I use SQLContext to package and work successfully ?

ScalaFirst commented 2 years ago

Now I use force registerudfs to resolved it. image