Giter Site home page Giter Site logo

Comments (6)

manjunathgudisi avatar manjunathgudisi commented on May 20, 2024

BTW, I have created only aws-s3 instance. No GCP.

from cloud-objectstore-java-sample.

biswaranjanray avatar biswaranjanray commented on May 20, 2024

Hi Manjuath,

From the logs its evident that the objectstore credentials which are required to configure AmazonWebServiceConfiguration.java class are not able to be injected from the VCAP_SERVICE and so its throwing the error: 2020-06-26T15:54:14.99+0530 [APP/PROC/WEB/0] OUT java.lang.NullPointerException: identity

Could you please verify the service-instance name you would have created in aws landscape.
For instance if the service-instance name is "objectstore-service" the same instance name should be used in the manifest.yaml file as well as in the AmazonWebServiceConfiguration.java class at the given line:
@ConfigurationProperties(prefix = "vcap.services.objectstore-service.credentials")

The same information can also be found in readme in step 2 here.

Thanks

from cloud-objectstore-java-sample.

manjunathgudisi avatar manjunathgudisi commented on May 20, 2024

Hi-
Thanks for your reply.
Yes, I have used the same service name.

I have created aws-s3 as instance of objectstore with s3-standard plan.

Screen Shot 2020-06-27 at 1 01 01 PM

Same instance name I have used in AmazonWebServiceConfiguration.java

```public BlobStoreContext getBlobStoreContext() {
	return ContextBuilder.newBuilder("aws-s3").credentials(this.getAccessKeyId(), this.getSecretAccessKey())
			.buildView(BlobStoreContext.class);
}```

and also, in yaml file

applications:
- name: objectstore-sample-svc
  host: i302342-objectstore-sample-svc
  memory: 2G
  buildpack: https://github.com/cloudfoundry/java-buildpack.git
  path: target/objectstore-sample-1.0.0.jar
  services:
    - aws-s3

I think Im doing it correctly.

from cloud-objectstore-java-sample.

biswaranjanray avatar biswaranjanray commented on May 20, 2024

Hi,

As I mentioned in my previous reply the service-instance that you have created as "aws-s3" should match in two places:

  1. manifest.yaml (You did it correctly)
  2. At @ConfigurationProperties(prefix = "vcap.services.aws-s3.credentials") in AmazonWebServiceConfiguration.java class (Have you changed this as well?)

You've placed the instance name in the below code which is not correct.

public BlobStoreContext getBlobStoreContext() {
	return ContextBuilder.newBuilder("aws-s3").credentials(this.getAccessKeyId(), this.getSecretAccessKey())
			.buildView(BlobStoreContext.class);
}


The job of the above code is to configure aws provider with the objectstore credentials which application automatically injects from VCAP_SERVICES. Please don't change the getBlobStoreContext() method.

Thanks

from cloud-objectstore-java-sample.

manjunathgudisi avatar manjunathgudisi commented on May 20, 2024

Yes, thanks for rectifying my mistake. Its working fine now after changing,
from
"vcap.services.objectstore-service.credentials"
to
"vcap.services.aws-s3.credentials"

from cloud-objectstore-java-sample.

biswaranjanray avatar biswaranjanray commented on May 20, 2024

Thanks for your confirmation.

from cloud-objectstore-java-sample.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.