部署我的战争的Karaf 3.0.2中的ExceptionInInitializerError

时间:2015-01-09 19:57:56

标签: war karaf

美好的一天,

我试图在Karaf 3.0.2中部署我的war文件,我的servlet正在尝试读取一些S3文件,但我在实例化AmazonS3Client时遇到此错误

    AmazonS3Client s3Client = new AmazonS3Client();

2015-01-09 13:04:02,205 | INFO  | pool-7-thread-1  | S3Properties                     | 75 - my-domain - 3.0.1.SNAPSHOT | Loading file from S3: my-web.properties
2015-01-09 13:04:02,241 | WARN  | pool-7-thread-1  | AbstractLifeCycle                | 91 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | FAILED MyPerfFilter: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
    at com.amazonaws.util.VersionInfoUtils.userAgent(VersionInfoUtils.java:139)
    at com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:134)
    at com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:95)
    at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:42)
    at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:379)

我认为这是我的静态块上的一个问题,但我认为它不是,因为我试图创建一个simplehelloworld servlet,它调用具有此静态块的同一个类,并且它可以读取S3文件

static {
    System.out.println("test 1");
    instance = new MyProperties();
    try {
        System.out.println("test 2");
        instance.load(PROPS_FILENAME);
        reloadable = true;
        System.out.println("test 3");
    } catch (Exception e) {
        try {
            System.out.println("test 3");
            // try to load the file from the classpath instead
            instance.load(MyProperties.class.getResourceAsStream("/" + PROPS_FILENAME));
        } catch (Exception e1) {
            logger.error("Exception caught when loading properties: {}", PROPS_FILENAME, e);
        }
    }
}

任何建议或想法都将不胜感激

由于

0 个答案:

没有答案