Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven中两个依赖项的不兼容性_Java_Maven_Amazon Web Services_Cloud Foundry - Fatal编程技术网

Java Maven中两个依赖项的不兼容性

Java Maven中两个依赖项的不兼容性,java,maven,amazon-web-services,cloud-foundry,Java,Maven,Amazon Web Services,Cloud Foundry,在我的程序中,我尝试连接到两台服务器。在不同的项目中,这两种连接都能完美地工作。然而,当它们在同一个maven projet中时,我在连接过程中遇到了一个异常 在我的例子中,当我在pom中添加这个依赖项时 <dependency> <groupId>com.amazonaws</groupId> <artifactId>aws-java-sdk</artifactId> <version>1.9.35

在我的程序中,我尝试连接到两台服务器。在不同的项目中,这两种连接都能完美地工作。然而,当它们在同一个maven projet中时,我在连接过程中遇到了一个异常

在我的例子中,当我在pom中添加这个依赖项时

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk</artifactId>
    <version>1.9.35</version>
</dependency>
然而,当我删除这个依赖项时,我对连接到CloudFoudary没有任何问题。但是,我使用的aws类有一个错误


我的问题是。如何添加这两个依赖项而不出现此异常

我希望这个讨论会对您有所帮助(Spring和CloudFoundry之间的Jackson版本兼容性):@Berger非常感谢。它有效;)我希望这个讨论会对您有所帮助(Spring和CloudFoundry之间的Jackson版本兼容性):@Berger非常感谢。它有效;)
Exception in thread "main" org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not construct instance of org.springframework.security.oauth2.common.OAuth2AccessToken, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
 at [Source: org.apache.http.conn.EofSensorInputStream@3eb77ea8; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of org.springframework.security.oauth2.common.OAuth2AccessToken, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
 at [Source: org.apache.http.conn.EofSensorInputStream@3eb77ea8; line: 1, column: 1]
    at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.readInternal(MappingJackson2HttpMessageConverter.java:126)
    at org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:153)
    at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:81)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:454)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:417)
    at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:102)
    at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47)
    at org.cloudfoundry.client.lib.oauth2.OauthClient.getToken(OauthClient.java:66)
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.login(CloudControllerClientImpl.java:626)
    at org.cloudfoundry.client.lib.CloudFoundryClient.login(CloudFoundryClient.java:149)
    at telecom.sudparis.eu.paas.core.server.ressources.manager.application.TestErrors.main(TestErrors.java:27)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of org.springframework.security.oauth2.common.OAuth2AccessToken, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
 at [Source: org.apache.http.conn.EofSensorInputStream@3eb77ea8; line: 1, column: 1]
    at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
    at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:716)
    at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:140)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2993)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2158)
    at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.readInternal(MappingJackson2HttpMessageConverter.java:123)
    ... 10 more