Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 21 23:58
    mbhave labeled #28085
  • Sep 21 23:58
    mbhave milestoned #28085
  • Sep 21 23:58
    mbhave opened #28085
  • Sep 21 23:57

    mbhave on main

    Polish (compare)

  • Sep 21 22:55
    philwebb commented #28071
  • Sep 21 22:55
    philwebb closed #28084
  • Sep 21 22:55
    philwebb closed #28083
  • Sep 21 22:55
    philwebb closed #28071
  • Sep 21 22:55

    philwebb on main

    Document that devtools restart … Merge pull request #28071 from … Merge branch '2.4.x' into 2.5.x… and 1 more (compare)

  • Sep 21 22:55

    philwebb on 2.5.x

    Document that devtools restart … Merge pull request #28071 from … Merge branch '2.4.x' into 2.5.x… (compare)

  • Sep 21 22:55

    philwebb on 2.4.x

    Document that devtools restart … Merge pull request #28071 from … (compare)

  • Sep 21 22:54
    philwebb labeled #28084
  • Sep 21 22:54
    philwebb milestoned #28084
  • Sep 21 22:54
    philwebb labeled #28084
  • Sep 21 22:54
    philwebb opened #28084
  • Sep 21 22:53
    philwebb milestoned #28083
  • Sep 21 22:53
    philwebb labeled #28083
  • Sep 21 22:53
    philwebb labeled #28083
  • Sep 21 22:53
    philwebb opened #28083
  • Sep 21 22:52
    philwebb assigned #28071
