djl icon indicating copy to clipboard operation
djl copied to clipboard

UnsatisfiedLinkError: C:\Users\kangert\AppData\Local\Temp\onnxruntime-java11604848578009472144\onnxruntime.dll: Can't find dependent libraries

Open kkangert opened this issue 2 years ago • 3 comments
trafficstars

Description

When linking the static library, I will be prompted that it cannot be found, but I have seen the temporary path created and it exists. What is the problem?

Expected Behavior

(what's the expected behavior?)

Error Message

Invocation of init method failed; nested exception is java.lang.UnsatisfiedLinkError: C:\Users\kangert\AppData\Local\Temp\onnxruntime-java11604848578009472144\onnxruntime.dll: Can't find dependent libraries at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.21.jar:5.3.21]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-contex at com.nenginfo.aiserver.ai.impl.ObjectDetectionServiceImpl.init(ObjectDetectionServiceImpl.java:80) ~[main/:na] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:577) ~[na:na] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.21.jar:5.3.21] ... 21 common frames omitted

How to Reproduce?

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

What have you tried to solve it?

Environment Info

Please run the command ./gradlew debugEnv from the root directory of DJL (if necessary, clone DJL first). It will output information about your system, environment, and installation that can help us debug your issue. Paste the output of the command below:

PASTE OUTPUT HERE

kkangert avatar Feb 17 '23 01:02 kkangert

@kangerts Can you try to install VC++ redistribution pack?

You can use dependency walker to see you miss any .dll file in your system. See: https://docs.djl.ai/master/docs/development/troubleshooting.html#13-unsatisfiedlinkerror-issue

frankfliu avatar Feb 17 '23 02:02 frankfliu

@kangerts Can you try to install VC++ redistribution pack?

You can use dependency walker to see you miss any .dll file in your system. See: https://docs.djl.ai/master/docs/development/troubleshooting.html#13-unsatisfiedlinkerror-issue

We have tried to install VC++redistribution pack, but the same problem still exists.

kkangert avatar Feb 17 '23 02:02 kkangert

@kangerts

Can you a few things:

  1. Can you run DJL demo on your machine directly and see if it works
  2. Can you try to use OnnxRuntime directly, and see if that works on your machine?

Something strange here, your stackstace doesn't show any DJL code.

frankfliu avatar Feb 17 '23 05:02 frankfliu