Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:40
    spring-issuemaster labeled #24298
  • 10:36
    ST-DDT opened #24298
  • 08:15
    andrey-bushik commented #22840
  • 07:29
    snicoll commented #24271
  • 07:26
    CubeOfCheese commented #24271
  • 06:49
    divyajnu08 commented #24225
  • 06:06
    snicoll milestoned #24297
  • 06:06
    snicoll labeled #24297
  • 06:06
    snicoll opened #24297
  • 06:06
    snicoll milestoned #24296
  • 06:06
    snicoll labeled #24296
  • 06:06
    snicoll opened #24296
  • 06:06
    snicoll milestoned #24295
  • 06:06
    snicoll labeled #24295
  • 06:06
    snicoll opened #24295
  • 06:05
    snicoll labeled #24294
  • 06:05
    snicoll milestoned #24294
  • 06:05
    snicoll opened #24294
  • 06:05
    snicoll labeled #24293
  • 06:05
    snicoll milestoned #24293
Konstantin Bläsi
@konstantinblaesi
https://github.com/spring-projects-experimental/spring-authorization-server seems to use servlets, any idea why it's not using webflux?
James Howe
@OrangeDog
IIRC it's easier to use servlet filters with webflux than vice-versa
And presumably it won't be particularly difficult to provide both kinds of filter when it's done
Stéphane Nicoll
@snicoll
@konstantinblaesi can you please move that question to #spring-security?
Konstantin Bläsi
@konstantinblaesi
@snicoll sure
zhiyazw
@zhiyazw

I am new to this community, maybe this is a beginner question but it puzzle me for days. When using spring-boot-web 2.4.0, I always got

Error:(4, 47) java: package org.springframework.web.bind.annotation does not exist

but I can see this package existing ( with IntelliJ IDEA library view )
When simple change to other spring boot version, say 1.5.9.RELEASE, everything happy.

5 replies
Mukhtar Suleimenov
@makekz
Hello everyone!
In @Async method services returns null list.
What am I doing wrong? )
public void run() throws ExecutionException, InterruptedException {
CompletableFuture<List<DocumentMapper>> mappers = asyncService.getListForRecognize();
logger.info("found mappers by ", mappers.get().size(),""+Thread.currentThread().getName());
}
Pavan K Jadda
@pavankjadda
CrossPost:
Hey All, I have an issue with Spring Boot 2.4.0 with Spring Cloud version 3.0.0-SNAPSHOT version. application.yml file properties are not being replaced
https://stackoverflow.com/questions/64994034/in-spring-boot-2-4-0-yaml-file-properties-are-not-being-replaced
1 reply
Mukhtar Suleimenov
@makekz
@OrangeDog thank you very much ) I did it )
choubani amir
@amirensit
hello.
I have a confusing question about integration test with the Spring framework.
The term "integration test" is it related when the Spring Context is up, or when we are not using anything related to mock ?
Using mockmvc with Spring context up is considered integration test or not ?
Any idea ?
2 replies
Vadim Bryksin
@Bryksin

Hi, have a weird issue with spring boot 2.3.6 and Java 11

java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
    at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31)
***

and

java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @47406941

Never had this issue before with Java 11, nothing was changed, everything is by default

David Good
@helloworldless
When researching how to customize Spring's RestTemplate, I came across the 4.15.1. RestTemplate Customization section of the official Spring Boot docs which says "make sure to configure your custom instance with a RestTemplateBuilderConfigurer". I searched for "RestTemplateBuilderConfigurer" but found nothing, so apparently this is something that I need to implement, but I'm not sure how. Can anyone help with this pls? I did raise a SO question with more details as well: https://stackoverflow.com/questions/64878306/resttemplate-customization-configure-your-custom-instance-with-a-resttemplatebu
5 replies
Volkan Yazıcı
@vy

Hello! In the following simple Spring WebMVC application, generated using start.spring.io minutes ago,

private static final String RESPONSE_PAYLOAD;
static {
    StringBuilder stringBuilder = new StringBuilder();
    for (int i = 0; i < 1_000_000; i++) {
        stringBuilder.append("foo bar baz ").append(i);
    }
    RESPONSE_PAYLOAD = stringBuilder.toString();
}

private static final class CustomError extends RuntimeException {}

@GetMapping("/collapse")
public String collapse() {
    throw new CustomError();
}

@ExceptionHandler(CustomError.class)
public String handleException() {
    return RESPONSE_PAYLOAD;
}

@GetMapping("/work")
public String work() {
    return RESPONSE_PAYLOAD;
}

Calling /work doesn't report any failures, whereas calling /collapse causes the following:

2020-11-25 16:26:47.813  WARN 281076 --- [nio-8080-exec-1] .m.m.a.ExceptionHandlerExceptionResolver : Failure in @ExceptionHandler com.vlkan.spring.MainApplication$MainController#handleException()
org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe

I was expecting this to be suppressed by Spring too, as was the case for /work. Is this discrepancy bug or my misunderstanding?

3 replies
Heiko Scherrer
@openwms

Hi community. I've upgraded to SpringBoot 2.4.0 and using the Spring Cloud Configserver from the latest SC SNAPSHOTS. I've already migrated the configuration files and have a profile that is activated to fetch the configuration from the remote config server. This works so far but the ConfigDataEnvironmentContributor for the service' application.yml is not active anymore and the application throws an error at startup.

spring:
  config:
    activate:
      on-profile: DISTRIBUTED
    import: configserver:http://localhost:8099
  cloud:
    config:
      discovery:
        enabled: true
      enabled: true
      fail-fast: true
    discovery:
      enabled: true

