Giter Club home page Giter Club logo

hello-spring-cloud's Introduction

Hello Spring Cloud Connectors

A Spring Boot application that uses Spring Cloud Connectors to connect to cloud services and get information about cloud environment.

Building the application

Use Maven to build the application:

$ mvn clean package

Running the application on Cloud Foundry

To run the application on Cloud Foundry, first target and long into a Cloud Foundry environment, then run this command:

$ cf push

The application will be deployed using settings in the provided manifest.yml file. The output from the command will show the URL that has been assigned to the application. Browse to the provided URL to view information about the application.

Creating and binding services

Using the provided manifest, the application will not be bound to any data services. The application UI will show default connections provided by Spring Boot. You can create relational database, Redis, MongoDB, and AMQP services and bind them to the application to test creation of service connections with Spring Cloud Connectors.

On Pivotal Web Services you can create and bind each type of service using these commands:

$ cf create-service cleardb spark mysql-service
$ cf bind-service hello-spring-cloud mysql-service

$ cf create-service rediscloud 30mb redis-service
$ cf bind-service hello-spring-cloud redis-service

$ cf create-service mlab sandbox mongodb-service
$ cf bind-service hello-spring-cloud mongodb-service

$ cf create-service cloudamqp spark amqp-service
$ cf bind-service hello-spring-cloud amqp-service

$ cf restart

On Pivotal Cloud Foundry you can create and bind each type of service using these commands:

$ cf create-service p-mysql 100mb mysql-service
$ cf bind-service hello-spring-cloud mysql-service

$ cf create-service p-redis shared-vm redis-service
$ cf bind-service hello-spring-cloud redis-service

$ cf create-service p-rabbitmq standard amqp-service
$ cf bind-service hello-spring-cloud amqp-service

$ cf restart

Consult the Pivotal Cloud Foundry documentation for more details.

hello-spring-cloud's People

Contributors

cdelashmutt-pivotal avatar ramnivas avatar scottfrederick avatar tsuyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello-spring-cloud's Issues

Add

I tried this sample but mvn package produced the following error:

[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:1.2.0.BUILD-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:1.2.0.BUILD-SNAPSHOT: Could not find artifact org.springframework.integration:spring-integration-bom:pom:4.1.0.M1 in spring-snapshots (http://repo.spring.io/snapshot) -> [Help 1]

Adding org.springframework.maven.milestone as a pluginRepository seemed to take care of the issue.

app won't connect to DB

mvn package
cf push

Results in:
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon May 01 14:35:55 UTC 2017
There was an unexpected error (type=Internal Server Error, status=500).
Failed to authenticate to database [CloudFoundry_8qq9og8g_53o2fv6c], username = [CloudFoundry_8qq9og8g_53o2fv6c_406ioqtj], password = [E******************************A]

hello-spring-cloud example issue : BeanCreationException

I am trying to execute this code at : https://github.com/cloudfoundry-samples/hello-spring-cloud

I am on Windows environment, using Maven & Eclipse.

After updating the maven repo, all issues are resolved, but when I am running the program as Spring Boot App, I am getting the below error.

Could you please help me with the issue?

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.cloud.app.ApplicationInstanceInfo helloworld.HomeController.instanceInfo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.cloud.app.ApplicationInstanceInfo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:961)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:950)
	at helloworld.Application.main(Application.java:13)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.springframework.cloud.app.ApplicationInstanceInfo helloworld.HomeController.instanceInfo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.cloud.app.ApplicationInstanceInfo] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:558)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
	... 16 more
``

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.