1

我一直在从 Java 访问 Oracle 云存储。我遇到了这个错误:

log4j:WARN No appenders could be found for logger (oracle.cloudstorage.ftm.AbstractFileTransferManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Operation failed. unable to find valid certification path to requested target
Process exited with exit code 0.

该程序停留在manager = FileTransferManager.getDefaultFileTransferManager(auth);

我添加了我的用户名、password.service-url( https://uscom-central-1b.storage.oraclecloud.com/v1/Storage-domain ) 和 identity_domain。

是因为错误的服务网址或程序吗?

这是我的方法:

public static void CareStorage() {

    PropertiesUtil prop = new PropertiesUtil();

    FileTransferAuth auth = new FileTransferAuth(   prop.getCareUserName(), 
        prop.getCarePassword().toCharArray(),
        prop.getCareCloudStorage(), 
        prop.getCareServiceUrl(), 
        prop.getCareDomain());
    _logger.info(   prop.getCareUserName() + 
        prop.getCarePassword().toCharArray() + 
        prop.getCareCloudStorage() + 
        prop.getCareServiceUrl() + 
        prop.getCareDomain());

    FileTransferManager manager = null;
    try {
        manager = FileTransferManager.getDefaultFileTransferManager(auth);

        String containerName = "photos_collection";

        DownloadConfig downloadConfig = new DownloadConfig();

        List<FileObjectTransferConfig> fileObjectTransferConfigs = new ArrayList<FileObjectTransferConfig>();
        for (int i = 1; i <= 300; i++) {
            String filename = "incident_" + i;
            // fileObjectTransferConfigs.add(new FileObjectTransferConfig(new
            // File(testFilesDir + "/" + filename), filename));
            fileObjectTransferConfigs
            .add(new FileObjectTransferConfig(new File(testFilesDir + "/" + filename), filename));

        }
        _logger.info("Downloading files from " + containerName + " ... ");
        MultiFileTransferResult downloadResult = manager.downloadMultipleFiles(downloadConfig, containerName,
            fileObjectTransferConfigs);
        _logger.info("Download completed. " + downloadResult.toString());
    } catch (ClientException ce) {
        System.out.println("Operation failed. " + ce.getMessage());
    } finally {
        if (manager != null) {
            manager.shutdown();
        }
    }

}
4

0 回答 0