mplain
@mplain
Also, I want to use git.branch as a label to get the correct config from the server.
I have git.properties generated by the plugin (declared in the parent pom in the shared library).
How can I set spring.cloud.config.label to 'git.branch', considering that 'git.properties' is not scanned by default?
Again, I want to solve this globally for all microservices using the shared library (parent pom or @Configuration).
I do not want to introduce new elements in each application.
chrismayday
@chrismayday
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.data.redis.RedisSystemException: Unknown redis exception; nested exception is java.util.concurrent.RejectedExecutionException: event executor terminated
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:517)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at com.overseas.component.auth.component.JwtAuthenticationTokenFilter.doFilterInternal(JwtAuthenticationTokenFilter.java:103)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at com.overseas.component.encryption.aes.AesDecryptFilter.doFilterInternal(AesDecryptFilter.java:30)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(Fil
May I ask what is causing the problem, it will often appear
Philip Bannon
@BannonPhilip_twitter

Hi All, I know this technically isn't the place but the Spring GCP Gitter seems dead:

I'm trying to use GCP Pub sub with spring boot and I want to publish a simple JSON message to a NodeJS API. I found this sample here: https://github.com/spring-cloud/spring-cloud-gcp/tree/main/spring-cloud-gcp-samples/spring-cloud-gcp-integration-pubsub-json-sample but when I try to add

  @Bean
    public JacksonPubSubMessageConverter jacksonPubSubMessageConverter(ObjectMapper objectMapper) {
        return new JacksonPubSubMessageConverter(objectMapper);
    }

to my project and the dependancy

    implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging'
    implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-logging', version: '1.2.8.RELEASE'
    implementation platform('com.google.cloud:libraries-bom:22.0.0')
    implementation 'com.google.cloud:google-cloud-pubsub:1.114.2'
    implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-pubsub'
    implementation group: 'org.springframework.cloud', name: 'spring-cloud-gcp', version: '1.2.8.RELEASE', ext: 'pom'

I get the following error: Cannot resolve symbol 'JacksonPubSubMessageConverter'

Can someone point me in the right direction? Do I need to use Spring integration?

1 reply
Daniel LaFlamme
@dlaflamme
I have a Spring Boot executable jar. It uses the JarLauncher and has a Start-Class specified in META-INF/MANIFEST.MF. All of that works as expected. what I would like to do is add another main method in the jar that I can run manually. How can I do this?
pi
@pi:swissknife.raspberryip.com
[m]
Hi all. 1st Element's room. I'm a Java/Spring developer
Daniel LaFlamme
@dlaflamme
I am getting the following when running a spring boot-based app.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: classpath:/db/changelog/db.changelog-master.yaml does not exist
running from a built jar. is this likely a problem with my gradle build?
1 reply
chrismayday
@chrismayday
Unknown redis exception; nested exception is java.util.concurrent.RejectedExecutionException: event executor terminated
gmurali543
@gmurali543
Hi All, we are build spring boot project with gradle and pointing to custom local repository to load all the dependent jars to look in this location. Placed all the required spring boot jars in local repository , but the application is not finding any spring related class files from those loaded binaries . And app is not building with this issue. Please suggest us on this to proceed further.
1 reply
Jesus The Hun
@JesusTheHun
I'm using MockMultipartHttpServletRequestBuilderto test file upload, and I would like to test a file upload interruption : connection lost, user cancel on purpose, whatever, an interruption. I need to test that some clean clode up is well executed if an interruption happens.
How can I do that ?
1 reply
Gilles Robert
@ask4gilles
Hi,
Can one of the spring boot folks have a look at this question on the tomcat mailing list regarding SB/tomcat http TRACE handling? https://mail-archives.apache.org/mod_mbox/tomcat-users/202109.mbox/%3cd02cb3c1-e483-b3ad-ba1f-976d6cc6857b@apache.org%3e
Thanks!
20 replies
gooddev2021
@gooddev2021
hi
Hey Team. I am a newbie to spring boot. Can someone share me some good working project which has been built on spring boot to explore in depth? Any big application link would be appreciatable.
Alienhunter3010
@pi:swissknife.raspberryip.com
[m]
Anthony Lofton
@miller79
Hey all, I'm looking through the documentation for testing Spring Security with WebFlux (https://docs.spring.io/spring-security/site/docs/current/reference/html5/#webflux-testing-jwt) and it shows a static method being used mockJwt() and jwt() but it doesn't have any references to what class that comes from. Can anyone let me know which classes those methods are located in? I asked on the spring-security gitter but seems that theres not a lot of traffic on that channel vs this one. I also feel the documentation probably should be updated and potentially do a PR when it's known unless someone else wants to take care of it.
4 replies
simrin051
@simrin051
Hi
No primary or single public constructor found for interface java.util.Collection - and no default constructor found either ..I am getting this error. I created a public constructor for the entity class but still the error is the same
Attoumane
@akuma8
messageconverter.PNG
Hi booters,
I would like to know how to handle this situation
Is there a way to select MappingJackson2HttpMessageConverter for a specific request ?
2 replies
Attoumane
@akuma8
Both GsonHttpMessageConverter and MappingJackson2HttpMessageConverter are used for application/json requests but I have a case where MappingJackson2HttpMessageConverter works well than GsonHttpMessageConverter.
Jeffrey van der Laan
@acemoo
I'm having trouble using spring.config.import: vault:// with different profiles. For my local profile, I'm using a different vault host which does not need a custom ssl-trust-store. When I move spring.config.import:vault:// from the application.yml to application-local.yml my application runs correctly. I'm not sure where I should create a bug ticket for this. spring-boot or spring-cloud-vault?
2 replies
gooddev2021
@gooddev2021

Can someone help me with a good link to do the following using Spring Integration Outbound Adapter?

#1 - Write an API, when user hits the API where csv is input for the API - process via spring

 integration and send it FTP server (OR)

#2 - Write an API, when user hits the API - fetch the new daily records from DB - write it to

 a csv file and send it to the FTP server via Spring Integration Outbound Adapter

Thanks

1 reply
blueeheavenn
@blueeheavenn
Hello All- totally new to this. I will like to get some help with my spring boot microservice. Thanks much.
moocstudent
@moocstudent
@blueeheavenn 🙏 welcome to here!
Efeturi Money
@efemoney

Hey everyone, I hope we are all having a wonderful day! 💚. I'm new to spring but also to jackson so I need some help with a special case.

I am trying to improve developer experience and also reduce boilerplate and so I want to be able to automatically serialize (with jackson) a custom type that is supposed to represent a i18n translation key eg StringResource to be used as a property like

class CallToActionDto(val text: StringResource, val deepLink: String)

I am using springs kotlin coroutine support so I have a suspend handler method like

suspend fun getCallToAction(@RequestParam lang: "en" | "de" | "fr" etc): CallToActionDto { ... }

As you can see the client language is passed as a query parameter.

My questions:

  • How do I define the serializer for this my custom type (or a factory of it)? Either the serializer needs to be scoped per request and injected with the current lang query param / resolved Locale OR the serializer would be global but per serialize operation will somehow have access to the request scope to be able to determing the lang / Locale.
  • Will this work out of the box with suspend handler functions? For instance, if I wire a custom LocaleResolver that can read my query param, it will set the Locale to a threadLocal. I don't know if thread local works perfectly with suspend functions
2 replies
Raja Dilip Kolli
@rajadileepkolli
Hi All, How to eagerly load jpa repositories in spring boot 2.6.0-M2? I need this to enable spring batch processing
spring:
data:
jpa:
repositories:
bootstrap-mode: DEFAULT
above setting is not eagerly loading
4 replies
brightinnovator
@brightinnovator

How to docker image of spring boot application?

I'm facing several issues in creating docker application in windows environment.

Can someone help me with a link or reference or steps on how to create docker image for spring boot application in windows environment?

Basically the application runs perfectly fine in IntelliJ or Eclipse STS without any issues (Zero Issues)

Please advise.

Thanks

Varun Sharma
@varunsharmaxyz
Could someone please take a look at this question I had asked on stack overflow
nightswimmings
@nightswimmings
Does anybody know a way to replace a field-injected bean of a @Component during initialization? This Spring Cloud Autoconfiguration (https://github.com/spring-cloud/spring-cloud-dataflow/blob/main/spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/config/DataFlowClientAutoConfiguration.java) has all its dependencies injected as fields, so I have no way to put a custom resttemplate there without making it my app's primary one. And I would like to avoid replicating the whole class because of this. The main exposed bean has a lot of config and it mutates quite often so it would not be maintainable
I am thinking of some BeanFactoryPostProcessor/BeanPostProcessor,/AutowiredAnnotationBeanPostProcessor trick so I can keep using the autoconfiguration and just replace its restTemplate collaborator in the least intrusive way, but it's frankly very scarcely and esoterically documented
Philip Bannon
@BannonPhilip_twitter

Hi All,

I have a question around multi-Tenant. I have two Tenants in Auth0 so two different issuer URI's. I've seen from Spring security I can easily add more than one iss url by doing the following in my security config class:

@Override
    protected void configure(HttpSecurity http) throws Exception {
        JwtIssuerAuthenticationManagerResolver authenticationManagerResolver = new JwtIssuerAuthenticationManagerResolver
                ("https://xxxxxx-dev.eu.auth0.com/", "https://xxxxxx2-dev.eu.auths0.com/");

However I have a method which validates the aud in the token by doing the following:

 @Bean
    @Primary
    JwtDecoder jwtDecoder() {
        /*
        By default, Spring Security does not validate the "aud" claim of the token, to ensure that this token is
        indeed intended for our app. Adding our own validator is easy to do:
        */

        NimbusJwtDecoder jwtDecoder = (NimbusJwtDecoder)
                JwtDecoders.fromOidcIssuerLocation(issuer);

        OAuth2TokenValidator<Jwt> audienceValidator = new AudienceValidator(audience);
        OAuth2TokenValidator<Jwt> withIssuer = JwtValidators.createDefaultWithIssuer(issuer);
        OAuth2TokenValidator<Jwt> withAudience = new DelegatingOAuth2TokenValidator<>(withIssuer, audienceValidator);

        jwtDecoder.setJwtValidator(withAudience);

        return jwtDecoder;
    }

How can I have this work with BOTH issuer URI's....any help would be very much welcome as I'm going crazy here trying to figure this out :D

Thanks

nilamani6394
@nilamani6394
how to connect springboot project with stigo
collegian
@collegian
Hello, I'm trying to log the JSON payload to an external service call that we make from our service. I've tried some stackoverflow solutions - https://stackoverflow.com/questions/33744875/spring-boot-how-to-log-all-requests-and-responses-with-exceptions-in-single-pl but they seem to only log the request and response for the service and not the external calls that service makes. I tried to update the log level to DEBUG from INFO but still don't see anything. Any thoughts on how to achieve this?
4 replies
aboo-ctsols
@aboo-ctsols

Hello, Can anyone share a working sample in Spring Boot Application that works with cron expression in configuration file?

I've tried using below code snippet to schedule an external application. This works in exact 10 minutes gap for 5 times and then stops.

<int:poller max-messages-per-poll="1" cron="0 0/10 * * * *" task-executor="commonThreadPoolTaskExecutor" /> I've asked the same question in stackoverflow and no responsde yet. Ref: https://stackoverflow.com/questions/69168791/cron-expression-is-not-working-as-expected-in-spring-boot-application

1 reply
Vidushi Dwivedi
@Vidz51

I upgraded my spring boot version to 2.5, Now I cant set timezone in application.properties.
This key is removed.
server.jetty.accesslog.time-zone=IST

What is the way of setting the time zone through application.properties in my application?

1 reply
FlxGschlr
@FlxGschlr

Hello,
we are currently looking for a solution to shutdown our application gracefully so that
no messages read from kafka via spring cloud stream reactive functions are lost. Our workflow:

    Read message from kafka -> do stuff with the message content -> save result in mongodb

Since our migration to spring boot oci images we get the following error when shutting down our application:

    org.springframework.data.mongodb.ClientSessionException: state should be: server session pool is open; nested exception is java.lang.IllegalStateException: state should be: server session pool is open
    at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:148)
    at org.springframework.data.mongodb.core.ReactiveMongoTemplate.potentiallyConvertRuntimeException(ReactiveMongoTemplate.java:2814)
    at org.springframework.data.mongodb.core.ReactiveMongoTemplate.lambda$translateException$90(ReactiveMongoTemplate.java:2797)
    at reactor.core.publisher.Mono.lambda$onErrorMap$31(Mono.java:3676)
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192)
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259)
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:140)
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onError(MonoFlatMap.java:172)
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onError(Operators.java:2063)
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onError(FluxMapFuseable.java:140)
    ...

