spring-cloud / spring-cloud-stream-samples

Samples for Spring Cloud Stream
Apache License 2.0
956 stars 676 forks source link

kinesis-produce-consume doesn't run out of the box #214

Closed deigote closed 2 years ago

deigote commented 3 years ago

I get the following when trying to run the jar produced from ./mvnw install:

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
deigote commented 2 years ago

I fixed that with adding

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

to the dependencies section of the pom.xml and

  datasource:
    url: jdbc:h2:mem:testdb
    driverClassName: org.h2.Driver
    username: sa
    password: password
  jpa:
    database-platform: org.hibernate.dialect.H2Dialect

to the spring section of the application.yml.

Sadly that's not enough and now I get:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.amazonaws.services.cloudformation.AmazonCloudFormationClient.<init>(AmazonCloudFormationClient.java:285)

The following method did not exist:

    com/amazonaws/client/AwsSyncClientParams.getAdvancedConfig()Lcom/amazonaws/client/builder/AdvancedConfig;

The method's class, com.amazonaws.client.AwsSyncClientParams, is available from the following locations:

    jar:file:/Users/dtoharia/Projects/other/spring-cloud-stream-samples/kinesis-samples/kinesis-produce-consume/target/kinesis-produce-consume-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/aws-java-sdk-core-1.11.312.jar!/com/amazonaws/client/AwsSyncClientParams.class

The class hierarchy was loaded from the following locations:

    com.amazonaws.client.AwsSyncClientParams: jar:file:/Users/dtoharia/Projects/other/spring-cloud-stream-samples/kinesis-samples/kinesis-produce-consume/target/kinesis-produce-consume-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/aws-java-sdk-core-1.11.312.jar!/

Action:

Correct the classpath of your application so that it contains a single, compatible version of com.amazonaws.client.AwsSyncClientParams

I'm not sure I can fix that, came back relatively recently to the Maven "fun" after years on other things.

deigote commented 2 years ago

Ok, that was solved by bumping the dependency org.springframework.cloud.spring-cloud-stream-binder-kinesis to 2.2.0... let's see if I can submit a PR.