Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2227) ~[na:na]
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:201) ~[jaxb-impl-2.3.0.jar:2.3.0]
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:197) ~[jaxb-impl-2.3.0.jar:2.3.0]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569) ~[na:na]
... 111 common frames omitted
2024-05-21 20:38:32.048 WARN 18180 --- [ main] com.aliyun.oss : [Unknown]Unable to execute HTTP request: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null
com.aliyun.oss.ClientException: 网络连接错误,详细信息:Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null
[ErrorCode]: Unknown
[RequestId]: Unknown
at com.chenxu.util.OssTemplate.upload(OssTemplate.java:43)
at com.chenxu.test.OssTest.testUpLoad(OssTest.java:32)
遇到这种问题可以先去看看JDK的版本将高版本的JDK降到11或者8再去尝试.