Spring Data Example Projects

Overview

Spring Data Examples

Build Status

This repository contains example projects for the different Spring Data modules to showcase the API and how to use the features provided by the modules.

We have separate folders for the samples of individual modules:

Spring Data for Apache Cassandra

  • example - Shows core Spring Data support for Apache Cassandra.
  • java8 - Java 8 specific functionality like the support for JSR-310 types in object mapping.
  • kotlin - Example for using Cassandra with Kotlin.
  • reactive - Example project to show reactive template and repository support.

Spring Data Elasticsearch

  • example - Example how to use basic text search, geo-spatial search and facets.
  • rest - Example how to use the High Level REST Client backing template and repository.
  • reactive - Example how to use reactive client, template and repository features.

Spring Data for Apache Geode

  • events - In this example the test will make use of event handlers and async event queue to handle events.
  • expiration-eviction - In these examples the server is configured to delete entries after a certain idle period or after a Time-To-Live period (expiration0 or remove data from memory when certain thresholds are reached (eviction).
  • function-invocation - In this example the server will have 3 functions registered. The client will invoke each of the functions.
  • queries - In this example a client will query the data in various ways using OQl, continuous queries, and Apache Lucene indexes.
  • security - In this example the servers and clients are set up with security (username/password) authentication using Geode Security and Apache Shiro.
  • storage - In this example the server is configured to store data off of hte JVM heap using the @EnableOffHeap annotation and to compress region data using SnappyCompressor`.
  • transactions - In this example the client will perform operations within a transaction. First, it will do a successful transaction where entries are saved to the server, and then a failed transaction where all changes are reverted.
  • wan - In these example two servers are deployed. One server populates itself with data, and the other server gets populated with that data via WAN replication.

Spring Data JDBC

  • basic - Basic usage of Spring Data JDBC.

Spring Data JPA

  • eclipselink - Sample project to show how to use Spring Data JPA with Spring Boot and Eclipselink.
  • example - Probably the project you want to have a look at first. Contains a variety of sample packages, showcasing the different levels at which you can use Spring Data JPA. Have a look at the simple package for the most basic setup.
  • interceptors - Example of how to enrich the repositories with AOP.
  • java8 - Example of how to use Spring Data JPA auditing with Java 8 date time types as well as the usage of Optional as return type for repository methods. Note, this project requires to be build with JDK 8.
  • jpa21 - Shows support for JPA 2.1 specific features (stored procedures support).
  • multiple-datasources - Examples of how to use Spring Data JPA with multiple DataSources.
  • query-by-example - Example project showing usage of Query by Example with Spring Data JPA.
  • security - Example of how to integrate Spring Data JPA Repositories with Spring Security.
  • showcase - Refactoring show case of how to improve a plain-JPA-based persistence layer by using Spring Data JPA (read: removing close to all of the implementation code). Follow the demo.txt file for detailed instructions.
  • vavr - Shows the support of Vavr collection types as return types for query methods.

Spring Data LDAP

  • example - Sample for Spring Data repositories to access an LDAP store.

Spring Data MongoDB

  • aggregation - Example project to showcase the MongoDB aggregation framework support.
  • example - Example project for general repository functionality (including geo-spatial functionality), Querydsl integration and advanced topics.
  • fluent-api - Example project to show the new fluent API (MongoTemplate-alternative) to interact with MongoDB.
  • geo-json - Example project showing usage of GeoJSON with MongoDB.
  • gridfs - Example project showing usage of gridFS with MongoDB.
  • java8 - Example of how to use Spring Data MongoDB with Java 8 date time types as well as the usage of Optional as return type for repository methods. Note, this project requires to be build with JDK 8.
  • kotlin - Example for using Kotlin with MongoDB.
  • query-by-example - Example project showing usage of Query by Example with MongoDB.
  • querydsl - Example project showing imperative and reactive Querydsl support for MongoDB.
  • reactive - Example project to show reactive template and repository support.
  • repository-metrics - Example project to show how to collect repository method invocation metrics.
  • security - Example project showing usage of Spring Security with MongoDB.
  • text-search - Example project showing usage of MongoDB text search feature.
  • transactions - Example project for imperative and reactive MongoDB 4.0 transaction support.

Spring Data Neo4j

  • example - Example to show basic node and relationship entities and repository usage.

Spring Data R2DBC

  • example - Basic usage of Spring Data R2DBC.

Spring Data Redis

  • cluster - Example for Redis Cluster support.
  • example - Example for basic Spring Data Redis setup.
  • reactive - Example project to show reactive template support.
  • repositories - Example demonstrating Spring Data repository abstraction on top of Redis.
  • sentinel - Example for Redis Sentinel support.
  • streams - Example for Redis Streams support.

Spring Data REST

  • headers - A sample showing the population of HTTP headers and the usage of them to perform conditional GET requests.
  • multi-store - A sample REST web-service based on both Spring Data JPA and Spring Data MongoDB.
  • projections - A sample REST web-service showing how to use projections.
  • security - A sample REST web-service secured using Spring Security.
  • starbucks - A sample REST web-service built with Spring Data REST and MongoDB.
  • uri-customizations - Example project to show URI customization capabilities.

Spring Data for Apache Solr

  • example - Example project for Spring Data repositories for Apache Solr.
  • managed-schema - Example project to show managed schema integration.

Spring Data web support

  • projections - Example for Spring Data web support for JSONPath and XPath expressions on projection interfaces.
  • querydsl - Example for Spring Data Querydsl web integration (creating a Predicate from web requests).
  • web - Example for Spring Data web integration (binding Pageable instances to Spring MVC controller methods, using interfaces to bind Spring MVC request payloads).

Miscellaneous

  • bom - Example project how to use the Spring Data release train bom in non-Spring-Boot scenarios.
  • map - Example project to show how to use Map-backed repositories.
  • multi-store - Example project to use both Spring Data MongoDB and Spring Data JPA in one project.

Note

  • The example projects make use of the Lombok plugin. To get proper code navigation in your IDE, you must install it separately. Lombok is available in the IntelliJ plugins repository and as a download for Eclipse-based IDEs.
Comments
  • SpEL error

    SpEL error

    I encounter this on the SimpleUserRepositoryTests of the SpEL test

    2017-04-29 02:12:37.753  INFO 7124 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@40f08448 testClass = SimpleUserRepositoryTests, testInstance = example.springdata.jpa.simple.SimpleUserRepositoryTests@35ef439e, testMethod = findByFirstnameOrLastnameUsingSpEL@SimpleUserRepositoryTests, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@276438c9 testClass = SimpleUserRepositoryTests, locations = '{}', classes = '{class example.springdata.jpa.simple.SimpleConfiguration}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.SpringBootTestContextCustomizer@754ba872, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6eebc39e, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@1ed4004b], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@ae202c6]; rollback [true]
    2017-04-29 02:12:37.800  INFO 7124 --- [           main] o.s.t.c.transaction.TransactionContext   : Rolled back transaction for test context [DefaultTestContext@40f08448 testClass = SimpleUserRepositoryTests, testInstance = example.springdata.jpa.simple.SimpleUserRepositoryTests@35ef439e, testMethod = findByFirstnameOrLastnameUsingSpEL@SimpleUserRepositoryTests, testException = org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'firstname' cannot be found on null, mergedContextConfiguration = [MergedContextConfiguration@276438c9 testClass = SimpleUserRepositoryTests, locations = '{}', classes = '{class example.springdata.jpa.simple.SimpleConfiguration}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.SpringBootTestContextCustomizer@754ba872, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@6eebc39e, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@1ed4004b], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]]].
    
    org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'firstname' cannot be found on null
    
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:220)
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:94)
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:46)
    	at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:375)
    	at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:88)
    	at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:131)
    	at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:299)
    	at org.springframework.data.jpa.repository.query.SpelExpressionStringQueryParameterBinder.evaluateExpression(SpelExpressionStringQueryParameterBinder.java:131)
    	at org.springframework.data.jpa.repository.query.SpelExpressionStringQueryParameterBinder.potentiallyBindExpressionParameters(SpelExpressionStringQueryParameterBinder.java:89)
    	at org.springframework.data.jpa.repository.query.SpelExpressionStringQueryParameterBinder.bind(SpelExpressionStringQueryParameterBinder.java:69)
    	at org.springframework.data.jpa.repository.query.ParameterBinder.bindAndPrepare(ParameterBinder.java:161)
    	at org.springframework.data.jpa.repository.query.ParameterBinder.bindAndPrepare(ParameterBinder.java:152)
    	at org.springframework.data.jpa.repository.query.AbstractStringBasedJpaQuery.doCreateQuery(AbstractStringBasedJpaQuery.java:81)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:190)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:121)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:85)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:116)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:106)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:483)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    	at com.sun.proxy.$Proxy75.findByFirstnameOrLastname(Unknown Source)
    	at example.springdata.jpa.simple.SimpleUserRepositoryTests.findByFirstnameOrLastnameUsingSpEL(SimpleUserRepositoryTests.java:207)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
    

    I don't know why ,but I encountered this, I didn't change anything of the master . I got idea prompt that" identifier expected" blow the SpEL ,so I guess maybe the SpEL is wrong?

    opened by ghost 11
  • Don't use entities as value objects

    Don't use entities as value objects

    @Entity (identified by unique field) and @Data (value object) annotations on the same class? Entity is the opposite of value object, at least according to my experience and DDD. Doesn't this example encourage bad practice?

    See https://github.com/spring-projects/spring-data-examples/blob/bee8a81118e1cf3fec3ef5ac91c4e9d3677b6a74/jpa/eclipselink/src/main/java/example/springdata/jpa/eclipselink/Customer.java and other classes. If a female customer is put to HashSet, then gets married and changes her lastname, wouldn't you expect to find her in that HashSet?

    opened by monrealis 10
  • AlreadyBuiltException: This object has already been built

    AlreadyBuiltException: This object has already been built

    Building the spring-projects/spring-data-examples works fine but running the spring-projects/spring-data-examples/rest/security with:

    mvn spring-boot:run
    

    fails with AlreadyBuiltException -- see below for stacktrace, environment, and dependencies.

    Environment

    $:~/src/spring-data-examples/rest/security> mvn -v
    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T09:41:47-07:00)
    Maven home: /home/jan/apache-maven-3.3.9
    Java version: 1.8.0_74, vendor: Oracle Corporation
    Java home: /home/jan/jdk1.8.0_74/jre
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "3.16.7-35-desktop", arch: "amd64", family: "unix"
    

    Failure stacktrace

    2016-05-11 16:40:14.350 ERROR 28768 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Exception starting filter springSecurityFilterChain
    
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'application': Unsatisfied dependency expressed through field 'itemRepository': Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1062) ~[spring-context-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326) ~[spring-web-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235) ~[spring-web-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199) ~[spring-web-4.3.0.RC1.jar:4.3.0.RC1]
            at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:109) ~[tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4658) [tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5277) [tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) [tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) [tomcat-embed-core-8.0.33.jar:8.0.33]
            at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) [tomcat-embed-core-8.0.33.jar:8.0.33]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
            at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'application': Unsatisfied dependency expressed through field 'itemRepository': Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 23 common frames omitted
    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'application': Unsatisfied dependency expressed through field 'itemRepository': Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:350) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansWithAnnotation(DefaultListableBeanFactory.java:580) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.context.support.AbstractApplicationContext.getBeansWithAnnotation(AbstractApplicationContext.java:1186) ~[spring-context-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.boot.autoconfigure.security.BootGlobalAuthenticationConfiguration$BootGlobalAuthenticationConfigurationAdapter.init(BootGlobalAuthenticationConfiguration.java:75) ~[spring-boot-autoconfigure-1.4.0.M2.jar:1.4.0.M2]
            at org.springframework.boot.autoconfigure.security.BootGlobalAuthenticationConfiguration$BootGlobalAuthenticationConfigurationAdapter.init(BootGlobalAuthenticationConfiguration.java:60) ~[spring-boot-autoconfigure-1.4.0.M2.jar:1.4.0.M2]
            at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:369) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:323) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration.getAuthenticationManager(AuthenticationConfiguration.java:81) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.authenticationManager(WebSecurityConfigurerAdapter.java:236) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:175) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:290) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:67) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:369) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:323) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:105) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$a3a955e7.CGLIB$springSecurityFilterChain$4(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$a3a955e7$$FastClassBySpringCGLIB$$5d99d1a7.invoke(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355) ~[spring-context-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration$$EnhancerBySpringCGLIB$$a3a955e7.springSecurityFilterChain(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 24 common frames omitted
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemRepository': Post-processing of FactoryBean's singleton object failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1590) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:187) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1208) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1048) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1018) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:570) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 59 common frames omitted
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'methodSecurityInterceptor' defined in class path resource [org/springframework/security/config/annotation/method/configuration/GlobalMethodSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor.getAdvice(MethodSecurityMetadataSourceAdvisor.java:107) ~[spring-security-core-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.aop.aspectj.AspectJProxyUtils.isAspectJAdvice(AspectJProxyUtils.java:67) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.aspectj.AspectJProxyUtils.makeAdvisorChainAspectJCapableIfNecessary(AspectJProxyUtils.java:49) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.extendAdvisors(AspectJAwareAdvisorAutoProxyCreator.java:97) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:89) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:346) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:298) ~[spring-aop-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1723) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:113) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 67 common frames omitted
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.aopalliance.intercept.MethodInterceptor]: Factory method 'methodSecurityInterceptor' threw exception; nested exception is org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 86 common frames omitted
    Caused by: org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built
            at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:44) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration.getAuthenticationManager(AuthenticationConfiguration.java:81) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.authenticationManager(GlobalMethodSecurityConfiguration.java:256) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration.methodSecurityInterceptor(GlobalMethodSecurityConfiguration.java:123) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$6b1e48c0.CGLIB$methodSecurityInterceptor$13(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$6b1e48c0$$FastClassBySpringCGLIB$$c44e3363.invoke(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355) ~[spring-context-4.3.0.RC1.jar:4.3.0.RC1]
            at org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration$$EnhancerBySpringCGLIB$$6b1e48c0.methodSecurityInterceptor(<generated>) ~[spring-security-config-4.0.2.RELEASE.jar:4.0.2.RELEASE]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.0.RC1.jar:4.3.0.RC1]
            ... 87 common frames omitted
    

    Dependency tree

    [INFO]                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    [INFO] ------------------------------------------------------------------------                                                                                                                                                                                                                                                                                                                                                                                        
    [INFO] Building Spring Data REST - Security Example 1.0.0.BUILD-SNAPSHOT                                                                                                                                                                                                                                                                                                                                                                                               
    [INFO] ------------------------------------------------------------------------                                                                                                                                                                                                                                                                                                                                                                                        
    [INFO]                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ spring-data-rest-security ---                                                                                                                                                                                                                                                                                                                                                                             
    [INFO] org.springframework.data.examples:spring-data-rest-security:jar:1.0.0.BUILD-SNAPSHOT                                                                                                                                                                                                                                                                                                                                                                            
    [INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.M2:compile                                                                                                                                                                                                                                                                                                                                                                                   
    [INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.4.0.M2:compile                                                                                                                                                                                                                                                                                                                                                                                         
    [INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.M2:compile                                                                                                                                                                                                                                                                                                                                                                              
    [INFO] |  |  |  +- ch.qos.logback:logback-classic:jar:1.1.7:compile                                                                                                                                                                                                                                                                                                                                                                                                    
    [INFO] |  |  |  |  \- ch.qos.logback:logback-core:jar:1.1.7:compile                                                                                                                                                                                                                                                                                                                                                                                                    
    [INFO] |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile                                                                                                                                                                                                                                                                                                                                                                                                           
    [INFO] |  |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile                                                                                                                                                                                                                                                                                                                                                                                                       
    [INFO] |  |  \- org.yaml:snakeyaml:jar:1.17:runtime                                                                                                                                                                                                                                                                                                                                                                                                                    
    [INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.0.M2:compile                                                                                                                                                                                                                                                                                                                                                                                     
    [INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.8.9:compile                                                                                                                                                                                                                                                                                                                                                                                                            
    [INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.0.M2:compile                                                                                                                                                                                                                                                                                                                                                                                    
    [INFO] |  |  +- org.apache.tomcat:tomcat-jdbc:jar:8.0.33:compile                                                                                                                                                                                                                                                                                                                                                                                                       
    [INFO] |  |  |  \- org.apache.tomcat:tomcat-juli:jar:8.0.33:compile                                                                                                                                                                                                                                                                                                                                                                                                    
    [INFO] |  |  \- org.springframework:spring-jdbc:jar:4.3.0.RC1:compile                                                                                                                                                                                                                                                                                                                                                                                                  
    [INFO] |  +- org.hibernate:hibernate-entitymanager:jar:5.1.0.Final:compile                                                                                                                                                                                                                                                                                                                                                                                             
    [INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile                                                                                                                                                                                                                                                                                                                                                                                                
    [INFO] |  |  +- org.hibernate:hibernate-core:jar:5.1.0.Final:compile                                                                                                                                                                                                                                                                                                                                                                                                   
    [INFO] |  |  |  +- antlr:antlr:jar:2.7.7:compile                                                                                                                                                                                                                                                                                                                                                                                                                       
    [INFO] |  |  |  +- org.jboss:jandex:jar:2.0.0.Final:compile
    [INFO] |  |  |  \- com.fasterxml:classmate:jar:1.3.0:compile
    [INFO] |  |  +- dom4j:dom4j:jar:1.6.1:compile
    [INFO] |  |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
    [INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
    [INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
    [INFO] |  |  +- org.javassist:javassist:jar:3.18.1-GA:compile
    [INFO] |  |  \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
    [INFO] |  +- javax.transaction:javax.transaction-api:jar:1.2:compile
    [INFO] |  +- org.springframework.data:spring-data-jpa:jar:1.10.1.RELEASE:compile
    [INFO] |  |  +- org.springframework.data:spring-data-commons:jar:1.12.1.RELEASE:compile
    [INFO] |  |  +- org.springframework:spring-orm:jar:4.3.0.RC1:compile
    [INFO] |  |  +- org.springframework:spring-context:jar:4.3.0.RC1:compile
    [INFO] |  |  +- org.springframework:spring-tx:jar:4.3.0.RC1:compile
    [INFO] |  |  +- org.springframework:spring-beans:jar:4.3.0.RC1:compile
    [INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.21:compile
    [INFO] |  |  \- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
    [INFO] |  \- org.springframework:spring-aspects:jar:4.3.0.RC1:compile
    [INFO] +- org.springframework.boot:spring-boot-starter-security:jar:1.4.0.M2:compile
    [INFO] |  +- org.springframework:spring-aop:jar:4.3.0.RC1:compile
    [INFO] |  +- org.springframework.security:spring-security-config:jar:4.0.2.RELEASE:compile
    [INFO] |  |  +- aopalliance:aopalliance:jar:1.0:compile
    [INFO] |  |  \- org.springframework.security:spring-security-core:jar:4.0.2.RELEASE:compile
    [INFO] |  \- org.springframework.security:spring-security-web:jar:4.0.2.RELEASE:compile
    [INFO] |     +- org.springframework:spring-expression:jar:4.3.0.RC1:compile
    [INFO] |     \- org.springframework:spring-web:jar:4.3.0.RC1:compile
    [INFO] +- com.h2database:h2:jar:1.4.191:compile
    [INFO] +- org.springframework.boot:spring-boot-starter-data-rest:jar:1.4.0.M2:compile
    [INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.M2:compile
    [INFO] |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.M2:compile
    [INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.33:compile
    [INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.33:compile
    [INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.33:compile
    [INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.33:compile
    [INFO] |  |  +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
    [INFO] |  |  |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
    [INFO] |  |  \- org.springframework:spring-webmvc:jar:4.3.0.RC1:compile
    [INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.7.3:compile
    [INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.7.3:compile
    [INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.7.3:compile
    [INFO] |  \- org.springframework.data:spring-data-rest-webmvc:jar:2.5.1.RELEASE:compile
    [INFO] |     \- org.springframework.data:spring-data-rest-core:jar:2.5.1.RELEASE:compile
    [INFO] |        +- org.springframework.hateoas:spring-hateoas:jar:0.19.0.RELEASE:compile
    [INFO] |        +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
    [INFO] |        \- org.atteo:evo-inflector:jar:1.2.1:compile
    [INFO] +- org.projectlombok:lombok:jar:1.16.8:provided
    [INFO] +- org.springframework.boot:spring-boot-devtools:jar:1.4.0.M2:provided
    [INFO] |  +- org.springframework.boot:spring-boot:jar:1.4.0.M2:compile
    [INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.M2:compile
    [INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.M2:test
    [INFO]    +- org.springframework.boot:spring-boot-test:jar:1.4.0.M2:test
    [INFO]    +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.M2:test
    [INFO]    +- com.jayway.jsonpath:json-path:jar:2.2.0:test
    [INFO]    |  \- net.minidev:json-smart:jar:2.2.1:test
    [INFO]    |     \- net.minidev:accessors-smart:jar:1.1:test
    [INFO]    |        \- org.ow2.asm:asm:jar:5.0.3:test
    [INFO]    +- junit:junit:jar:4.12:test
    [INFO]    +- org.assertj:assertj-core:jar:2.4.1:test
    [INFO]    +- org.mockito:mockito-core:jar:1.10.19:test
    [INFO]    |  \- org.objenesis:objenesis:jar:2.1:test
    [INFO]    +- org.hamcrest:hamcrest-core:jar:1.3:test
    [INFO]    +- org.hamcrest:hamcrest-library:jar:1.3:test
    [INFO]    +- org.skyscreamer:jsonassert:jar:1.3.0:test
    [INFO]    |  \- org.json:json:jar:20140107:test
    [INFO]    +- org.springframework:spring-core:jar:4.3.0.RC1:compile
    [INFO]    \- org.springframework:spring-test:jar:4.3.0.RC1:test
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 3.162 s
    [INFO] Finished at: 2016-05-11T16:45:56-06:00
    [INFO] Final Memory: 26M/374M
    [INFO] ------------------------------------------------------------------------
    
    opened by JanStureNielsen 9
  • Demonstrate use of @DataJpaTest when multiple datasources are configured

    Demonstrate use of @DataJpaTest when multiple datasources are configured

    I've successfully configured two datasources per your example, but it appears additional configuration is needed to make @DataJpaTest's magic work. Currently my attempts fail with below stack trace, and it's not at all clear to a beginner what needs to change to make this work.

    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'mainEntityManager' threw exception; nested exception is java.lang.IllegalArgumentException: No visible constructors in class org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfiguration$EmbeddedDataSourceFactoryBean
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
    	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
    	... 66 more
    Caused by: java.lang.IllegalArgumentException: No visible constructors in class org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfiguration$EmbeddedDataSourceFactoryBean
    	at org.springframework.cglib.proxy.Enhancer.filterConstructors(Enhancer.java:666)
    	at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:567)
    	at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
    
    
    opened by bemace 7
  • WARN 764 --- [           main] SpelExpressionStringQueryParameterBinder : Setting the parameter with name '__$synthetic$__4' and position 'null' lead to an exception.

    WARN 764 --- [ main] SpelExpressionStringQueryParameterBinder : Setting the parameter with name '__$synthetic$__4' and position 'null' lead to an exception.

    I have just switched from Spring Boot 1.5.3 to 1.5.7 and suddenly the following warning started to show up on executing one of my JPA Repository unit test.

    WARN 764 --- [           main] SpelExpressionStringQueryParameterBinder : Setting the parameter with name '__$synthetic$__4' and position 'null' lead to an exception.
    
    java.lang.IllegalArgumentException: Unknown parameter name : __$synthetic$__4
    	at org.hibernate.query.internal.QueryParameterBindingsImpl.getBinding(QueryParameterBindingsImpl.java:208) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
    	at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:486) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
    	at org.hibernate.query.internal.AbstractProducedQuery.setParameter(AbstractProducedQuery.java:104) ~[hibernate-core-5.2.11.Final.jar:5.2.11.Final]
    	at org.springframework.data.jpa.repository.query.SpelExpressionStringQueryParameterBinder.potentiallyBindExpressionParameters(SpelExpressionStringQueryParameterBinder.java:100) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.SpelExpressionStringQueryParameterBinder.bind(SpelExpressionStringQueryParameterBinder.java:76) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.ParameterBinder.bindAndPrepare(ParameterBinder.java:161) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.ParameterBinder.bindAndPrepare(ParameterBinder.java:152) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.AbstractStringBasedJpaQuery.doCreateQuery(AbstractStringBasedJpaQuery.java:81) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:190) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:121) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:85) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:116) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:106) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:483) [spring-data-commons-1.13.7.RELEASE.jar:na]
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461) [spring-data-commons-1.13.7.RELEASE.jar:na]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56) [spring-data-commons-1.13.7.RELEASE.jar:na]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) [spring-data-jpa-1.11.7.RELEASE.jar:na]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57) [spring-data-commons-1.13.7.RELEASE.jar:na]
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at com.sun.proxy.$Proxy115.findIdsOfPlayersSuspendedByYellowCardsOnMatchdayWhoReceived2YellowCardsOnLastMatchday(Unknown Source) [na:na]
    	at com.example.PlayerStatisticsRepositoryTest.findIdsOfPlayersSuspendedByYellowCardsOnMatchdayWhoReceived2YellowCardsOnLastMatchday(PlayerStatisticsRepositoryTest.java:514) [test-classes/:na]
    	at com.example.PlayerStatisticsRepositoryTest.ifPlayerHad3YellowCardsAndReceived2OnLastMatchdayThenShouldBeSuspendedOnNextOne(PlayerStatisticsRepositoryTest.java:819) [test-classes/:na]
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_144]
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_144]
    	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_144]
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.12.jar:4.12]
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) [spring-test-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:na]
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:na]
    

    This does not happen when I fall back to 1.5.3. It looks like this is printed with Throwable.printStackTrace() because the tests are running all green.

    opened by PawelJagus 7
  • Migrate Elasticsearch examples to JUnit 5

    Migrate Elasticsearch examples to JUnit 5

    • [x] You have read the Spring Data contribution guidelines.
    • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
    • [x] You submit test cases (unit or integration tests) that back your changes.
    • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
    status: waiting-for-triage 
    opened by wolfdale 6
  • #330 - Demonstrate usage of JPA 2.1 @SqlResultSetMapping.

    #330 - Demonstrate usage of JPA 2.1 @SqlResultSetMapping.

    Sometimes, e.g. for analytics, it is handy to be able to return a different entity result type from a Repository query method than the base Repository entity type or an interface based projection.

    This demonstrates how to use a custom @SqlResultSetMapping in combination with @ColumnResult introduced in JPA 2.1.

    opened by thomasdarimont 6
  • Migrating jpa and web examples to junit 5.

    Migrating jpa and web examples to junit 5.

    • [x] You have read the Spring Data contribution guidelines.
    • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
    • [ ] You submit test cases (unit or integration tests) that back your changes.
    • [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
    opened by divyajnu08 5
  • Please provide an example folder illustrating how to override the default parameters for spring-data-redis

    Please provide an example folder illustrating how to override the default parameters for spring-data-redis

    I am just starting out with spring-data-redis using lettuce and I can't seem to get the autowired objects to pick up spring.redis.host from my application.yml.

    spring:
      redis:
        host: xxxxxxxxxxx.cache.amazonaws.com
        port: 6379
    

    Could you give me some pointers based off example/springdata/redis/repositories/ApplicationConfiguration.java?

    opened by hello-josh 5
  • Cacheable annotation on CachingUserRepository.save(…) uses entity as caching key

    Cacheable annotation on CachingUserRepository.save(…) uses entity as caching key

    I'm looking to reproduce the example provided in this repo, which is the spring data repository and spring caching via cache abstraction configured by annotations.. the example i'm referring to is the following: "CachingUserRepository.java".

    I have been doing a lot of reading to understand what is going on and to be able to model it for my own needs.

    Code in question is reproduced here for easy reference:

    public interface CachingUserRepository extends CrudRepository<User, Long> {
    
    	@Override
    	@CacheEvict("byUsername")
    	<S extends User> S save(S entity);
    
    	@Cacheable("byUsername")
    	User findByUsername(String username);
    }
    

    The question i have is regarding the "CacheEvict", where whenever a key is not specified the SimpleKeyGenerator is used to generate a key which is then used to evict the cache.

    However i don't understand how the eviction could ever possibly work given the cache key generated from the SimpleKeyGenerator will differ for the two method / cases.

    I would suspect that have the same behaviour the CacheEvic method should also contain the following:

    	@Override
    	@CacheEvict(value="byUsername", key="#p0.username")
    	<S extends User> S save(S entity);
    

    Am i missing something beefy that spring is doing underneath? Could someone if domain knowledge share some light on this?

    Regards

    ade

    opened by ade90036 5
  • QueryDSL Web Example fails when Predicate is null

    QueryDSL Web Example fails when Predicate is null

    Start the QueryDSL Web Example : then go the web page and try to go to page n°2.

    It will raise a java.lang.IllegalArgumentException: Predicate must not be null!

    Predicate is null when no search is done in UserController. I'll propose a PR ASAP.

    opened by totothekiller 5
  • spring boot data jdbc 2.7.6 saveAll as batch insert

    spring boot data jdbc 2.7.6 saveAll as batch insert

    good day! I use spring-boot-starter-data-jdbc 2.7.6 saveAll SimpleJdbcRepository implementation is: return Streamable.of(entities).stream() // .map(this::save) // .collect(Collectors.toList());

    could you please add information how to configure project to use saveAll as batch insert. Thanks!

    status: waiting-for-triage 
    opened by AleksandrNi 1
  • The transaction does not seem to take effect in this case

    The transaction does not seem to take effect in this case

    public interface DistributedLockRepository extends ReactiveCrudRepository<DistributedLock, String> {
    
        @Query("SELECT * FROM distributed_lock WHERE lock_key = :#{[0]} for update ")
        Mono<DistributedLock> findByLockKey(String lockKey);
    
    }
    
        @Override
        public boolean acquireLock(DistributedLockDO distributedLockDO) {
            try {
                return Boolean.TRUE.equals(distributedLockRepository.findByLockKey(distributedLockDO.getLockKey())
                    .publishOn(Schedulers.boundedElastic()).map(distributedLock -> {
                        if (distributedLock != null && StringUtils.isNotBlank(distributedLock.getLockValue())
                            && !StringUtils.equals(distributedLock.getLockValue(), distributedLockDO.getLockValue())
                            && System.currentTimeMillis() < distributedLock.getExpireTime()) {
                            return false;
                        }
                        distributedLockDO.setExpireTime(distributedLockDO.getExpireTime() + System.currentTimeMillis());
                        if (distributedLock != null) {
                            if (!StringUtils.equals(distributedLock.getLockValue(), distributedLockDO.getLockValue())) {
                                distributedLock.setLockValue(distributedLockDO.getLockValue());
                            }
                            distributedLock.setNewLock(false);
                            return distributedLockRepository.save(distributedLock).block() != null;
                        }
                        distributedLock = new DistributedLock();
                        distributedLockDOToEntity.copy(distributedLockDO, distributedLock, null);
                        return distributedLockRepository.save(distributedLock).block() != null;
                    }).as(operator::transactional).block());
            } catch (R2dbcDataIntegrityViolationException e) {
                // being scrambled by other threads to succeed
                return false;
            }
        }
    
    Caused by: io.r2dbc.spi.R2dbcTimeoutException: Lock wait timeout exceeded; try restarting transaction
    	at dev.miku.r2dbc.mysql.ExceptionFactory.createException(ExceptionFactory.java:69)
    	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
    Error has been observed at the following site(s):
    	*__checkpoint ⇢ SQL "UPDATE distributed_lock SET lock_value = ?, expire = ? WHERE distributed_lock.lock_key = ?" [DatabaseClient]
    Original Stack Trace:
    		at dev.miku.r2dbc.mysql.ExceptionFactory.createException(ExceptionFactory.java:69)
    		at dev.miku.r2dbc.mysql.TextQueryHandler.accept(QueryFlow.java:317)
    		at dev.miku.r2dbc.mysql.TextQueryHandler.accept(QueryFlow.java:292)
    		at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:176)
    		at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
    		at dev.miku.r2dbc.mysql.util.DiscardOnCancelSubscriber.onNext(DiscardOnCancelSubscriber.java:70)
    		at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
    		at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onNext(MonoFlatMapMany.java:250)
    		at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200)
    		at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:126)
    		at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
    		at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:491)
    		at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:299)
    		at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27)
    		at reactor.core.publisher.EmitterProcessor.onNext(EmitterProcessor.java:265)
    		at dev.miku.r2dbc.mysql.client.ReactorNettyClient$ResponseSink.next(ReactorNettyClient.java:340)
    		at dev.miku.r2dbc.mysql.client.ReactorNettyClient.lambda$new$0(ReactorNettyClient.java:103)
    		at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:185)
    		at reactor.netty.channel.FluxReceive.drainReceiver(FluxReceive.java:279)
    		at reactor.netty.channel.FluxReceive.onInboundNext(FluxReceive.java:388)
    		at reactor.netty.channel.ChannelOperations.onInboundNext(ChannelOperations.java:404)
    		at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    		at dev.miku.r2dbc.mysql.client.MessageDuplexCodec.handleDecoded(MessageDuplexCodec.java:187)
    		at dev.miku.r2dbc.mysql.client.MessageDuplexCodec.channelRead(MessageDuplexCodec.java:95)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    		at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:327)
    		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:299)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    		at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1372)
    		at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1235)
    		at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1284)
    		at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:510)
    		at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:449)
    		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:279)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    		at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    		at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    		at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
    		at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
    		at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
    		at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
    		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
    		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    		at java.base/java.lang.Thread.run(Thread.java:829)
    <==
    

    When using the above code, the transaction will fail, and querying the data first and then updating it will fail due to the inability to get an x-lock on the database

    status: feedback-provided status: waiting-for-triage 
    opened by a364176773 13
  • Additions to Couchbase transactions example.

    Additions to Couchbase transactions example.

    Closes #650.

    • [x] You have read the Spring Data contribution guidelines.
    • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
    • [x] You submit test cases (unit or integration tests) that back your changes.
    • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
    status: waiting-for-triage 
    opened by mikereiche 0
  • Couchbase transactions example needs to be on 3.0.0-RC2 as 3.0.0 has …

    Couchbase transactions example needs to be on 3.0.0-RC2 as 3.0.0 has …

    …reactor with a regression.

    Also includes some improvements to sample.

    Closes #648.

    • [x] You have read the Spring Data contribution guidelines.
    • [x] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
    • [x] You submit test cases (unit or integration tests) that back your changes.
    • [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
    status: waiting-for-triage 
    opened by mikereiche 0
Owner
Spring
Spring
Algorithms and Data Structures implemented in Java

Java : Algorithms and Data Structure The algorithms and data structures are implemented in Java. This is a collection of algorithms and data structure

Justin Wetherell 4.2k Jan 5, 2023
Computer science data structures and algorithms implementation from scratch

Data Structures and Algorithms Computer science data structures and algorithms implementation from scratch Stack (Last In First Out) Stack is an abstr

Harshal Patil 49 Nov 8, 2022
Castled is an open source reverse ETL solution that helps you to periodically sync the data in your warehouses and databases to sales, marketing, support or custom apps without any help from engineering teams

Open source reverse-ETL platform to operationalize your data warehouse Introduction Castled is a Reverse ETL solution which enables you to make the va

Castled 314 May 2, 2022
Demonstrates the features of the Spring MVC web framework

Spring MVC Showcase Demonstrates the capabilities of the Spring MVC web framework through small, simple examples. After reviewing this showcase, you s

Spring 5k Jan 5, 2023
A sample Spring-based application

Spring PetClinic Sample Application Understanding the Spring Petclinic application with a few diagrams See the presentation here Running petclinic loc

Spring 6k Dec 28, 2022
You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.

Spring Integration Samples Note This (master) branch requires Spring Integration 5.0 or above. For samples running against earlier versions of Spring

Spring 2.1k Dec 30, 2022
Spring Boot Login and Registration example with MySQL, JWT, Rest Api - Spring Boot Spring Security Login example

Spring Boot Login example with Spring Security, MySQL and JWT Appropriate Flow for User Login and Registration with JWT Spring Boot Rest Api Architect

null 58 Jan 5, 2023
Spring Boot JdbcTemplate example with SQL Server: CRUD Rest API using Spring Data JDBC, Spring Web MVC

Spring Boot JdbcTemplate example with SQL Server: Build CRUD Rest API Build a Spring Boot CRUD Rest API example that uses Spring Data Jdbc to make CRU

null 7 Dec 20, 2022
Spring Boot & MongoDB Login and Registration example with JWT, Spring Security, Spring Data MongoDB

Spring Boot Login and Registration example with MongoDB Build a Spring Boot Auth with HttpOnly Cookie, JWT, Spring Security and Spring Data MongoDB. Y

null 15 Dec 30, 2022
Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

Spring Boot JWT Authentication example with Spring Security & Spring Data JPA

null 1 Jan 26, 2022
Java related projects and also a begginer level projects

Java related projects and also a begginer level projects

Akshit Sijwali 3 Dec 15, 2022
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

Spring 系列教程 该仓库为个人博客https://mrbird.cc中Spring系列源码,包含Spring Boot、Spring Boot & Shiro、Spring Cloud,Spring Boot & Spring Security & Spring Security OAuth2

mrbird 24.8k Jan 6, 2023
Spring Boot Security Login example with JWT and H2 example

Spring Boot Security Login example with JWT and H2 example Appropriate Flow for User Login and Registration with JWT and HttpOnly Cookie Spring Boot R

null 50 Dec 21, 2022
This module explains about the example of Spring MVC + Database Integration with MySQL using Hibernate ORM with practical coding example and required JAR dependencies

SpringMVC-Database-Integration This module explains about the example of Spring MVC + Database Integration with MySQL using Hibernate ORM with practic

GowthamRaj K 3 Nov 2, 2021
An example of how to working with paging in Spring for GraphQL / Spring Data JPA

Spring for GraphQL Paging This repo contains the code for a live coding session I did on: Spring Data JPA GraphQL Paging & Sorting The reason I put th

Dan Vega 10 Nov 28, 2022
Example mod for Minicraft projects

MiniFabric Example Mod Setup No real setup instructions yet, but it should be very similar to the setup explained on the fabric wiki page, until you h

null 1 Jan 30, 2022
A set of example projects utilizing Discord4J

Discord4J Example Projects Provided are a set of very simple example projects showcasing two simple slash commands: ping-pong and greet using Discord4

null 17 Nov 8, 2022
This repository is an example of one of my biggest object-oriented projects

COO - Project This repository belongs to Lounès Meddahi. This project was realized in collaboration with Matthieu Medeng Essia Computer Science and Ma

Lounès Mh 2 Sep 11, 2022
A distributed data integration framework that simplifies common aspects of big data integration such as data ingestion, replication, organization and lifecycle management for both streaming and batch data ecosystems.

Apache Gobblin Apache Gobblin is a highly scalable data management solution for structured and byte-oriented data in heterogeneous data ecosystems. Ca

The Apache Software Foundation 2.1k Jan 4, 2023