Skip to content
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

调用 unifiedOrder 出错 #1518

Closed
hry8310 opened this issue Apr 17, 2020 · 7 comments
Closed

调用 unifiedOrder 出错 #1518

hry8310 opened this issue Apr 17, 2020 · 7 comments

Comments

@hry8310
Copy link

hry8310 commented Apr 17, 2020

报这个错误
nested exception is java.lang.NoClassDefFoundError: java/util/Base64$Encoder

@hry8310
Copy link
Author

hry8310 commented Apr 17, 2020

我是用的是 jdk7。网上是说需要升级到8。但我的环境受限。未必能升级到8。有什么办法处理码

@binarywang
Copy link
Owner

你的报错怎么出现的,
目前代码里调用的Base64不是你说的java.util包下的,请确认下问题。
另外,本身我们的sdk是支持jdk7的

@hry8310
Copy link
Author

hry8310 commented Apr 26, 2020

这个接口。默认使用使用jdk8的内置包。我使用的是jdk7就报错了。详细描述如下:

@hry8310
Copy link
Author

hry8310 commented Apr 26, 2020

工程中,pom 默认依赖的包 xstream 。其实版本是依赖jdk8的。因为Base64$Encoder 已经在jdk8内置加入了。所以工程引入的 xstream 将 Base64$Encoder 删除了。所以如果使用jdk7.无论是jdk内置,还是 xstream 都没有这个借口了(jdk7还没有升级加入,工程默认的xstrem也移除了)。所以需要手工在自己的工程里引入一个 xstream 的jdk7版本

@hry8310
Copy link
Author

hry8310 commented Apr 26, 2020

    <dependency>
         <groupId>com.thoughtworks.xstream</groupId>
         <artifactId>xstream</artifactId>
        <version>1.4.11-java7</version>
    </dependency>

@binarywang
Copy link
Owner

#1362

你的问题跟这个是一样的

@hry8310
Copy link
Author

hry8310 commented Apr 28, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants