Я получаю доступ к Oracle Cloud Storage из Java.Я столкнулся с этой ошибкой:
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.
Это из-за неправильного URL-адреса службы или программы?
Вот мой метод:
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();
}
}
}