Skip to content

Instantly share code, notes, and snippets.

View odrotbohm's full-sized avatar
👨‍💻
@ home

Oliver Drotbohm odrotbohm

👨‍💻
@ home
View GitHub Profile
@odrotbohm
odrotbohm / pom-snippet.xml
Created January 24, 2014 10:47
Using Spring BOM to fix the Spring version for all Spring Framework dependencies
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.0.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
@odrotbohm
odrotbohm / Jdk8DateTimeConverters.java
Created December 29, 2013 19:18
Sketch of Date to JDK 8 date time type converters
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
build 10-Dec-2013 15:20:10 [INFO] --- maven-surefire-plugin:2.12:test (default-test) @ spring-data-jpa ---
build 10-Dec-2013 15:20:10 [INFO] Surefire report directory: /opt/bamboo-home/xml-data/build-dir/SPRINGDATAJPA-SONARJPA-JOB1/target/clover/surefire-reports
build 10-Dec-2013 15:20:10
build 10-Dec-2013 15:20:10 -------------------------------------------------------
build 10-Dec-2013 15:20:10 T E S T S
build 10-Dec-2013 15:20:10 -------------------------------------------------------
build 10-Dec-2013 15:20:11
build 10-Dec-2013 15:20:11 Results :
build 10-Dec-2013 15:20:11
build 10-Dec-2013 15:20:11 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Spring Data Book .................................. SUCCESS [0.377s]
[INFO] Spring Data Book - JPA ............................ SUCCESS [17.637s]
[INFO] Spring Data Book - MongoDB ........................ SUCCESS [9.217s]
[INFO] Spring Data Book - Querydsl ....................... SUCCESS [5.075s]
[INFO] Spring Data Book - Neo4J .......................... SUCCESS [15.437s]
[INFO] Spring Data Book - JDBC ........................... SUCCESS [6.608s]
[INFO] Spring Data Book - Redis .......................... SUCCESS [0.691s]
// Also, isn't it weird, that these two aren't considered to be the same method?
void foo(Object bar) { }
void <A extends Annotation> foo(Object bar) { }
2013-10-31 16:52:04,885 DEBUG ntext.support.StandardServletEnvironment: 110 - Adding [class path resource [application.properties]] PropertySource with lowest search precedence
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
aused by: org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embdedded Tomcat
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.initialize(TomcatEmbeddedServletContainer.java:80)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.<init>(TomcatEmbeddedServletContainer.java:52)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getTomcatEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:259)
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory.getEmbeddedServletContainer(TomcatEmbeddedServletContainerFactory.java:140)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:152)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134)
at org.springframework.
@Target(ElementType.PARAMETER)
@interface MyAnnotation {
@Min(1)
int value() default 10;
}
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import org.junit.Test;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;