error:

Failed to bind properties under 'spring.cloud.config.discovery.enabled' to java.lang.Boolean:

    Property: spring.cloud.config.discovery.enabled
    Value: true
    Origin: class path resource [application.yml] - 157:18
    Reason: Inactive property source 'Config resource 'classpath:/application.yml' via location 'optional:classpath:/' (document #5)' imported from location 'class path resource [application.yml]' cannot contain property 'spring.cloud.config.discovery.enabled' [origin: class path resource [application.yml] - 157:18]

In addition to this I can't use the logic service name for the config server anymore, that is resolved by Eureka and must use configserver:http://localhost:8099 instead of configserver:${cfgscheme}://configserver:${cfgport} but this is another issue.

Any thoughts what I am missing or what is wrong with my config?

@snicoll Do you have an hint/idea?

Stéphane Nicoll
@snicoll
The Spring Cloud team should probably have more experience with migrating Spring Cloud to the new infrastructure. Please ask that on #spring-cloud.
Lukáš Vasek
@bilak
Hello, question reagarding readiness probe. Currently we are running some intensive tasks in our kubernetes pods, so for that we would like to somehow limit new incoming requests to pod when it's overloaded. For that, we would like to use tomcat's metrics (busyThreds/maxThreads) and prepare some probe for it.
My questions:
  • what interfaces do I need to implement to create custom probe. Is HealthContributor enough
  • is this probe called each time when I add it to endpoint.health.group.readiness.include ?
  • this is probably more related to kubernetes, but will ongoing requets survive when readiness changes from ready to not ready. I mean if there is ongoin requets and in between readiness state changes, will client receive the response or kubernetes also kills the requets?
2 replies
SUBJI
@subji

hello, i need help

sometimes stored attribute value in session set a null.

neither have i removed in session nor invalidated.

i want to know why attribute value in session is set to null or removed.

5 replies
Bhumika
@bhumikat
I have upgraded my project with spring boot 2.3.5 release. it was working before with chrome. I see after login, it started giving API call response which chrome does not supported. any idea? thanks
image.png
Petar Tahchiev
@ptahchiev
I think I found a bug in the LoggersEndpoint actuator
it used to work fine but now I've switched to 2.3.3 and when I call it I get all the classes in the system, not just the configured loggers
I am using Log4j2
Stéphane Nicoll
@snicoll
skis
@skis
Question: Are there any demerits to using GenericGroovyApplicationContext?
Petar Tahchiev
@ptahchiev
@snicoll So I have this in my log4j2.xml
    <Loggers>
        <Root level="info">
            <AppenderRef ref="CONSOLE"/>
        </Root>
        <Logger name="org.hibernate.SQL" level="warn"/>
        <Logger name="org.hibernate.orm.cache" level="warn"/>
        <Logger name="org.hibernate.cache.spi" level="warn"/>
        <Logger name="com.github.vfss3" level="warn"/>
        <Logger name="org.apache.solr" level="warn"/>
        <Logger name="org.springframework.batch" level="warn"/>
        <Logger name="org.springframework.scheduling" level="warn"/>
and before the endpoint was returning 7 loggers
now it returns 2600+
and as a result my javascript backend crashes...
how is this normal :Д
:D
Petar Tahchiev
@ptahchiev
would it be possible to provider /loggers/configured?
Stéphane Nicoll
@snicoll
It returns the number of loggers that are available in your app and that’s a harmonization with Logback. If you use Logback with a previous version, you’d also get all loggers. As for crashing your backend, I really can’t answer to that.
/loggers/configured would return the loggers of the configured group. If you create a group with than named and those 7 loggers you’ll get exactly that
Petar Tahchiev
@ptahchiev
i don't think log4j2 has notion of groups..
or perhaps I don't know it
can you point me in the right direction?
in fact the json returned from the actuator endpoint has some groups inside
"groups":{"web":{"configuredLevel":null,"members":["org.springframework.core.codec","org.springframework.http","org.springframework.web","org.springframework.boot.actuate.endpoint.web","org.springframework.boot.web.servlet.ServletContextInitializerBeans"]},"sql":{"configuredLevel":null,"members":["org.springframework.jdbc.core","org.hibernate.SQL","org.jooq.tools.LoggerListener"]}}}
web and sql - the funny thing is that I have not configured those
I have no idea where they come from
2 replies
Caleb Cushing
@xenoterracide
wow thymeleaf hasn't had a release in over 2 years, but appears to have recent commits, anyone know what's up with it?
also, is it a good templating system for non web?
looking for a templating system to generate sub-project/module/workspace/whatever you want to call them monorepo skeletons
4 replies
willladislaw
@willladislaw
Anyway strategies to update the production server with a git pull without stopping, build and restart?
Alessandro Vermeulen
@spockz
@willladislaw what do you mean with production server? Normally you would only ship the executable. For lack of load balancing and/or dynamic service discovery you can always bind to the http socket with SOCKET_REUSE and then the Linux kernel network stack will load balance for you.
willladislaw
@willladislaw
Yes, referring to the executable jar package...
I suppose no getting around a restart
Alessandro Vermeulen
@spockz
Yes you can get around a restart by starting a second instance with the socket reuse option. Anything trying to connect to it will be none the wiser. Of course, if you have dependencies like database schemas or something built in then you may indeed need to shutdown the old instance first to prevent corruption.
willladislaw
@willladislaw
Ah!
Longge
@qq61990988
hello