本文介绍了无法初始化类com.amazonaws.partitions.PartitionsLoader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Eclipse Mars。我已经通过安装软件从help.Iow添加了aws java sdk 1.11.123。当我运行Tomcat Server 7时,我收到此错误:

Using Eclipse Mars .I have already added aws java sdk 1.11.123 through install software from help.Now when i run Tomcat Server 7 I get this error:

2017年5月2日11:57:32 org.apache.catalina.core.StandardWrapperValve在路径[/ PdsAWS]的上下文中调用
SEVERE:servlet [PdsServlet]的Servlet.service()抛出异常[java.lang.NoClassDefFoundError:无法初始化类com.amazonaws.partitions.PartitionsLoader]与根源
java.lang.NoClassDefFoundError:无法初始化类com.amazonaws.partitions.PartitionsLoader

我也得到了

java.lang.NoSuchFieldError:ALLOW_FINAL_FIELDS_AS_MUTATORS

但是当我检查库时,我可以看到PartitionsLoader.How可以解决这个问题吗?

But when i check library i can see PartitionsLoader.How can this be resolved?

Mo.看似相关的重新错误:

More errors which seem related:

May 03, 2017 9:39:04 AM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.partitions.PartitionsLoader
	at com.amazonaws.regions.RegionMetadataFactory.create(RegionMetadataFactory.java:30)
	at com.amazonaws.regions.RegionUtils.initialize(RegionUtils.java:64)
	at com.amazonaws.regions.RegionUtils.getRegionMetadata(RegionUtils.java:52)
	at com.amazonaws.regions.RegionUtils.getRegion(RegionUtils.java:105)
	at com.amazonaws.services.s3.AmazonS3Client.createSigner(AmazonS3Client.java:3428)
	at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4156)
	at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4116)
	at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1700)
	at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1563)
	at com.tradingtechnologies.pdsawssql.aws.s3.S3HealthCheck.put(S3HealthCheck.java:83)
	at com.tradingtechnologies.pdsawssql.aws.s3.S3HealthCheck.put(S3HealthCheck.java:56)
	at com.tradingtechnologies.pdsawssql.aws.s3.S3HealthCheck.execute(S3HealthCheck.java:116)
	at com.tradingtechnologies.pdsawssql.sql.ext.HealthCheck.execute(HealthCheck.java:54)
	at com.tradingtechnologies.pdsservlet.HealthServlet.doGet(HealthServlet.java:31)
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
	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)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at com.tradingtechnologies.pdsservercommon.filters.HttpHeaderFilter.doFilter(HttpHeaderFilter.java:24)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

推荐答案

这听起来像你在挑选从某个地方拿出旧版的杰克逊。初始化静态成员字段时,PartitionsLoader引用MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS。如果在运行时选择的MapperFeature版本没有此字段,则生成的异常将导致PartitionsLoader的类初始化过程失败。然后,引用该类的后续尝试将抛出您正在看到的异常。

This makes it sound like you're picking up an old version of Jackson from somewhere. PartitionsLoader references MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS while initializing a static member field. If the version of MapperFeature that you pick up at runtime does not have this field, the resulting exception will cause the class initialization process for PartitionsLoader to fail. Subsequent attempts to reference the class will then throw the exception you're seeing.

在2.2版中添加了ALLOW_FINAL_FIELDS_AS_MUTATORS。你拿到哪个版本?

ALLOW_FINAL_FIELDS_AS_MUTATORS was added in version 2.2. Which version are you picking up?

这篇关于无法初始化类com.amazonaws.partitions.PartitionsLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 14:43