com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lcom/aliyun/oss/OSS; at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) at com.google.common.cache.LocalCache.get(LocalCache.java:4053) at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057) at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986) at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4992) at com.google.inject.internal.FailableCache.get(FailableCache.java:48) at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50) at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:136) at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:547) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:884) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214) at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051) at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:405) at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:82) at play.api.inject.RoutesProvider$$anonfun$2.apply(BuiltinModule.scala:82) at scala.Option.fold(Option.scala:158) at play.api.inject.RoutesProvider.get$lzycompute(BuiltinModule.scala:82) at play.api.inject.RoutesProvider.get(BuiltinModule.scala:78) at play.api.inject.RoutesProvider.get(BuiltinModule.scala:77) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72) at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61) at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62) at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:104) at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85) at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267) at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56) at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205) at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092) at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199) at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:84) at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:181) at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:123) at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21) at play.core.server.ProdServerStart$.start(ProdServerStart.scala:47) at play.core.server.ProdServerStart$.main(ProdServerStart.scala:22) at play.core.server.ProdServerStart.main(ProdServerStart.scala) Caused by: java.lang.NoClassDefFoundError: Lcom/aliyun/oss/OSS; at java.lang.Class.getDeclaredFields0(Native Method) at java.lang.Class.privateGetDeclaredFields(Class.java:2583) at java.lang.Class.getDeclaredFields(Class.java:1916) at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:675) at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380) at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:164) at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:613) at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:569) at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:555) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:884) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214) at com.google.inject.internal.InjectorImpl.createParameterInjector(InjectorImpl.java:962) at com.google.inject.internal.InjectorImpl.getParametersInjectors(InjectorImpl.java:950) at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:70) at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33) at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208) ... 58 more Caused by: java.lang.ClassNotFoundException: com.aliyun.oss.OSS at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 82 more
如果包没有读的权限好像也是会出现这个问题。因为服务器上其他的lib下的jar文件都是有权限的。OSS包是后来单独放上去的没有权限,就报这个错误了。我删除了lib文件夹,然后重新上传lib,执行 chmod -R 755 lib 之后就没报这个错了。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。