-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error to run tdlib in springboot project in windows 10 #3009
Comments
You need to provide the argument command-line as '-Djava.library.path=.'. Regarding the crash see #2912 (comment). |
just to make sure, so what I need to do is basically recreate https://tdlib.github.io/td/build.html?language=Java but with having a modifiedd CMakeLists.txt, is that correct? |
Yes, modifying CMakeLists.txt or downgrading MSVC is supposed to help. |
Thank you, i want to make sure again. so , what i need to do is basically convert it into a .jar, add it to maven, and then then include the java.library.path in the command again ( referencing to where the .dll file are) into the arguments when running the springboot using ./mvnw spring-boot:run ? |
Yes, after rebuilding you can pack the library in a .JAR file and use it in your project. |
hello sir, could you help me again? just to really make sure again. so, i've to follow this instructions https://tdlib.github.io/td/build.html?language=Java, but changed the cmakelist just right after the first line, and then after that continue the installation. after all the instruction is done, then i've to create jar using this command in the td root directory and after that, i've to include the jar into the pom. i also have to include the .dll using argument java.library.path when running the springboot using ./mvnw spring-boot:run, is that correct? |
The first paragraph is correct. I can't confirm exact steps for including the library in a springboot project. |
i want to make sure again. everytime that i want to run the project with tdlib.jar being used inside of the java project, i must supply the java.library.path for the tdjni.dll in the script argument? |
Yes. You can use only Java classes directly from .jar, so you need to ship tdjni.dll and its dependent libraries separately and provide java.library.path to be able to load them. |
i'm kinda a little confused. after following the instructions in here https://tdlib.github.io/td/build.html?language=Java , do i've to follow the other instructions in here https://github.com/tdlib/td/tree/master/example/java ? like both of this
|
https://github.com/tdlib/td/tree/master/example/java contains generic description of the build process and https://tdlib.github.io/td/build.html?language=Java shows specific instructions for the chosen operating system. It is simpler to use https://tdlib.github.io/td/build.html?language=Java in most cases. |
okay, thanks for answering. I think there are several unknown problem to me that I didn't know before ( like somehow the dlls is being imported twice or more in the runtime ). |
Hi @jonnjonnjo , did you import tdlib to a spring boot project successful ? can you give me some tips |
Yes, I do! I think i got several errors.
|
Hi @jonnjonnjo , I followed the tdlib instructions and run it successful, but could not import to other spring boot project. in the tdlib example, i added maven to it then i have installed tdlib.jar to maven local repository (mvn clean install), then import it to my spring boot project in pom: but when compile my spring project, it said "could not find package org.drinkless.tdlib" |
what is the expectation should show when use jar tf tdlib.jar bro @jonnjonnjo |
@jonnjonnjo @levlam , the issue was resolved and build success when i comment out this plugins in file pom of tdlib project :): |
i've a springboot and try to run
./mvnw spring-boot:run '-Dspring-boot.run.jvmArguments="-Djava.library.path=src/main/resources/native/windows/x64"'
the tdjni.dll path is in here
When i run the first script, i got
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffd34892f58, pid=17124, tid=5200
JRE version: Java(TM) SE Runtime Environment (21.0.3+7) (build 21.0.3+7-LTS-152)
Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.3+7-LTS-152, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
Problematic frame:
C [msvcp140.dll+0x12f58]
No core dump will be written. Minidumps are not enabled by default on client versions of Windows
An error report file with more information is saved as:
D:\College\Industrial Practices\socmed-service\hs_err_pid17124.log
[4.569s][warning][os] Loading hsdis library failed
If you would like to submit a bug report, please visit:
https://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
and then I tried to run this code in the tdjni.dll directory
java -Djava.library.path=. org.drinkless.MainClass
but, i got
Error: Could not find or load main class .library.path=.
Caused by: java.lang.ClassNotFoundException: /library/path=/
can anyone can help me in this?
The text was updated successfully, but these errors were encountered: