Getting error while uploading the file using Java
Create Folder is working, but Upload file is not working.
Upload URL - https://upload.box.com/api/2.0/files/content
Error -
--------
Caused by: com.box.sdk.BoxAPIException: Couldn't connect to the Box API due to a network error.
at com.box.sdk.BoxMultipartRequest.writeBody(BoxMultipartRequest.java:171) ~[box-java-sdk-2.32.0.jar:na]
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:545) ~[box-java-sdk-2.32.0.jar:na]
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:354) ~[box-java-sdk-2.32.0.jar:na]
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:329) ~[box-java-sdk-2.32.0.jar:na]
at com.box.sdk.BoxFolder.uploadFile(BoxFolder.java:551) ~[box-java-sdk-2.32.0.jar:na]
at com.box.sdk.BoxFolder.uploadFile(BoxFolder.java:456) ~[box-java-sdk-2.32.0.jar:na]
at com.box.app.ConsumeBOX2.createFolder(ConsumeBOX2.java:156) ~[classes/:na]
at com.box.app.ConsumeBOX2.uploadFile(ConsumeBOX2.java:252) ~[classes/:na]
at com.box.app.BoxApiApplication.run(BoxApiApplication.java:75) [classes/:na]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784) [spring-boot-2.2.7.RELEASE.jar:2.2.7.RELEASE]
... 5 common frames omitted
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:198) ~[na:1.8.0_251]
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1967) ~[na:1.8.0_251]
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:331) ~[na:1.8.0_251]
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:325) ~[na:1.8.0_251]
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1689) ~[na:1.8.0_251]
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:226) ~[na:1.8.0_251]
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1082) ~[na:1.8.0_251]
at sun.security.ssl.Handshaker.process_record(Handshaker.java:1010) ~[na:1.8.0_251]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1079) ~[na:1.8.0_251]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388) ~[na:1.8.0_251]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416) ~[na:1.8.0_251]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400) ~[na:1.8.0_251]
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) ~[na:1.8.0_251]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[na:1.8.0_251]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1340) ~[na:1.8.0_251]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1315) ~[na:1.8.0_251]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264) ~[na:1.8.0_251]
at com.box.sdk.BoxMultipartRequest.writeBody(BoxMultipartRequest.java:139) ~[box-java-sdk-2.32.0.jar:na]
... 14 common frames omitted
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:450) ~[na:1.8.0_251]
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:317) ~[na:1.8.0_251]
at sun.security.validator.Validator.validate(Validator.java:262) ~[na:1.8.0_251]
at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:330) ~[na:1.8.0_251]
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:227) ~[na:1.8.0_251]
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[na:1.8.0_251]
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1671) ~[na:1.8.0_251]
... 27 common frames omitted
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[na:1.8.0_251]
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[na:1.8.0_251]
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) ~[na:1.8.0_251]
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:445) ~[na:1.8.0_251]
-
Hi ,
This is most likely due to a firewall issue blocking the request to Box. Most of our API requests are sent to api.box.com, with the exception of the upload endpoints, which send to upload.box.com. Can you please ensure that upload.box.com is not being blocked by your firewall / proxy?
- Jon
サインインしてコメントを残してください。
コメント
1件のコメント