Solve the Problem of com.sun.org. apache. xml. internal. security. utils does not exist,

Source: Internet
Author: User

Solve the Problem of com.sun.org. apache. xml. internal. security. utils does not exist,

I found a lot of answers on the Internet, but my problem was not solved. After sleeping for one night, I accidentally fixed the problem and gave it to my friends who encountered the same problem.

Method 1 (eclipse ):

Answers from the online experts:

We do not recommend using com. sun for self-written programs .. This item belongs to "Deprecated and restricted API "..

In addition, various com. sun packages now have alternatives ..

If the company's old project is not available, you can use eclipse to import maven, properties-> Java Compiler-> Errors/Warnings-> Deprecated and restricted API->
Forbidden reference-> "error" to "warning"

JDK 5 can use this api. JDK 6 cannot be used later. It can only start with java or javax. (It is said that, do not take it seriously)

 

Method 2:

Delete:

import com.sun.org.apache.xml.internal.security.utils.Base64;  

Add:

import org.apache.commons.codec.binary.Base64;  

Encryption/decryption (replacement ):

Base64.encodeBase64String

Base64.decodeBase64

You can also use java 8 to import java. util. Base64.

 

    

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.