kandi background
Explore Kits

spring-boot-cities | Spring Boot Spring Data | Microservice library

 by   cf-platform-eng Java Version: Current License: No License

 by   cf-platform-eng Java Version: Current License: No License

Download this library from

kandi X-RAY | spring-boot-cities Summary

spring-boot-cities is a Java library typically used in Architecture, Microservice, Spring Boot, Spring, Docker applications. spring-boot-cities has no vulnerabilities, it has build file available and it has low support. However spring-boot-cities has 2 bugs. You can download it from GitHub.
This repository contains a sample project to demonstrate building and deploying a simple Spring Boot based microservice and a web app to consume the microservice. It was built in part to be used as part of a presentation on Spring Cloud Connectors.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • spring-boot-cities has a low active ecosystem.
  • It has 123 star(s) with 143 fork(s). There are 29 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 2 open issues and 0 have been closed. On average issues are closed in 1455 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of spring-boot-cities is current.
spring-boot-cities Support
Best in #Microservice
Average in #Microservice
spring-boot-cities Support
Best in #Microservice
Average in #Microservice

quality kandi Quality

  • spring-boot-cities has 2 bugs (0 blocker, 0 critical, 1 major, 1 minor) and 9 code smells.
spring-boot-cities Quality
Best in #Microservice
Average in #Microservice
spring-boot-cities Quality
Best in #Microservice
Average in #Microservice

securitySecurity

  • spring-boot-cities has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • spring-boot-cities code analysis shows 0 unresolved vulnerabilities.
  • There are 1 security hotspots that need review.
spring-boot-cities Security
Best in #Microservice
Average in #Microservice
spring-boot-cities Security
Best in #Microservice
Average in #Microservice

license License

  • spring-boot-cities does not have a standard license declared.
  • Check the repository for any license declaration and review the terms closely.
  • Without a license, all rights are reserved, and you cannot use the library in your applications.
spring-boot-cities License
Best in #Microservice
Average in #Microservice
spring-boot-cities License
Best in #Microservice
Average in #Microservice

buildReuse

  • spring-boot-cities releases are not available. You will need to build from source code and install.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • spring-boot-cities saves you 332 person hours of effort in developing the same functionality from scratch.
  • It has 791 lines of code, 58 functions and 29 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
spring-boot-cities Reuse
Best in #Microservice
Average in #Microservice
spring-boot-cities Reuse
Best in #Microservice
Average in #Microservice
Top functions reviewed by kandi - BETA

Coming Soon for all Libraries!

Currently covering the most popular Java, JavaScript and Python libraries. See a SAMPLE HERE.
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.

spring-boot-cities Key Features

A Spring Boot + Spring Data + Spring Cloud Connectors demo app

Community Discussions

Trending Discussions on spring-boot-cities
  • No unique service maching interface error in Spring Boot Cloud Foundry error
Trending Discussions on spring-boot-cities

QUESTION

No unique service maching interface error in Spring Boot Cloud Foundry error

Asked 2017-Jun-08 at 15:49

I am trying to follow this tutorial https://github.com/cf-platform-eng/spring-boot-cities/tree/master/cities-service to run my spring boot application in Cloud Foundry. I have local bosh-lite installation

My Spring Boot application connects to postgresql as database. I am trying to connect to the Postgresql instance running on my local (host machine )

My application works fine locally if deployed to a local tomcat. But when i deploy the app to bosh-lite it fails with the following error "No unique service maching interface error ". My code is excatly the same as what is mentioned in the tutorial except i am using Maven to build my code.

    2017-06-07T22:29:54.44+0530 [App/0] OUT Caused by: org.springframework.cloud.CloudException: No unique service matching interface javax.sql.DataSource found. Expected 1, found 0
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.springframework.cloud.Cloud.getSingletonServiceConnector(Cloud.java:149) ~[spring-cloud-core-1.2.3.RELEASE.jar!/:na]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.saurav.cf.casestudy.employee.db.DataSourceConfiguration.dataSource(DataSourceConfiguration.java:20) ~[classes/:na]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.saurav.cf.casestudy.employee.db.DataSourceConfiguration$$EnhancerBySpringCGLIB$$847aab5e.CGLIB$dataSource$0(<generated>) ~[classes/:na]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.saurav.cf.casestudy.employee.db.DataSourceConfiguration$$EnhancerBySpringCGLIB$$847aab5e$$FastClassBySpringCGLIB$$2ad81e2b.invoke(<generated>) ~[classes/:na]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at org.saurav.cf.casestudy.employee.db.DataSourceConfiguration$$EnhancerBySpringCGLIB$$847aab5e.dataSource(<generated>) ~[classes/:na]
2017-06-07T22:29:54.44+0530 [App/0] OUT     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]

My connection to postgres works fine. And the same app works fine if i don't use spring cloud connector and read the value normally from application.properties.

My pom.xml`(Has dependencies for spring boot cloud connector and postgrsql driver )

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.saurav.cf.casestudy</groupId>
    <artifactId>employeerest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>employeerest</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <!--  <start-class>org.saurav.cf.casestudy.employee.EmployeerestApplication</start-class> -->
    </properties>



    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-hateoas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-cloud-connectors</artifactId>

</dependency>



        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>


<dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
      </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>

`

[UPDATE] as per Scott's answers below i had a look at the requirements for a UPS to be picked up cloud connector.Since mine is an user provided provided service so i cannot have tags and label. But i added the jdbc urls. Now my app is failing with the below error

 Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set

For this i have set "spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect" in my application.properties but still it does not work

I have also checked that my DB is running and db settings in my service instance is correct.

Below is my service instance content`

"VCAP_SERVICES": {
  "user-provided": [
   {
    "credentials": {
     "jdbcUrl": "jdbc:postgresql://10.0.2.2:5432/employee",
     "username": "postgres",
     "password": "admin",
     "postgresUri": "postgresql://10.0.2.2:5432/employee",
     "uri": "postgresql://10.0.2.2:5432/employee"
    },
    "label": "user-provided",
    "name": "postgresql-cf-service",
    "syslog_drain_url": "",
    "tags": [],
    "volume_mounts": []
   }
  ]
 }

` Best Regards, Saurav

ANSWER

Answered 2017-Jun-07 at 18:50

If you include spring-boot-starter-cloud-connectors as a dependency, then Spring Cloud Connectors will attempt to create the java.sql.DataSource bean necessary to connect to the database. Connectors does this by looking for a service binding that has certain characteristics. The No unique service matching interface javax.sql.DataSource found message means that Connectors couldn't find a service binding of the appropriate type.

If you want to use Connectors as in that sample app then you will need to create a user-provided service instance with the details of the Postgres connection and bind that service instance to the app.

Alternatively, you could remove the spring-boot-starter-cloud-connectors dependency and instead configure the database connection using spring.datasource properties in application.yml.

These options are explained in more detail in a blog post.

Source https://stackoverflow.com/questions/44418856

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install spring-boot-cities

You can download it from GitHub.
You can use spring-boot-cities like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the spring-boot-cities component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Consider Popular Microservice Libraries
Compare Microservice Libraries with Highest Support
Compare Microservice Libraries with Highest Security
Compare Microservice Libraries with Permissive License
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.