FISCO-BCOS / FISCO-BCOS/java-sdk
照着官网的Asset步骤编译成功,但是部署时Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
- Dominant language
- Java
- Stars
- 58
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
参考教程
https://fisco-bcos-documentation.readthedocs.io/zh_CN/latest/docs/tutorial/sdk_application.html
代码全部复制此教程内容
部署合约报错,命令
```
bash asset_run.sh deploy
```
错误内容:
```
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/io/Resource
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.Resource
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
```
jdk信息
```
Matching Java Virtual Machines (2):
1.8.201.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_201 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the SDK application tutorial and inspect asset_run.sh, then reproduce the issue with bash asset_run.sh deploy. Trace the deployment entry point and its runtime dependencies using the reported Java environment. Done means the contract deployment completes without the NoClassDefFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100