2014-10-16 143 views
0

我试图建立Windows Azure中的Java SDK在Windows 7计算机 跟着他们的维基设置页面 https://github.com/Azure/azure-sdk-for-java/wiki/Devbox-Setup的Windows Azure Java SDK的密钥存储路径问题

当我运行测试用例/试图访问Azure的REST Web服务URLS ,低于错误。

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

的Windows Azure SDK的Java密钥库路径问题

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

尝试切换到Java SDK的最新版本。我写了一篇非常基本的指导性文章,帮助您解决JKS问题。看起来你正在使用的命名空间来自早期版本。

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

+0

这种简单的Hello World样的程序为我工作 - 因为你是硬编码JKS文件的路径和密码。但在Azure Java SDK中,它被设置为环境变量,Azure java SDK无法正确读取它。我请求你修复它。非常感谢 :) – 2014-10-21 08:19:29