Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:53
    spring-issuemaster unlabeled #19295
  • 01:53
    spring-issuemaster labeled #19295
  • 01:52
    iTanChi commented #19295
  • 01:13
    spring-issuemaster labeled #19316
  • 01:13
    eddumelendez opened #19316
  • 00:27

    spring-buildmaster on v2.1.11.RELEASE

    Release v2.1.11.RELEASE (compare)

  • 00:27

    spring-buildmaster on 2.1.x

    Next development version (v2.1.… (compare)

  • Dec 05 23:26
    philwebb commented #14494
  • Dec 05 23:22
    mbarve31 commented #14494
  • Dec 05 22:15
    FunThomas424242 commented #19196
  • Dec 05 22:06
    mbhave reopened #18767
  • Dec 05 21:35
    philwebb assigned #16655
  • Dec 05 21:35
    philwebb demilestoned #16655
  • Dec 05 21:35
    philwebb milestoned #16655
  • Dec 05 21:33
    mbhave edited #19196
  • Dec 05 21:33
    mbhave demilestoned #19196
  • Dec 05 21:33
    mbhave milestoned #19196
  • Dec 05 21:33
    mbhave commented #19196
  • Dec 05 21:33
    mbhave closed #19315
  • Dec 05 21:33
    mbhave closed #19196
Robert Evans
@RobEvansUK_twitter
@ericjturley ericjturley/mcve-configurationproperties#1 Pull request that runs the tests with Kotlin alongside Java. Its messy, as I didn't want to stray too far from the original code... but it works
Deepak Kumar
@RajputDeepaksingh
Hi Everyone and @springframeworkguru . I am facing problem while I inserting Data from pojo response to Couchbase in Spring boot.
I have Pojo class in that i have response from kibana . I want to push all the pojo response into Couchbase. My Pojo structure is like:-
Here is Structure for pojo.:- Root(Class) -> FirstHit (Class) -> Hits(as a List Class) -> _source(class) -> In that so many String , and Json Array is there . And I have entity class Structure in which I wanted to push pojo response . Here is Structures:- Releasedtl (class)->RlsList(as List Class) and inside that so many String Key and one List class is there i.e -> RlsPhaseDtl(as List Class) { List<E1> e1; List<E2> e2; List<E3> e3;} in every List i.e E1,2,3...therevis so many fields to store the that. So my question is i want to take Pojo Class From Hits and Store into Releasedtl Documents . @springframeworkguru @schauder .if anyone can help me then it will be great
Chris
@chris-drm
Hey! I am autowiring an external library service and I get the following error: "Consider defining a bean of type 'com.package.example' in your configuration".
I add @ComponentScan("com.package.example") on my application class, which solves the previous errors, but then I get 404 on any request I send - it looks like my controllers are not added. What am I doing wrong?
Ramo Karahasan-Riechardt
@ramo-karahasan-riechardt
Hi, we're using actuator to expose certain management endpoint to e.g. collect metrics/stats for certain services. Consul is used for Service Discovery. We just saw, that the actuator endpoints are not secured at all and I'd like to understand how to configure them to let the endpoints still be accessible by consul (healthchecks), prometheus but not publicly available. Is there a out-of-the-box solution that simply needs to be configured or is Spring Security with some custom made rules the way to go?
celroid
@celroid

@wilkinsona Hello Andy, you've helped me the last time and I am grateful.
I have another question if you would please assist me, I need to have 2 differently configured RestTemplates (@Bean(proxiedRestTemplate) and noProxyRestTemplate). I cannot use RestTemplateCustomizer because I don't need the configuration to be common for both of them. And I wouldn't like to define my own RestTemplateBuilder beans, so my preferred approach would be to inject the auto-configured RestTemplateBuilder.

My question is how can I inject the auto-configured RestTemplateBuilder into each RestTemplate methods?

Omid Barat
@obarat
hello, I would like to know if I can listen for AuditApplicationEvents in a reactive application? I see this interesting blurb on their notes, but don't know what they are saying: https://github.com/spring-projects/spring-boot/wiki/Reactive-Actuator#auditevents
Andy Wilkinson
@wilkinsona
@ramo-karahasan-riechardt Spring Security is your best option for securing a Spring Boot app
@celroid If I've understood you correctly, you'd have two @Bean methods, each of which takes RestTemplateBuilder as an argument and uses it to build and return a RestTemplate instance.
Andy Wilkinson
@wilkinsona
@obarat That's an internal design document from a couple of years ago. I wouldn't pay much attention to it. Regardless, listening to events is really unrelated to the actuator and its endpoints. You can listen to AuditApplicationEvent using an @EventListener method that takes the event as an argument.
Omid Barat
@obarat
@wilkinsona does this work in a reactive application?
Andy Wilkinson
@wilkinsona
It depends on where the events are being published, the configuration of Framework's event multicaster, and what you do in your listener. spring-projects/spring-framework#21025 may be of interest
Omid Barat
@obarat
@wilkinsona I'm running into a hairy situation where I need to log the cases where the authentication has failed, I try to use an accessDeniedHandler, but at that point the principal is not present in the context. I wonder if you are aware of any solutions for this.
Alexandre Rocha
@alexandrececchin
Hey Guys, I'm upgrading a spring project from 1.5 to 2.0. I've scheduler do log into files my app metrics and there I used org.springframework.boot.actuate.endpoint.MetricsEndpoint.ivoke() to get a Map<String, Object> to be write in this file, however, this class has been removed. Any tips about how read the actuator metrics in a java class?
Niranjan
@nnanda2016
Hello Spring Boot team, what’s the main reason behind deprecating MediaType.APPLICATION_JSON_UTF8? I think this media type is still valid for Content-Type header
boda2004
@boda2004
@nnanda2016 utf8 is default, so no need to specify it
celroid
@celroid
@wilkinsona I've done that and it works, but I don't understand how it works. How can RestTemplateBuilder be injected if I haven't defined a bean for it and I haven't used the @Autowired annotation?
Niranjan
@nnanda2016
@boda2004 even if it is default, RFC still allows users to specify it (at least for content-type header). So, I don’t really see a real value-add in deprecating this.
boda2004
@boda2004
i suppose the idea is to not specify defaults explicitly, and framework encourages you. i'm not from spring boot team so my guess may be wrong
Niranjan
@nnanda2016

well, as a framework, it should allow broader possibilities because server authors can accomodate that. In fact, after i upgraded my app to SB 2.2.x, I saw those deprecated constants and removed those usages, but in our code we were using that to validate input request and my removal of those usages broke the client integration….I had to define my own constant using MediaType constructor with UTF-8 to fix the issue. :) That’s why i feel it should not have been deprecated by Spring (as a framework)

