javax.management.InstanceAlreadyExistsException:在AmazonS3Client中

时间:2017-05-03 09:32:21

标签: java tomcat amazon-s3

您好我在部署我之前运行的服务tomcat时遇到错误。

javax.management.InstanceAlreadyExistsException: com.amazonaws.management:type=AwsSdkMetrics
    at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
    at com.amazonaws.jmx.MBeans.registerMBean(MBeans.java:52)
    at com.amazonaws.jmx.SdkMBeanRegistrySupport.registerMetricAdminMBean(SdkMBeanRegistrySupport.java:27)
    at com.amazonaws.metrics.AwsSdkMetrics.registerMetricAdminMBean(AwsSdkMetrics.java:330)
    at com.amazonaws.metrics.AwsSdkMetrics.<clinit>(AwsSdkMetrics.java:308)
    at com.amazonaws.services.s3.AmazonS3Client.<clinit>(AmazonS3Client.java:247)
    at com.sokrati.awsClient.S3Client.<init>(S3Client.java:46)
    at com.sokrati.myService.utils.S3Communicator.<init>(S3Communicator.java:21)
    at com.sokrati.myService.utils.S3Communicator.init(S3Communicator.java:42)
    at com.sokrati.myService.servlet.BaseCommunicator.initializeS3Communicator(BaseCommunicator.java:150)
    at com.sokrati.myService.servlet.BaseCommunicator.initializeConfigurations(BaseCommunicator.java:130)
    at com.sokrati.myService.servlet.BaseCommunicator.initCommunicator(BaseCommunicator.java:65)
    at com.sokrati.restCommunicator.RestCommunicator.init(RestCommunicator.java:102)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1026)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4421)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4734)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1385)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1389)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1653)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1662)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1642)
    at java.lang.Thread.run(Thread.java:619)

错误是由于我的S3Client.java中的这一行,从上面的堆栈跟踪可以看出。

    s3Client = new AmazonS3Client(awsCredentials);  

任何帮助都会受到赞赏吗?

0 个答案:

没有答案