A base 64 parsing issue occurs with deploying Java projects

Source: Internet
Author: User

Before you deploy tomcat , you need to deploy the JDK environment, so there is some compatibility between JDK and tomcat, and the release issue is not discussed (JDK and Tomcat version, can not be too large,the JDK is backward compatible,jdk and Tomcat still have a lot of compatibility issues, I am not very clear, the following is an example:

after the server deployment is complete, access the project Access error via mobile app, view Tomcat log localhost_access.txt no exception, view Tomcat 's the following error occurred in the Logs/catalina.out log:

Java.security.InvalidKeyException:Illegalkey size

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8C/3D/wKiom1hl-ZPCK_hzAAHkv28FV1s288.png-wh_500x0-wm_3 -wmp_4-s_523425212.png "title=" qq20161230140655.png "alt=" wkiom1hl-zpck_hzaahkv28fv1s288.png-wh_50 "/>

its error is due to the problemof base, the Java almost all kinds of common cryptographic algorithms can find the corresponding Implementation. Due to export restrictions in the United states,Sun has imposed restrictions on access files (Local_policy.jar,us_export_policy.jar). So there are some problems:

The key length does not meet the requirements (for example:java.security.InvalidKeyException:Illegal key size or defaultparameters);

Some algorithms are not supported, such as MD4,SHA-224 and other algorithms;

● API is not very convenient to use, some of the commonly used conversion aids are not available, such as Base64 encoding conversion, hex encoding Conversion tools.

Oracle provides policy-free file access on its official website (Unlimited Strength jurisdiction policy Files), and we only need to deploy it in the JRE environment. You can solve the limitation Problem.

Java 5.0 No policy restrictions file:http://www.oracle.com/technetwork/java/javasebusiness/downloads/ Java-archive-downloads-java-plat-419418.html#jce_policy-1.5.0-oth-jpr

Java 6.0 no policy restriction files:

Http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html

Java 7.0 no policy restriction files:

Http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

after downloading, you can see local_policy.jar and Us_export_policy.jar and readme.txt

If you have installed JRE, place two jar files in the%jre_home%\lib\security directory to overwrite the original file

If you have installed JDK, and also put two jar files in the%jdk_home%\jre\lib\security directory to overwrite the original file

Reboot the host, access again, and you are DONE.


This problem first met, engaged for a day and a half, Daniel do not spray!

Hope to do their own meager power to help more friends!

This article is from the "11628832" blog, please be sure to keep this source http://11638832.blog.51cto.com/11628832/1887658

A base 64 parsing issue occurs with deploying Java projects

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.