Announcement Announcement Module
Collapse
No announcement yet.
Beans creating and external libraries Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Beans creating and external libraries

    Hi,

    my Spring application fails trying to initialize bean with @Postconstruct.
    The bean depends on external library (SAX parser).
    Could that be a problem? How it could be managed?
    * Comment for the code below: AmazonS3 uses SAX parser within 'doesBucketExist' method

    Code:


    import com.amazonaws.services.s3.AmazonS3;
    import com.amazonaws.services.s3.AmazonS3Client;

    public class MyClass {
    ....
    @Postconstruct
    public void init (String s3key, String s3secret, String s3bucket, String s3region) {

    AWSCredentials credentials = new BasicAWSCredentials(String s3key, String s3secret);
    AmazonS3 s3 = new AmazonS3Client(credentials);
    if (!s3.doesBucketExist(s3bucket)) {
    s3.createBucket(s3bucket, s3region);
    }

    }
    ....
    }
Working...
X