我需要帮助才能运行给定的项目。该项目是:http ://code.google.com/p/opennetinf/
我按照文档中的说明让项目在 Eclipse 中运行。现在我想从终端运行这个项目。在项目启动一段时间后,终端上出现了一个很大的异常。log4j 输出的第一行类似于 eclipse 控制台中的输出。例外是:
Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:
1) Error in custom provider, java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at netinf.node.cache.peerside.PeersideCacheModule.provideNetworkCaches(PeersideCacheModule.java:64)
while locating java.util.List<netinf.node.cache.peerside.PeersideCache>
for parameter 0 at netinf.node.cache.CachingInterceptor.setPeersideCaches(CachingInterceptor.java:81)
while locating netinf.node.cache.CachingInterceptor
at netinf.node.module.StandardNodeModule.provideResolutionInterceptors(StandardNodeModule.java:125)
while locating netinf.node.resolution.ResolutionInterceptor[]
for parameter 0 at netinf.node.resolution.impl.ResolutionControllerImpl.initReslolutionInterceptors(ResolutionControllerImpl.java:442)
while locating netinf.node.resolution.impl.ResolutionControllerImpl
while locating netinf.node.resolution.ResolutionController
for parameter 0 at netinf.node.api.impl.NetInfNodeImpl.setResolutionController(NetInfNodeImpl.java:95)
while locating netinf.node.api.impl.NetInfNodeImpl
while locating netinf.node.api.NetInfNode
1 error
at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:767)
at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:793)
at netinf.node.StarterNode.start(StarterNode.java:126)
at netinf.node.StarterNode.main(StarterNode.java:75)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:106)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89)
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:95)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66)
at com.google.inject.SingleMethodInjector.inject(SingleMethodInjector.java:84)
at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99)
at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
at com.google.inject.Scopes$1$1.get(Scopes.java:54)
at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
... 3 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:101)
... 48 more
Caused by: java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
at org.slf4j.impl.JDK14LoggerAdapter.warn(JDK14LoggerAdapter.java:450)
at org.eclipse.jetty.util.log.Slf4jLog.warn(Slf4jLog.java:40)
at org.eclipse.jetty.util.log.Log.warn(Log.java:237)
at org.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:198)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at netinf.node.cache.peerside.PeersideAccessServer.start(PeersideAccessServer.java:64)
at netinf.node.cache.peerside.PeersideCache.<init>(PeersideCache.java:79)
at netinf.node.cache.peerside.PeersideCacheModule.provideNetworkCaches(PeersideCacheModule.java:77)
... 53 more
那么我做了什么:我通过 Eclipse 导出对话框(导出 -> 可运行 Jar)导出了项目。库处理无关紧要。对于这三种方法中的每一种,我都会得到相同的异常。
所以我的问题是:这个异常告诉我什么?我该如何解决这个问题?