Any ideas? We tried the following but to no avail:

  1. (https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.graceful-shutdown)

     server.shutdown=graceful
  2. (https://stackoverflow.com/questions/67614658/can-i-apply-graceful-shutdown-when-using-spring-cloud-stream-kafka-3-0-3-release)

     @Bean
     public ListenerContainerCustomizer<AbstractMessageListenerContainer<?, ?>> customizer() {
         return (container, dest, group) -> container.getContainerProperties()
                 .setShutdownTimeout(30_000L);
     }

thx

2 replies
Burkhard Graves
@drahkrub
Hi, two questions: 1. What is the easiest / most elegant / most secure way to tell whether a spring-boot project is started as standalone JAR/WAR or via the spring-boot-maven-plugin? 2. Is it possible to declare extra properties in a pom.xml if the spring-boot-maven-plugin is used?
6 replies
Piotr Joński
@sta-szek
hi guys, i have question regarding actuator.
if i have custom endpoint and property management.endpoints.web.exposure.include="*", will it enable my custom endpoints as well?
if not, how to do it? management.endpoints.web.exposure.include="*", custom-endpoint ?
13 replies
Neeraj Patel
@neerajpatel-489

Can anyone please help with this? I have a requirement to set default values of properties spring.jpa.hibernate.ddl-auto=none and spring.jpa.generate-ddl=false from the application so even after changing from the properties file values should not change not perform DDL operation.

Thank you.

I have tried setting like this but it is not working when I am setting values properties to file it is performing DDL operation.

@SpringBootApplication
public class Main {
  public static void main(String[] args) {
    SpringApplication springApplication = new SpringApplication(Main.class);

     Map<String, Object> properties = new HashMap<>();
     properties.put("spring.jpa.hibernate.ddl-auto", "none");
     properties.put("spring.jpa.generate-ddl", false);

     springApplication.setDefaultProperties(properties);
     springApplication.run(args);
 }
}

YAML file

spring:
  jpa:
    generate-ddl: true
    hibernate:
      ddl-auto: create
1 reply
Michael Katzmann
@VK2BEA

I have a Spring Boot program using JdbcTemplate classes like

List<Map<String, Object>> rows = jdbc.queryForList( sqlQuery );
for (Map<?, ?> row : rows) {
....
}

This worked until Spring Boot 2.5.3 when I get the error

PreparedStatementCallback; SQL [CALL LoC_GutenbergSandbox.ExecuteBookOrders( ?, ? )]; Index 8 out of bounds for length 7; nested exception is java.sql.SQLException

Has something changed between 2.5.2 and 2.53 that effects this call?

4 replies
gooddev2021
@gooddev2021

Spring Application Is A Micro-Service? A confusion

One of my friend creates separate spring boot application for each functions or modules and run as a separate application and calling it as micro-service

I told him is that the microservice? There is a confusion how to treat a application or a service as micro-service

When i searched internet, i observed authentication would be in a separate service...All microservice will run independently

Can some experts give a good back around of micro-service or characteristics of micro-service to clarify the confusions

Thanks

Marino Borra
@mborra
Hi, I have a Maven module with its property file with an Auto-Configuration exclusionspring.autoconfigure.exclude=com.ibm.mq.spring.boot.MQAutoConfiguration that excludes another Auto-Configuration, but it doesn't work, it only works in the main Maven module in the application.properties (Spring Boot 2.1.4)
2 replies
Sebastian K
@Nimelrian
Hi everyone! I'm currently trying to write a custom Spring-Boot-Starter package which should provide a CacheManager implementation, using a JPA repository in its internals. I have problems with Spring not instantiating the JPA repository in my actual application (which uses the starter package as a dependency). Is there any previous work I could take a look at to figure out what's wrong with my implementation? Feel free to poke me if I should supply a MVCE of my current starter implementation.
4 replies
Eric Helgeson
@erichelgeson
I'm trying to get dev tools and intellij to work but nothing i do will make the app restart. it seems the "hacky" way of editing intellij to allow build while run/debug is gone - how do you develop with the latest spring-boot with devtools and intellij now?
12 replies
covid2021corona
@covid2021corona
Is it possible one call 1 Stored Proc twice in one single transaction which returns a result set ?Any idea how can i achieve it?
here is the scenario
https://stackoverflow.com/questions/69268627/excute-2-simplejdbccall-in-a-1-single-transaction