24

I have a spring-xd processor module which has a dependecy to a project using spring-data-jpa:

pom.xml of the xd-processor module:

<dependencies>
    <dependency>
        <groupId>org.test.common</groupId>
        <artifactId>org.test.common</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
</dependencies>

pom.xml of org.test.common:

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

If I run the integration test everything works fine. But the deployment to xd-singlenode (1.2.0.RELEASE) fails with the following error:

2015-06-21T20:50:35+0200 1.2.0.RELEASE ERROR    DeploymentsPathChildrenCache-0 boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.jpaVendorAdapter
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:58) ~[spring-boot-autoconfigure-1.2.3.RELEASE.jar:1.2.3.RELEASE]
...
Caused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
...

You can checkout the full sample on github.

What am I doing wrong? Any help would be appreciated.

Vizllx
  • 9,135
  • 1
  • 41
  • 79
Domi
  • 1,451
  • 2
  • 13
  • 25
  • And if you try to upgrade to version 1.2.5 of `spring-boot-starter-data-jpa`. It appears to me as a bug in Spring - as you can see on line 87 at `https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java` the method is really annotated without parameters. – defectus Jul 15 '15 at 06:05
  • @defectus so why does the integration-test work then? – Domi Jul 15 '15 at 06:37
  • Check [API](http://docs.spring.io/autorepo/docs/spring-boot/1.1.6.RELEASE/api/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBean.html) maybe because you already have a bean with same name? `Conditional that only matches when the specified bean classes and/or names are not already contained in the BeanFactory.` – Jordi Castilla Jul 15 '15 at 14:09
  • @JordiCastilla Have you checked my sample on github? If I run the int test everything works. – Domi Jul 15 '15 at 18:58

1 Answers1

1

try below solution

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.2.6.RELEASE</version>

click here to know more

  • doesn't work for me. you can take the sample from github and change it there. I get the same error. but I will migrate to [spring cloud data flow](http://cloud.spring.io/spring-cloud-dataflow/) anyway. – Domi Oct 15 '15 at 18:57