当我将twitter hbc依赖项添加到我的pom.xml时,我收到了一个错误.我按照这里的说明进行操作.我不明白,如果它是一个依赖性问题我应该在网上找到一个修复,但如果我注释掉那个依赖,我的服务器正在启动..
这是我添加到我的pom.xml中的内容:
<dependency>
<groupId>com.twitter</groupId>
<artifactId>hbc-core</artifactId> <!-- or hbc-twitter4j -->
<version>2.2.0</version> <!-- or whatever the latest version is -->
</dependency>
Run Code Online (Sandbox Code Playgroud)
这是错误:
2015-06-20T18:13:52.877+0200|Severe: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Set<Service> with qualifiers @Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)
at com.google.common.util.concurrent.ServiceManager.<init>(ServiceManager.java:0)
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Set<Service> with qualifiers @Default
at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)
at com.google.common.util.concurrent.ServiceManager.<init>(ServiceManager.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:370)
at …Run Code Online (Sandbox Code Playgroud) 使用 Eclipse Luna 我试图运行一个导入已弃用的 google-collections 的 java 代码,该代码在使用最新的 Guava 版本编译时抛出异常。
public static void run(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException
{
BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);
StatusesFilterEndpoint endpoint = new StatusesFilterEndpoint();
endpoint.trackTerms(Lists.newArrayList("twitterapi", "#AAPSweep"));
Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
Client client = new ClientBuilder()
.hosts(Constants.STREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
.processor(new StringDelimitedProcessor(queue))
.build();
client.connect();
Run Code Online (Sandbox Code Playgroud)
我尝试从插件中删除 com.google.guava_15.0.0.v201403281430 文件,并尝试粘贴 Guava 旧版本,如评论中所述所述,但我无法安装(指向)旧的 guava 版本。另外,这里可能还有另一种解决此问题的解决方案,但我是 java 新手,不知道如何用其他列表替换该列表。
请问有没有人可以使用其他 List 方法运行该代码?或者告诉我如何在 eclipse 中添加旧版本的 Guava(我不确定是否可以解决该问题,只需从线程中读取它)或者告诉我其他解决方案。谢谢