0

我正在尝试使用 JOSS 连接到对象存储。

这是我的连接代码:

    AccountConfig config = new AccountConfig();

    config.setUsername(USERNAME);
    config.setPassword(PASSWORD);

    config.setAuthUrl(AUTHURL);
    config.setTenantName(TenantName);

    Account account = new AccountFactory(config).createAccount();

但是我得到了如下所示的异常。

请帮我解决这个问题。谷歌了很多,但无法找到解决方案。任何帮助表示赞赏。谢谢。

注意:通过提供相同的凭据 AuthUrl,我能够从 cloudberry 等客户端连接到开放堆栈对象存储。

java.lang.NoSuchFieldError: UNWRAP_ROOT_VALUE at org.javaswift.joss.command.impl.core.AbstractCommand.createObjectMapper(AbstractCommand.java:137) at org.javaswift.joss.command.impl.identity.KeystoneAuthenticationCommandImpl.setAuthenticationHeader(KeystoneAuthenticationCommandImpl.java :46) at org.javaswift.joss.command.impl.identity.KeystoneAuthenticationCommandImpl.(KeystoneAuthenticationCommandImpl.java:29) at org.javaswift.joss.command.impl.factory.AuthenticationCommandFactoryImpl.createAuthenticationCommand(AuthenticationCommandFactoryImpl.java:27) at org .javaswift.joss.client.impl.ClientImpl.createAccount(ClientImpl.java:84) 在 org.javaswift.joss.client.impl.ClientImpl.createAccount(ClientImpl.java:27) 在 org.javaswift.joss.client.core .AbstractClient.authenticate(AbstractClient.java:35) 在 org.javaswift.joss.client.factory.AccountFactory.createAccount(AccountFactory.java:30) 在 com.intel.vpg.avl.controller.AvlController.reports(AvlController.java:172) 在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method ) 在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.lang.reflect.Method.invoke(Method.java:606) 在 org .springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) at org.springframework.web.servlet.mvc .method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:617)的org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:第578章.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) 在 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) 在 org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) ) 在 javax.servlet.http.HttpServlet。service(HttpServlet.java:624) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 在 org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 在 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java :241) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) 在 org.springframework.security 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)。 web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) 在 org.springframework。security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.access。 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java: 103) 在 org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) 在 org.springframework.security 的 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) .web。FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy. java:342) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework .security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) 在 org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework.security.web。authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter( LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org .springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) 在 org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) 在 org.springframework.security.web.FilterChainProxy。doFilter(FilterChainProxy.java:160) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache .catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) 在 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 在 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java :220) 在 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) 在 org.apache.catalina.core 的 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)。 StandardHostValve.invoke(StandardHostValve.java:170) 在 org.apache.catalina.valves。ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) 在 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) 在 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol .java:620) 在 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 在 java.util。 concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 在 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable。在 java.lang.Thread.run(Thread.java:745) 处运行(TaskThread.java:61)

4

2 回答 2

0

试试这个代码(对我有用):

AccountConfig config = new AccountConfig();
config.setUsername(username);
config.setPassword(password);
config.setAuthUrl(URL);
config.setAuthenticationMethod(AuthenticationMethod.BASIC);
Account account = new AccountFactory(config).createAccount();
Container container = account.getContainer("container-name");
于 2015-08-27T08:14:25.717 回答
0

这个错误可能是maven依赖冲突,检查你的maven依赖org.codehaus.jackson,然后设置统一版本。我用这个方法解决了这个错误,希望对你有帮助。

于 2016-04-28T06:13:53.843 回答