That said, may be my understanding is not enough.

Thanks anyways for your time to explain :)

Brian Clozel
@bclozel
@nnanda2016 specifying the charset was a workaround for browser bugs in the first place. Now that it's fixed, we removed the workaround. See spring-projects/spring-framework#22788
You can still use your own media type, it's just not a best practice from our point of view.
Andy Wilkinson
@wilkinsona
@celroid The RestTemplateBuilder bean is defined by Spring Boot's auto-configuration.
BOUH OUALID
@oualidbouh
Hello Guys, I am trying to upgrade my spring boot 1.5.22 webapp to spring boot 2.0.0-RELEASE, and I have an issu related to Metrics. As I can understand the metrics are now auto-configured on spring boot 2. do I need to remove the custome metrics from my project ? thank you in advance for your help !
Melozzola
@Melozzola

I'm having what it looks like a dependency problem.
I've upgraded my spring boot project from 2.1.6.RELEASE to 2.2.1.RELEASE and now some of my tests are failing with the following exception:

java.lang.NoClassDefFoundError: org/springframework/core/annotation/MergedAnnotations$SearchStrategy
        at org.springframework.boot.test.context.ImportsContextCustomizerFactory.createContextCustomizer(ImportsContextCustomizerFactory.java:44)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.getContextCustomizers(AbstractTestContextBootstrapper.java:404)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:376)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:294)
        at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:139)
        at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:124)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:151)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:142)
        [...]

It looks like org.springframework.boot.test.context.ImportsContextCustomizerFactory depends on org.springframework.core.annotation.MergedAnnotations which is not in spring-core:5.1.7.RELEASE
Any idea?

