Giter Site home page Giter Site logo

bootiful-microservices's Issues

hateoas exception in reservation client

Hi,
i am running your code and looks like the reservation client is not working:

Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not deserialize instance of org.springframework.hateoas.Resources out of START_ARRAY token
 at [Source: com.sun.jersey.client.apache4.ApacheHttpClient4Handler$HttpClientResponseInputStream@5552c32d; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of org.springframework.hateoas.Resources out of START_ARRAY token
 at [Source: com.sun.jersey.client.apache4.ApacheHttpClient4Handler$HttpClientResponseInputStream@5552c32d; line: 1, column: 1]
@RestController
@RequestMapping("/registrations")
class RegistrationApiGatewayRestController {

    @Autowired
    @LoadBalanced
    private RestTemplate restTemplate;

    @RequestMapping("/names")
    public Collection<String> getRegistrationNames() {
        ParameterizedTypeReference<Resources<Registration>> ptr =
                new ParameterizedTypeReference<Resources<Registration>>() {};
        // This is doing client side load balancing using ribbon (it is not DNS, but service name)
        ResponseEntity<Resources<Registration>> $ = this.restTemplate.exchange("http://registration-service/registrations", HttpMethod.GET, null, ptr);
        return $.getBody().getContent().stream().map(Registration::getName).collect(Collectors.toList());
    }
}
<?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>com.example</groupId>
    <artifactId>api-gatway-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>api-gatway-service</name>
    <description>Demo project for Spring Boot</description>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-discovery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zuul</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-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-parent</artifactId>
                <version>Brixton.M4</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>

cf push error: discovery service (dalston release train)

Hello
After a successful "mvn clean install", in bootiful-microservices-dalston
and "cf push eureka -p ./target/eureka-service-0.0.1-SNAPSHOT.jar"
I got the error.
I have been trying to resolve this error, but so far nothing helps.
It seems to be a pretty simple, straight forward example with Brixton.
Any idea is appreciated.
Cheers
Beth

javax.xml.stream.FactoryConfigurationError: Provider for class javax.xml.stream.XMLInputFactory cannot be created
Caused by: java.lang.RuntimeException: Provider for class javax.xml.stream.XMLInputFactory cannot be created
Caused by: java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Error reading configuration file
Caused by: java.util.zip.ZipException: invalid stored block lengths

bootiful-microservices-camden version ran into authentication issue

Hi I'm a newbie of SpringCloud thing. The bootiful-microservice-brixton project ran well for me, however bootiful-microservices-camden ran into authentication issue, kept asking about the user / password or getting response via curl

curl 'http://localhost:9999/reservations/names'
{
  "timestamp":1481177384200,
  "status":401,
  "error":"Unauthorized",
  "message":"Full authentication is required to access this resource",
  "path":"/reservations/names"
}

wrong parent version in passport-service pom.xml

Great Code! I cloned it to try it out and mentioned that it could not compile: The pom.xml of passport-service refers to parent pom bootiful.microservices-parent in version 1.0.0-SNAPSHOT but it should be 1.0.0.BUILD-SNAPSHOT. Just a small typo...

configuration-server uri

Thank you for the webinar. I new to Spring Cloud and Spring Boot and this webinar brought a lot of concepts together but I am having trouble running your code. You talked about a bunch of yaml files with in your home directory and kept coming back to them but it did not really register with me until I tried starting the configuration-server and got an error. I can change the URI in the application.yml but you had other Yaml files such as *-service.yml I can not find. Am I missing something?

Thanks.

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.