Skip to content

Instantly share code, notes, and snippets.

View snicoll's full-sized avatar
🍃
👨‍💻

Stéphane Nicoll snicoll

🍃
👨‍💻
View GitHub Profile
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [org/springframework/boot/test/context/SpringBootTestXmlConventionConfigurationTests-context.xml]; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:180)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:207)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:144)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
at org
@Bean
public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
return restTemplateBuilder.build();
}
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:demo:jar:0.0.1-SNAPSHOT
[WARNING] Multiple conflicting imports of dependency 'org.springframework.cloud:spring-cloud-commons:jar' into model 'org.springframework.cloud:spring-cloud-consul-dependencies:pom:1.0.2.RELEASE' ('26 : 16, org.springframework.cloud:spring-cloud-commons-dependencies:1.1.0.RELEASE /Users/snicoll/.m2/repository/org/springframework/cloud/spring-cloud-commons-dependencies/1.1.0.RELEASE/spring-cloud-commons-dependencies-1.1.0.RELEASE.pom', '26 : 16, org.springframework.cloud:spring-cloud-commons-dependencies:1.1.1.RELEASE /Users/snicoll/.m2/repository/org/springframework/cloud/spring-cloud-commons-dependencies/1.1.1.RELEASE/spring-cloud-commons-dependencies-1.1.1.RELEASE.pom'). To resolve this conflict, either declare the dependency directly in the dependency management of model 'org.springframework.cloud:spring-cloud-
2015-12-16 17:32:25.853 DEBUG 42554 --- [-StoreService-1] com.netflix.hystrix.AbstractCommand : Error executing HystrixCommand.run(). Proceeding to fallback logic ...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ribbonLoadBalancer' defined in org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.loadbalancer.ILoadBalancer]: Factory method 'ribbonLoadBalancer' threw exception; nested exception is java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@9491ab5 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@6cccdba0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.ja
{
"_embedded" : {
"stores" : [ {
"name" : "22nd St. & Sixth Ave.",
"address" : {
"street" : "684 Avenue of the Americas",
"city" : "New York",
"zip" : "10010-5110",
"location" : {
@snicoll
snicoll / pom.xml
Last active August 29, 2015 14:26
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test</groupId>
<artifactId>demo-default</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@snicoll
snicoll / CacheConfig.java
Last active February 17, 2018 17:48 — forked from anataliocs/CacheConfig.java
Guava cache with spring boot and clear cache method
import com.google.common.cache.CacheBuilder;
import org.springframework.cache.Cache;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.guava.GuavaCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.TimeUnit;
@Configuration

Configuration properties change between 1.2.5.RELEASE and 1.3.0.BUILD-SNAPSHOT

The following keys were added:

Table 1. New keys in 1.3.0.BUILD-SNAPSHOT

Key

Default value

Description

endpoints.cors.allow-credentials

Set whether credentials are supported.

endpoints.cors.allowed-headers

Comma-separated list of headers to allow in a request. '*' allows all headers.

endpoints.cors.allowed-methods

Comma-separated list of methods to allow. '*' allows all methods.

package demo;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
@snicoll
snicoll / config-keys-1.3.0.M2.adoc
Created July 9, 2015 08:51
Spring Boot configuration keys diff for 1.3.0..M2

Configuration properties change between 1.3.0.M1 and 1.3.0.M2

The following keys were added:

Table 1. New keys in 1.3.0.M2

Key

Default value

Description

endpoints.docs.curies.enabled

false

Enable the curie generation (off by default).

endpoints.docs.path

/docs

endpoints.docs.sensitive

false