Java.security.NoSuchAlgorithmException:Cannot find any provider supporting desede/cbc/pkcs5padding

Source: Internet
Author: User

Recently in doing 3DES encryption, under the local window run OK program, put to the Linux environment unexpectedly error:

Java.security.NoSuchAlgorithmException:Cannot find any provider supporting desede/cbc/pkcs5padding
At Javax.crypto.Cipher.getInstance (cipher.java:524)
At Com.haha.encrypt.ThreeDES.encryptMode (threedes.java:30)
At Com.haha.encrypt.ThreeDES.encryptString (threedes.java:101)
At Com.haha.mina.MinaServerHandler.sessionIdle (minaserverhandler.java:91)
At Org.apache.mina.core.filterchain.defaultiofilterchain$tailfilter.sessionidle (DefaultIoFilterChain.java:665)
At Org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionIdle (defaultiofilterchain.java:398)
At org.apache.mina.core.filterchain.defaultiofilterchain.access$1000 (defaultiofilterchain.java:47)
At Org.apache.mina.core.filterchain.defaultiofilterchain$entryimpl$1.sessionidle (DefaultIoFilterChain.java:755)
At Org.apache.mina.core.filterchain.IoFilterAdapter.sessionIdle (iofilteradapter.java:95)
At Org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionIdle (defaultiofilterchain.java:398)
At org.apache.mina.core.filterchain.defaultiofilterchain.access$1000 (defaultiofilterchain.java:47)
At Org.apache.mina.core.filterchain.defaultiofilterchain$entryimpl$1.sessionidle (DefaultIoFilterChain.java:755)
At Org.apache.mina.core.filterchain.IoFilterAdapter.sessionIdle (iofilteradapter.java:95)
At Org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionIdle (defaultiofilterchain.java:398)
At Org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionIdle (defaultiofilterchain.java:391)
At Org.apache.mina.core.session.AbstractIoSession.notifyIdleSession0 (abstractiosession.java:1303)
At Org.apache.mina.core.session.AbstractIoSession.notifyIdleSession (abstractiosession.java:1289)
At Org.apache.mina.core.session.AbstractIoSession.notifyIdleness (abstractiosession.java:1274)
At Org.apache.mina.core.polling.AbstractPollingIoProcessor.notifyIdleSessions (Abstractpollingioprocessor.java : 760)
At org.apache.mina.core.polling.abstractpollingioprocessor.access$900 (abstractpollingioprocessor.java:67)
At Org.apache.mina.core.polling.abstractpollingioprocessor$processor.run (abstractpollingioprocessor.java:1135)
At Org.apache.mina.util.NamePreservingRunnable.run (namepreservingrunnable.java:64)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615)
At Java.lang.Thread.run (thread.java:744)


Contrast the lower security.getproviders ()

Window below:

INFO 2014-04-30 10:32:12 Serverstarter:67-0[sun]
INFO 2014-04-30 10:32:12 Serverstarter:67-1[sunrsasign]
INFO 2014-04-30 10:32:12 Serverstarter:67-2[sunec]
INFO 2014-04-30 10:32:12 Serverstarter:67-3[sunjsse]
INFO 2014-04-30 10:32:12 Serverstarter:67-4[sunjce]
INFO 2014-04-30 10:32:12 SERVERSTARTER:67-5[SUNJGSS]
INFO 2014-04-30 10:32:12 SERVERSTARTER:67-6[SUNSASL]
INFO 2014-04-30 10:32:12 Serverstarter:67-7[xmldsig]
INFO 2014-04-30 10:32:12 SERVERSTARTER:67-8[SUNPCSC]
INFO 2014-04-30 10:32:12 Serverstarter:67-9[sunmscapi]

Linux under:

INFO 2014-04-30 10:33:55 Serverstarter:66-0[sun]
INFO 2014-04-30 10:33:55 Serverstarter:66-1[sunrsasign]
INFO 2014-04-30 10:33:55 Serverstarter:66-2[sunjsse]
INFO 2014-04-30 10:33:55 SERVERSTARTER:66-3[SUNJGSS]
INFO 2014-04-30 10:33:55 SERVERSTARTER:66-4[SUNSASL]
INFO 2014-04-30 10:33:55 Serverstarter:66-5[xmldsig]
INFO 2014-04-30 10:33:56 SERVERSTARTER:66-6[SUNPCSC]


Suspicion is the lack of sunjce caused, but in the Linux Java_home/jre/lib/ext directory, there are Sunjce_provider.jar packs, so very strange.

Miss his sister, finally in an article, find a sentence, "Find a Sunjce_provider.jar file into your class path", the result, OK ....

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.