Skip to content

Instantly share code, notes, and snippets.

💭
👋https://twitter.com/snicoll

Stéphane Nicoll snicoll

💭
👋https://twitter.com/snicoll
Block or report user

Report or block snicoll

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SingleTypeProjectContributor.java
package com.example.custominitializr.generator.contributor;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import io.spring.initializr.generator.io.template.MustacheTemplateRenderer;
import io.spring.initializr.generator.project.ResolvedProjectDescription;
View gist:ac6b5ba8c469bd79a22183704b5df852
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
View gist:9bc165ca29b7205c9e26760060d848b8
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
View bytecode
// ================com/example/demo/MyProperties.class =================
// class version 50.0 (50)
// access flags 0x31
public final class com/example/demo/MyProperties {
// access flags 0x12
private final Ljava/lang/String; foo
@Lorg/jetbrains/annotations/NotNull;() // invisible
View gh-10702
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12.getContextClassLoader(VersionHelper12.java:185)
at com.sun.naming.internal.ResourceManager.getFactory(ResourceManager.java:426)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:592)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:550)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:345)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate.lambda$lookup$0(JndiTemplate.java:156)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:91)
@snicoll
snicoll / keycloack.md
Last active Apr 14, 2017
Keycloack Auto-configuration brain dump
View keycloack.md

Here is a proposal based on a quick overview of the code with, I hope, enough explanations so that it makes sense.

Spring Boot adapter

The keycloak-spring-boot-adapter is the code that holds the auto-configuration as far as I can see so it would be nicer to name it that way. I'd suggest keycloack-spring-boot-autoconfigure but it's really not important.

KeycloakSpringBootConfiguration should be renamed to KeycloakAutoConfiguration

What is important is that rather than taking dependencies and patching them in a shaded jar at that level, you should take that decision in the starter, leaving all that business out of the autoconfigure module. Here is what I suggests:

View gist:c445ef4d7daba0facdd5ffa854efd364
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
View gist:1cf6d17e91656fc22f38bf76ad8a294a
@Bean
public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
return restTemplateBuilder.build();
}
View gist:cef801932814a15f35180cc8c173f2a8
[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-
View gist:f0bcfaddb9197aa2e473
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
You can’t perform that action at this time.