Code Monkey home page Code Monkey logo

spring-boot-cloud-foundry-example's Introduction

Spring Boot Examples

This project depicts the Spring Boot Example.

Description

This Project shows the list of Users which are stored in the In-Memory H2 Database. Using the following endpoints, different operations can be achieved:

  • /helloworld - This returns the greeting string from application.yml
  • /helloworld/name - This returns the value of config config.app.name from application.properties
  • /users - This returns the list of Users in the Users table which is created in H2
  • /users/name/{name} - This returns the details of the Users passed in URL
  • /users/load - Add new users using the Users model. eg. { "name": "Ajay", "teamName": "Development", "salary": 100 }

Libraries used

  • Spring Boot
  • Spring Configuration
  • Spring REST Controller
  • Spring JPA
  • H2

Development Tools

  • Git 2.10.0
  • IntelliJ IDEA 2016.2.4

Compilation Command

  • mvn clean install - Plain maven clean and install

Deployment steps for Cloud Foundry

  • cf push spring-boot -p spring-boot-0.0.1-SNAPSHOT.jar - Deploy the jar into Cloud Foundry.
  • In case you need to change the buildpacks. Use -b https://github.com/cloudfoundry/java-buildpack.git#v3.7

spring-boot-cloud-foundry-example's People

Contributors

kumareshbabuns avatar movingtoweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

spring-boot-cloud-foundry-example's Issues

target

I couldn't get the target folder and yaml file when I clone to my workspace

POST Request - JSON Body...

POST URL: http://localhost:8080/users/load
Content-Type: application/json
Body: [{id=1, name=Ajay, teamName=Development, salary=100}]

Response:
{
"timestamp": 1524376855129,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.http.converter.HttpMessageNotReadableException",
"message": "Could not read document: Can not deserialize instance of com.movingtoweb.model.Users out of START_ARRAY token\n at [Source: java.io.PushbackInputStream@ba08f7b; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.movingtoweb.model.Users out of START_ARRAY token\n at [Source: java.io.PushbackInputStream@ba08f7b; line: 1, column: 1]",
"path": "/users/load"
}

Can you tell me what am I doing wrong?

Thanks,
r2d2c3p0.

mvn install: java.lang.NoClassDefFoundError

Hello,

I am getting below error while starting the application:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/ValidationException

After adding the JAXB dependency to the pom.xml the error goes away/.

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.