回 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)