开发者社区> 问答> 正文

求助各位大神 Unsupported algorithmHmacSHA1


Exception in thread "main" java.lang.RuntimeException: Unsupported algorithm: HmacSHA1
        at com.aliyun.common.auth.HmacSHA1Signature.sign(HmacSHA1Signature.java:79)
        at com.aliyun.common.auth.HmacSHA1Signature.computeSignature(HmacSHA1Signature.java:43)
        at com.aliyun.openservices.oss.internal.OSSRequestSigner.sign(OSSRequestSigner.java:37)
        at com.aliyun.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:153)
        at com.aliyun.common.comm.ServiceClient.sendRequest(ServiceClient.java:136)
        at com.aliyun.openservices.oss.internal.OSSOperation.send(OSSOperation.java:60)
        at com.aliyun.openservices.oss.internal.OSSBucketOperation.listBuckets(OSSBucketOperation.java:122)
        at com.aliyun.openservices.oss.OSSClient.listBuckets(OSSClient.java:219)
        at com.poi.TestOOS.main(TestOOS.java:23)


展开
收起
呀呀 2015-12-04 13:00:30 14310 0
8 条回答
写回答
取消 提交回答
  • 回 6楼zhouzf05的帖子
    你好 你最好是怎么解决的?
    2018-12-04 17:06:03
    赞同 展开评论 打赏
  • 回 5楼oss-dev的帖子
    请问下,IDK是什么 ?
    2016-05-26 14:42:23
    赞同 展开评论 打赏
  • Re求助各位大神 Unsupported algorithmHmacSHA1
    有解决方法么 上面红框的解决方法不起作用 感觉是jdk的问题
    2016-05-10 17:10:09
    赞同 展开评论 打赏
  • 回 8楼莫名的帖子
    该问题
    在jetty下就出现该问题,部署到tomcat下该问题就没了!
    是不是哪里出问题?
    2016-01-14 13:38:13
    赞同 展开评论 打赏
  • 回 7楼(呀呀) 的帖子
    按照标红的这两个步骤操作下

    2015-12-08 10:31:41
    赞同 展开评论 打赏
  • java 是什么版本的?
    idk中没有保护嘛?
    2015-12-04 15:56:53
    赞同 展开评论 打赏
  • 回 1楼zhouzf05的帖子

            ClientConfiguration config = new ClientConfiguration();
            OSSClient client = new OSSClient(OSS_ENDPOINT, ACCESS_ID, ACCESS_KEY,
                    config);
            System.out.println(client.doesBucketExist(bucketName));

    -------------------------

    回 3楼zhouzf05的帖子
    我放main 方法里跑的。就报这个错

    -------------------------

    Re求助各位大神 Unsupported algorithmHmacSHA1
    严重: Servlet.service() for servlet [jsp] in context with path [/happy-geeshop] threw exception [java.lang.RuntimeException: Unsupported algorithm: HmacSHA1] with root cause
    java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
        at javax.crypto.Mac.getInstance(Mac.java:176)
        at com.aliyun.oss.common.auth.HmacSHA1Signature.sign(HmacSHA1Signature.java:76)
        at com.aliyun.oss.common.auth.HmacSHA1Signature.computeSignature(HmacSHA1Signature.java:60)
        at com.aliyun.oss.internal.OSSRequestSigner.sign(OSSRequestSigner.java:49)
        at com.aliyun.oss.common.comm.ServiceClient.sendRequestImpl(ServiceClient.java:87)
        at com.aliyun.oss.common.comm.ServiceClient.sendRequest(ServiceClient.java:67)
        at com.aliyun.oss.internal.OSSOperation.send(OSSOperation.java:89)
        at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:130)
        at com.aliyun.oss.internal.OSSOperation.doOperation(OSSOperation.java:108)
        at com.aliyun.oss.internal.OSSBucketOperation.listObjects(OSSBucketOperation.java:327)
        at com.aliyun.oss.OSSClient.listObjects(OSSClient.java:393)
        at net.jeeshop.core.oss.OSSFileManagerJson.getDirList(OSSFileManagerJson.java:218)
        at net.jeeshop.core.oss.OSSFileManagerJson.write(OSSFileManagerJson.java:116)
        at org.apache.jsp.resource.kindeditor_002d4_1_7.jsp.file_005fmanager_005fjson_jsp._jspService(file_005fmanager_005fjson_jsp.java:141)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at net.jeeshop.core.filter.EncodeFilter.doFilter(EncodeFilter.java:33)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
        at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
        at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    2015-12-04 13:30:07
    赞同 展开评论 打赏
  • Re求助各位大神 Unsupported algorithmHmacSHA1
    你启动程序的java命令是什么?

    -------------------------

    Re求助各位大神 Unsupported algorithmHmacSHA1
    这个是在IDE内启动报错么?

    -------------------------

    回 4楼呀呀的帖子
    这个函数是JDK的rt.jar内带的,不太会遇到这个错误,你的JAVA版本是多少?
    如果你是IDE内运行,你有没有配置啥JVM参数更改了classpath?
    如果你是命令行运行,能否把命令行参数发出来?
    2015-12-04 13:28:09
    赞同 展开评论 打赏
滑动查看更多
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Substitution failure is not an 立即下载
Substitution failure 立即下载
Stream Processing takes on Everything 立即下载