celroid
@celroid
That amazes me, what other beans are defined by Spring Boot's auto-configuration? Is there a way to find out? I've looked at https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-auto-configuration-classes.html#auto-configuration-classes but RestTemplateBuilder is not even listed there. @wilkinsona
Brian Clozel
@bclozel
@celroid we don't maintain a list of all beans per se, but we're documenting all features: https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-resttemplate
Andy Wilkinson
@wilkinsona
@celroid Auto-configuration is one of Spring Boot's main features. If you're using Boot and you're amazed by it auto-configuring things, I'd recommend taking some time to read some of the reference documentation. This is a good starting point. It introduces the concept and explains that you can use --debug to see a report of everything that's been auto-configured.
Brian Clozel
@bclozel
@Melozzola Spring Boot 2.2.1.RELEASE depends on Spring Framework 5.2.1.RELEASE; it seems you've got a dependency management problem. Are you overriding the Spring Framework version?
Melozzola
@Melozzola
@bclozel no I’m not overriding it, but the mvn dependency:tree output gives:
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.29:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.springframework:spring-core:jar:5.1.7.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.1.7.RELEASE:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.25:runtime
From the poms I would expect 5.2.1.RELEASE though
Brian Clozel
@bclozel
@Melozzola something is overriding that version then; can you look into parent poms, or properties defined in poms (is something defining <spring-framework.version>) ?
Melozzola
@Melozzola
Ok, let me dig into it.
Melozzola
@Melozzola
@bclozel Found the issue. There was indeed a dependecy problem. mvn dependency:tree and mvn dependency:tree -Dverbose didn’t show the dependency override, probably because it is not reliable in maven 3
Brian Clozel
@bclozel
@Melozzola I'm glad you found the issue
Zhirayr Gumruyan
@gumruyanzh
Hi all
can someone help me understand the problem behind not being able to use swagger2 with spring boot 2 ?
I'm getting
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
Andy Wilkinson
@wilkinsona
@gumruyanzh Spring Boot 2.2 uses a version of Spring Data that requires Spring Plugin 2.0. Unfortunately, the latest release of SpringFox is only compatible with Spring Plugin 1.2. Until there's a compatible version of Spring Fox, you can either stick with Spring Boot 2.1 or remove SpringFox from your application. While neither's great, I'd recommend removing SpringFox as getting stuck on an old version of a dependency isn't a good place to be.
Zhirayr Gumruyan
@gumruyanzh
@wilkinsona thank you very much,,, another solution I found is to remove spring-boot-starter-data-rest from the pom, and it worked, but still not primary solution
Eric Turley
@ericjturley
@wilkinsona Have you any thoughts regarding https://github.com/ericjturley/mcve-configurationproperties ?
Andy Wilkinson
@wilkinsona
No, not yet. Sorry. Let me have a proper look now.
Andy Wilkinson
@wilkinsona
@ericjturley You're missing a dependency on kotlin-reflect which prevents the @ConstructorBinding-annotated constructor from being found
Your test passes if I add that dependency and all the necessary properties to configure SnsClient
Andy Wilkinson
@wilkinsona
The need for kotlin-reflect is documented here. The way it fails without it isn't very nice though. I've opened spring-projects/spring-boot#19312 to see if we can improve things.
Christoph
@Chr3is
Hey is there a reason why the Jaxb2XmlDecoder does not support own xml mediatypes (application/*+xml)? The Jackson2JsonDecode supports custom json mediatypes (application/*+json)
Eric Turley
@ericjturley
@wilkinsona Nice! Thank you SO much :)
Andy Wilkinson
@wilkinsona
@Chr3is Both decoders support any mime types you want. You can pass them into the constructor.
Omid Barat
@obarat
hello, for a reactive application, how can I get access to the Locale from outside the controller? Do I have to get the Locale from the WebExchange and just pass it to all the methods that need it?
Christoph
@Chr3is
@wilkinsona yeah I extended the Jaxb2XmlDecoder with the application/*+xml mediatype and registered him in my spring webclient but I think it should support this out of the box like the jsondecoder or am I wrong?