Windows Azure Java SDK密钥库路径问题

时间:2014-10-16 10:38:00

标签: java azure keystore

我正在尝试在Windows 7计算机中设置 Windows Azure Java SDK 按照他们的Wiki设置页面 https://github.com/Azure/azure-sdk-for-java/wiki/Devbox-Setup

当我运行测试用例/尝试访问Azure REST Web服务URL时,得到以下错误。

set management.keystore.path=E:/Program Files (x86)/Java/jdk1.7.0_51/jre/lib/security/clientcert.jks

Windows Azure Java SDK密钥库路径问题

java.lang.IllegalArgumentException: The keystore path cannot be null or empty.
    at com.microsoft.windowsazure.core.utils.SSLContextFactory.create(SSLContextFactory.java:86)
    at com.microsoft.windowsazure.core.utils.SSLContextFactory.create(SSLContextFactory.java:60)
    at com.microsoft.windowsazure.credentials.CertificateCloudCredentials.applyConfig(CertificateCloudCredentials.java:128)
    at com.microsoft.windowsazure.core.pipeline.apache.Exports$2.create(Exports.java:51)
    at com.microsoft.windowsazure.core.pipeline.apache.Exports$2.create(Exports.java:1)
    at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
    at com.microsoft.windowsazure.core.pipeline.apache.Exports$3.create(Exports.java:65)
    at com.microsoft.windowsazure.core.pipeline.apache.Exports$3.create(Exports.java:1)
    at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
    at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
    at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
    at com.microsoft.windowsazure.Configuration.create(Configuration.java:113)
    at com.microsoft.windowsazure.management.storage.StorageManagementService.create(StorageManagementService.java:47)
    at com.microsoft.windowsazure.management.compute.ComputeManagementIntegrationTestBase.createStorageManagementClient(ComputeManagementIntegrationTestBase.java:63)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsTests.setup(VirtualMachineOperationsTests.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

java.lang.NullPointerException
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsTests.cleanHostedService(VirtualMachineOperationsTests.java:452)
    at com.microsoft.windowsazure.management.compute.VirtualMachineOperationsTests.cleanup(VirtualMachineOperationsTests.java:79)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

1 个答案:

答案 0 :(得分:2)

尝试切换到Java SDK的最新版本。我在这里写了一篇非常基本的操作指南,可以帮助你克服JKS问题。看起来您使用的命名空间来自早期版本。

http://azure.microsoft.com/blog/2014/09/15/getting-started-with-the-azure-java-management-libraries/