我正在开发ASP.NET 4.0 Web应用程序,我想从X509Store读取当前用户证书.读取LocalMachine证书工作正常,但如果我将StoreLocation设置为CurrentUser,它会给我一个空集合.
以下代码工作正常:
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); // StoreLocation.CurrentUser
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
Run Code Online (Sandbox Code Playgroud)
我已经检查了我的个人商店(通过certmgr.mmc),我确信我有证书.
我错过了什么?(store.Certificates为空)
这看起来像GlassFish中的配置问题,我无法解决.更糟糕的是,GlassFish在我的一台笔记本电脑上部署得很好,但在另一台笔记本电脑上却没有.
上下文:我正在开发一个RESTful服务/ API,使用Maven构建它,使用war打包它.我的IDE是带有GlassFish 4.1.0应用服务器的IntellijIDEA 14.
我收到以下异常:
RestAPI:war exploded: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.glassfish.jersey.internal.ServiceConfigurationError: org.glassfish.jersey.server.spi.ComponentProvider: The class org.glassfish.jersey.gf.cdi.CdiComponentProvider implementing the provider interface org.glassfish.jersey.server.spi.ComponentProvider is not found. The provider implementation is ignored.
我的两台机器都安装了所有东西,Java,Java SDK,都在Windows 8.1上运行,等等.
我花了两天时间用Google搜索解决方案,但没有运气.有谁遇到过这个问题?
PS我对Java开发很新,特别是工具和框架,所以如果我以不正确的方式表达自己,我会道歉.