我正在按照 this 在我的 Java 程序中使用 pdal。 我在我的 pom 中添加了以下依赖项:
<dependency>
<groupId>io.pdal</groupId>
<artifactId>pdal-native</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.pdal</groupId>
<artifactId>pdal_3</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.pdal</groupId>
<artifactId>pdal-scala_2.13</artifactId>
<version>2.7.0</version>
</dependency>
代码是:
Pipeline pipeline = new Pipeline(json, LogLevel.Info()); //error on this line
pipeline.execute();
但这失败了:
java.lang.RuntimeException:运行
命令时出错uname
我不确定“uname”的来源。它不是我的管道 json 的一部分。
我错过了什么?
编辑:
这是堆栈跟踪:
java.lang.RuntimeException: Error running `uname` command
at scala.sys.package$.error(package.scala:27) ~[scala-library-2.13.13.jar:na]
at com.github.sbt.jni.syntax.NativeLoader$.liftedTree1$1(NativeLoader.scala:21) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.loadPackaged$1(NativeLoader.scala:22) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.load$1(NativeLoader.scala:56) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.load(NativeLoader.scala:59) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader.<init>(NativeLoader.scala:6) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at io.pdal.Pipeline$.<init>(Pipeline.scala:50) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline$.<clinit>(Pipeline.scala:50) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline.<init>(Pipeline.scala:30) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline.<init>(Pipeline.scala:33) ~[pdal_3-2.7.0.jar:2.7.0]
at com.lidarapidemo.lidarprocessing.LidarProcessor.streamPointCloudPostgis(LidarProcessor.java:100) ~[classes/:na]
at com.lidarapidemo.controllers.LidarController.lambda$pointsInBoundingBox$0(LidarController.java:39) ~[classes/:na]
at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:110) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:97) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.context.request.async.WebAsyncManager.lambda$startCallableProcessing$4(WebAsyncManager.java:348) ~[spring-web-6.1.11.jar:6.1.11]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
2024-08-13T12:15:25.380+05:30 ERROR 2384 --- [lidarapidemo] [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Async processing failed: java.lang.ExceptionInInitializerError] with root cause
java.lang.RuntimeException: Error running `uname` command
at scala.sys.package$.error(package.scala:27) ~[scala-library-2.13.13.jar:na]
at com.github.sbt.jni.syntax.NativeLoader$.liftedTree1$1(NativeLoader.scala:21) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.loadPackaged$1(NativeLoader.scala:22) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.load$1(NativeLoader.scala:56) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader$.load(NativeLoader.scala:59) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at com.github.sbt.jni.syntax.NativeLoader.<init>(NativeLoader.scala:6) ~[sbt-jni-core_3-1.7.0.jar:1.7.0]
at io.pdal.Pipeline$.<init>(Pipeline.scala:50) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline$.<clinit>(Pipeline.scala:50) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline.<init>(Pipeline.scala:30) ~[pdal_3-2.7.0.jar:2.7.0]
at io.pdal.Pipeline.<init>(Pipeline.scala:33) ~[pdal_3-2.7.0.jar:2.7.0]
at com.lidarapidemo.lidarprocessing.LidarProcessor.streamPointCloudPostgis(LidarProcessor.java:100) ~[classes/:na]
at com.lidarapidemo.controllers.LidarController.lambda$pointsInBoundingBox$0(LidarController.java:39) ~[classes/:na]
at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:110) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBodyReturnValueHandler$StreamingResponseBodyTask.call(StreamingResponseBodyReturnValueHandler.java:97) ~[spring-webmvc-6.1.11.jar:6.1.11]
at org.springframework.web.context.request.async.WebAsyncManager.lambda$startCallableProcessing$4(WebAsyncManager.java:348) ~[spring-web-6.1.11.jar:6.1.11]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
总结评论:您正在使用的库对于您运行程序的操作系统不可行。
uname
是一个存在于 Unix 上的程序(因此也存在于 Linux 和 MacOS 上),但不存在于 Windows 上。
因此在 Windows 上运行您的程序预计会失败。