简体   繁体   English

如何为Google数据流添加依赖项?

[英]How do you add dependencies to google dataflow?

I am trying to add opencv to a data-flow project. 我正在尝试将opencv添加到数据流项目中。 And from what I have read, all you should have to do is add the opencv jar and it will be uploaded to the staging bucket. 从我读到的内容来看,您需要做的就是添加opencv jar并将其上传到登台存储桶。 But I know that cant be all (mostly doesn't work). 但是我知道这不可能全部(大多数情况下是行不通的)。 I get the following error when I try to run my code as a direct pipeline on my local machine. 当我尝试在本地计算机上将代码作为直接管道运行时,出现以下错误。


Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.videoio.VideoCapture.VideoCapture_1(Ljava/lang/String;)J at org.opencv.videoio.VideoCapture.VideoCapture_1(Native Method) at org.opencv.videoio.VideoCapture.<init>(VideoCapture.java:40)


I have read this post, How do I add Java dependencies to a Google Dataflow project? 我已经阅读了这篇文章, 如何将Java依赖项添加到Google Dataflow项目中? , but all it says it to add the jar to the classpath. ,但上面说的都是将jar添加到类路径中。 Which doesnt work. 这不起作用。 I am missing something obvious I feel. 我缺少明显的感觉。

UnsatisfiedLinkError is: Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native. UnsatisfiedLinkError是:如果Java虚拟机无法找到声明为native的方法的适当本机语言定义,则抛出该异常。 https://docs.oracle.com/javase/7/docs/api/java/lang/UnsatisfiedLinkError.html https://docs.oracle.com/javase/7/docs/api/java/lang/UnsatisfiedLinkError.html

Since the issue is occurring when you build/run locally, it is not related to the Dataflow Service or uploading to a staging bucket. 由于此问题是在本地构建/运行时发生的,因此与Dataflow Service无关或与上载到暂存存储桶无关。

A quick Google search for "opencv UnsatisfiedLinkError" brought up many results. Google快速搜索“ opencv UnsatisfiedLinkError”带来了许多结果。 The most common response was that this line is missing: 最常见的答复是缺少此行:

static {
  System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Java依赖项添加到Google Dataflow项目? - How do I add Java dependencies to a Google Dataflow project? 如何向 Google Dataflow PubSubIO Write 添加属性 - How to add attributes to Google Dataflow PubSubIO Write 构建促销:您如何管理依赖项? - Build promotion: how do you manage dependencies? 如何将Google视觉依赖项添加到我的.aar? - How to add Google vision dependencies to my .aar? 使用 Beam Java SDK 在 Google Dataflow 上安装 apt-get 依赖项 - Install apt-get dependencies on Google Dataflow with Beam Java SDK 如何从Google App Engine应用程序运行Google Dataflow管道? - How do I run a Google Dataflow pipeline from a Google App Engine app? 如何在Spring Boot应用程序中模拟外部依赖关系? - How do you mock external dependencies in spring boot application? 你如何从eclipse中刷新maven依赖? - How do you refresh maven dependencies from eclipse? 如何停止jboss的wrapwrap远程解决依赖关系? - How do you stop jboss shrinkwrap from resolving dependencies remotely? 您如何以编程方式访问已解决的实现依赖项? - How do you programmatically access resolved implementation dependencies?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM