Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:12
    rgoers synchronize #32425
  • 20:44
    cdanger commented #32179
  • 17:29
    rgoers synchronize #32425
  • 16:50
    spring-projects-issues labeled #32495
  • 16:49
    juergenzimmermann opened #32495
  • 16:27
    blacelle commented #32494
  • 16:25
    spring-projects-issues unlabeled #32494
  • 16:25
    spring-projects-issues labeled #32494
  • 16:24
    blacelle commented #32494
  • 16:23
    blacelle commented #32494
  • 16:16
    bclozel labeled #32494
  • 16:15
    bclozel commented #32494
  • 16:12
    bclozel commented #32493
  • 10:10
    jimjaeger commented #32493
  • 09:49
    blacelle commented #32494
  • 09:26
    blacelle commented #32494
  • 09:26
    bclozel commented #32494
  • 09:25
    bclozel commented #32494
  • 09:24
    blacelle commented #32494
  • 09:20
    bclozel commented #32494
CH4:D
@chad_d_stud_twitter
are unit tests affected by 2.4.0? i have some tests here that aren't supposed to run in the "test" profile but they're being executed anyway and consequently, they would fail because i have not yet properly migrated its profile settings to 2.4.0. Prior to the upgrade these tests ran fine.
24 replies
Florent Biville
@fbiville_twitter
Hi everyone, is there a specific reason that the latest SNAPSHOT of Spring Boot starters do not point to the latest SNAPSHOT of their corresponding project?
I can see this with spring-data-neo4j (the 2.4.1-SNAPSHOT starter points to Spring Data Neo4j 6.0.1)
Should I raise an issue for this?
1 reply
DevZyra
@DevZyra
I'm wondering why my application works fine without @EnableJpaRepositories is it somehow default in spring boot apps ? Am I missing something?
1 reply
Michael Pratt
@michael-pratt

I'm trying to use the new publish flag in 2.4.0 to publish a Docker image to GitHub Container Registry. The image builds fine, but I get an error when it tries to publish:

[INFO] Successfully built image 'ghcr.io/michael-pratt/leaderboard-update:1.5.0'
[INFO]
[INFO]  > Pushing image 'ghcr.io/michael-pratt/leaderboard-update:1.5.0' 100%
...
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:build-image (default-cli) on project leaderboard-update: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.0:build-image failed: Error response received when pushing image: error parsing HTTP 405 response body: unexpected end of JSON input: "" -> [Help 1]

However, I can do docker push on the image manually and it works fine.

2 replies
CH4:D
@chad_d_stud_twitter
image.png
image.png
CH4:D
@chad_d_stud_twitter
first pic is spring boot 2.2.9. Second pic is spring boot 2.4.0.
Joseph Thelen
@joethe
Is it possible to.. eh... delay? The expansion of placeholders in @PropertySource annotations (e.g. @PropertySource("classpath:${thing}.properties")) (used with @ConfigurationProperties) until some arbitrary time after the application has started up? In my case, the value of ${thing} isn't populated in the environment until after the application is already running :(
4 replies
CH4:D
@chad_d_stud_twitter
this is just my guess but I think that's not what that part is intended for @joethe
1 reply
off the top of my head you'll probably need to do that programmatically.
Travis Tomsu
@ttomsu

Hi all - trying to update spring-cloud-gcp to use Boot 2.4 and Cloud 2020.0.0-M5. I'm seeing an issue where a configuration is not being loaded because @ConditionalOnClassis now false - this got me going down a rabbit hole to see that spring-boot-autoconfigure-processor isn't actually outputting any META-INF/spring-autoconfigure-metadata.properties file. This may be a red herring, so does anyone know if something in this area has changed?

For reference, here are where are annotation processers are declared: https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/master/spring-cloud-gcp-autoconfigure/pom.xml#L26-L36

The specific config that isn't loading is https://github.com/GoogleCloudPlatform/spring-cloud-gcp/blob/master/spring-cloud-gcp-autoconfigure/src/main/java/com/google/cloud/spring/autoconfigure/trace/StackdriverTraceAutoConfiguration.java#L80 with this output in the debug:

StackdriverTraceAutoConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'zipkin2.reporter.stackdriver.StackdriverSender' (OnClassCondition)

I see the JAR listed on the classpath and that class is contained in that JAR, so I'm not sure why it's not matching

1 reply
Travis Tomsu
@ttomsu
@snicoll - I saw a few issues you've filed around the autoconfig-processor. Is that plugin required to get custom AutoConfig working, just to speed up startup times, or something else entirely?
Andy Wilkinson
@wilkinsona
The plugin produces metadata that optimises startup. Its use isn't required and should make no functional difference.
Travis Tomsu
@ttomsu
That's good to know, too
Andy Wilkinson
@wilkinsona
Could the Stackdriver jar be corrupted?
Travis Tomsu
@ttomsu
Doubt it - it's readable:
$ lesspipe /home/ttomsu/.m2/repository/io/zipkin/gcp/zipkin-sender-stackdriver/0.17.0/zipkin-sender-stackdriver-0.17.0.jar
Archive:  /home/ttomsu/.m2/repository/io/zipkin/gcp/zipkin-sender-stackdriver/0.17.0/zipkin-sender-stackdriver-0.17.0.jar
 Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
--------  ------  ------- ---- ---------- ----- --------  ----
      81  Defl:N       80   1% 2020-05-19 00:55 ba1d086a  META-INF/MANIFEST.MF
       0  Stored        0   0% 2020-05-19 00:55 00000000  META-INF/
       0  Stored        0   0% 2020-05-19 00:52 00000000  zipkin2/
       0  Stored        0   0% 2020-05-19 00:52 00000000  zipkin2/reporter/
       0  Stored        0   0% 2020-05-19 00:52 00000000  zipkin2/reporter/stackdriver/
       0  Stored        0   0% 2020-05-19 00:52 00000000  zipkin2/reporter/stackdriver/internal/
       0  Stored        0   0% 2020-05-19 00:55 00000000  META-INF/maven/
       0  Stored        0   0% 2020-05-19 00:55 00000000  META-INF/maven/io.zipkin.gcp/
       0  Stored        0   0% 2020-05-19 00:55 00000000  META-INF/maven/io.zipkin.gcp/zipkin-sender-stackdriver/
    1727  Defl:N      712  59% 2020-05-19 00:55 3fc6a806  zipkin2/reporter/stackdriver/StackdriverSender$EmptyToVoid.class
    2092  Defl:N      990  53% 2020-05-19 00:55 48e39ac0  zipkin2/reporter/stackdriver/internal/CallbackToUnaryClientCallListener.class
    3528  Defl:N     1520  57% 2020-05-19 00:55 e3221fbd  zipkin2/reporter/stackdriver/internal/UnaryClientCall.class
    3579  Defl:N     1813  49% 2020-05-19 00:55 194dea32  zipkin2/reporter/stackdriver/internal/AwaitableUnaryClientCallListener.class
    2134  Defl:N      892  58% 2020-05-19 00:55 90e2b411  zipkin2/reporter/stackdriver/StackdriverSender$BatchWriteSpansCall.class
    8332  Defl:N     3637  56% 2020-05-19 00:55 834e3277  zipkin2/reporter/stackdriver/StackdriverSender.class
    3149  Defl:N     1455  54% 2020-05-19 00:55 90196472  zipkin2/reporter/stackdriver/StackdriverEncoder$1.class
     257  Defl:N      169  34% 2020-05-19 00:55 dd67ea3f  zipkin2/reporter/stackdriver/StackdriverSender$1.class
    1461  Defl:N      629  57% 2020-05-19 00:55 e5d88df6  zipkin2/reporter/stackdriver/StackdriverEncoder.class
    1003  Defl:N      460  54% 2020-05-19 00:55 fe07c405  zipkin2/reporter/stackdriver/StackdriverSender$EmptyToVoid$1.class
    1882  Defl:N      852  55% 2020-05-19 00:55 b4ae4c4d  zipkin2/reporter/stackdriver/StackdriverSender$Builder.class
    3614  Defl:N     1024  72% 2020-05-19 00:51 652fe8b3  META-INF/maven/io.zipkin.gcp/zipkin-sender-stackdriver/pom.xml
      74  Defl:N       70   5% 2020-05-19 00:52 cab5d8ba  META-INF/maven/io.zipkin.gcp/zipkin-sender-stackdriver/pom.properties
--------          -------  ---                            -------
   32913            14303  57%                            22 files
Andy Wilkinson
@wilkinsona
Strange. Nothing else is coming to mind. If you can share a project that reproduces the behaviour you're seeing, we can dig in a bit more.
Travis Tomsu
@ttomsu
Roger that - standby
Ghost
@ghost~5920720dd73408ce4f60fc52
Hello, I'm interested in contributing to the spring framework as a volunteer... I have the code checked out and looking for pointers on how do I get started on the source code. Is there any getting started document or someone I may reach out to?
molexx
@molexx
Is there a way to have a @Component add an environment property that is picked up by the components created after it?
Travis Tomsu
@ttomsu

@wilkinsona - Here's a simple sample demonstrating the missing ConditionalOnClass - https://github.com/ttomsu/trace-service-one

Run the server with ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-Ddebug" | less +F and you can see in the debug output that StackdriverTraceAutoConfiguration does not match because of a missing zipkin2.reporter.stackdriver.StackdriverSender

However, you can see with ./mvnw dependency:tree -Dincludes=io.zipkin.gcp that it's there:

[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) @ demo ---
[INFO] com.example:demo:jar:0.0.1-SNAPSHOT
[INFO] \- com.google.cloud:spring-cloud-gcp-starter-trace:jar:2.0.0-RC1:compile
[INFO]    +- io.zipkin.gcp:zipkin-sender-stackdriver:jar:0.17.0:compile
[INFO]    |  \- io.zipkin.gcp:zipkin-translation-stackdriver:jar:0.17.0:compile
[INFO]    \- io.zipkin.gcp:brave-propagation-stackdriver:jar:0.17.0:compile
5 replies
HaloFour
@HaloFour
oof, just got bit by a change to WebClient where ClientResponse.mutate will release the original body if you replace it the body. In my case I was taking the existing body, transforming it and then setting it to the body of the mutated response. I see the new helper method for transforming the body and have migrated to it, but that was tricky to triage.
Daniel Zou
@dzou
In Spring Boot 2.4.0 - there is introduced the new Config Data loading concept (via. ConfigDataLoader & ConfigDataLocationResolver). There is this object called ConfigDataLocationResolverContext that gets passed around these objects. Is there a way for library integrators to prepopulate the bootstrap context that gets returned by ConfigurableBootstrapContext getBootstrapContext() in the interface? We used to be able to do this with registering a org.springframework.cloud.bootstrap.BootstrapConfiguration in spring.factories but does this not work anymore?
3 replies
Fizii Q
@qfizii_gitlab
spring question: if I am already using jcl-over-slf4j, should that be removed in favor of spring-jcl?
CH4:D
@chad_d_stud_twitter
@wilkinsona I got the unit tests working (ish) I'm not sure if this is a bug or intended but I moved application-test.properties to src/main/resources. Previously it was supposed to be in src/test/resources.
Then I added this in application.properties:
# Test
#---
spring.config.activate.on-profile=test
spring.config.import=classpath:application-test.properties
CH4:D
@chad_d_stud_twitter

Am I doing this wrong? I have the following configuration:

# Dev
#---
spring.config.activate.on-profile=test | local | dev 
my.key=value

# Test
#---
spring.config.activate.on-profile=test
spring.config.import=classpath:application-test.properties

But I get this error:

Property: my.key
Value: null
Reason: must not be null

However, if I put my.key inside application-test.properties my.key is set.

CH4:D
@chad_d_stud_twitter
Okay, the parser is a little touchy. Apparently I can't have adjacent comments around #---
ひとき
@Afellay0624_twitter

The version has been upgraded from SpringBoot 2.3.4 to 2.4.
I get a build error
What should i do?
Lend me your wisdom

Project build error: Non-parseable POM C: \ project \ jcom-cca \ sts-bundle \ workspace \ release \ maven \ org \ springframework \ boot \ spring-boot-dependencies \ 2.4.0 \ spring-boot-dependencies -2.4.0.pom: end tag not allowed in epilog but got / (position: END_TAG seen ... </ build> \ n </ project> \ n </ ... @ 2869: 9)

2 replies
a
Mario
@mmaryo

Hello I need help
I create a Spring boot with sub modules with Gradle (kt) and Kotlin
When I run java -jar I have this error

aucun attribut manifest principal dans app.jar
In english :
no manifest attribut in app.jar
Do you know what does it mean

4 replies
theJCrakcer
@theJCrakcer
hello all, is it possible to call another repository in the repository ? example : repoA and inside repoA i call repoB using Autowired
3 replies
James Howe
@OrangeDog
It would be better to create a service which injects both of them
Mirko Manojlovic
@MirkoManojlovic
Hi guys, I've been looking everywhere but I can't find the answer so if anybody knows something it would be largely appreciated. I am using spring-data-redis and I have a simple sorted set that I want to use. So for example if I have a set that contains score 10 value 1, if insert another entry score 11 value 1, I don't want it to be overridden or in other words I want to use NX option from here https://redis.io/commands/zadd. How can I do that using StringRedisTemplate? In docs it says that default is to update the value https://docs.spring.io/spring-data/redis/docs/current/api/org/springframework/data/redis/connection/RedisZSetCommands.html#zAdd-byte:A-double-byte:A-
Similar question was asked here: https://stackoverflow.com/questions/63609715/spring-data-redis-zadd-command-missed-nxxxincr-options
3 replies
nightswimmings
@nightswimmings
Hi mates! After reading latest changes on Boot 2.4, this article left me wondering: https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4. Since Spring already provides the amazing spring-cloud-config (bootstrap.yml), how do all of this changes fit in here? I mean aren't ConfigMaps already supported in a nice way?
4 replies
If they are 2 unrelated ways, which one is preferred? Looks to me like the fanciness of cloud solutions is unmatchable
Rod McCutcheon
@rodmccutcheon

Hi all, I've got an interesting issue running a Junit 5 test suite with Spring Boot 2.3.6. If I run the offending test case separately it works fine, but if run the full test suite it gets stuck on:

2020-11-20 13:47:50.975 INFO 96182 --- [nTaskExecutor-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2020-11-20 13:47:51.065 INFO 96182 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 2020-11-20 13:47:51.072 INFO 96182 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'

public class TaskSchedulerConfig {

    @Value("${taskScheduler.poolSize}")
    private int taskSchedulerPoolSize;

    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(taskSchedulerPoolSize);
        scheduler.initialize();
        scheduler.setWaitForTasksToCompleteOnShutdown(false);
        return scheduler;
    }

}

Is there some manual shutdown I need to do between tests?

6 replies
Subham Ashish
@SubhamAshish
hey all
what could be the plugin for jaxb in gradle similar to what maven gives
<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
                    <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                    <clearOutputDir>false</clearOutputDir>
                </configuration>
            </plugin>
@wilkinsona
can anybody help on this?
Andy Wilkinson
@wilkinsona
There's no need to mention me or anyone else directly. The community will try and help as and when they can. Have you tried search Gradle's Plugin Portal for xjc? It returns several options which sound like they may do what you want: https://plugins.gradle.org/search?term=xjc
Subham Ashish
@SubhamAshish

hey thanks for responding, I tried all this and end up an exception

org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method jaxb()

that's the reason thought to ask in this community

Lukáš Vasek
@bilak
Hello, in tomcat are parameters like maxThreads, acceptCount, maxConnections. I'd like to return 503 with retry-after header when for example maxThreads and acceptCount are at maximum. Is there any option how to retrieve this statistics? Or better is there some support for returning error when maximum values of this parameters are reached?
Derek Marley
@dwmarley_twitter
Hello - can someone point me in the right direction to better understand how to set the memory settings in spring boot 2.3 when it generates the docker container -- or would I override the values when deploying to K8s, as right now it logs that it is selecting 1GIG for memory (any help would be welcomed)
1 reply
Vadim Bryksin
@Bryksin

Hi
just started new spring boot service with cloud config
and noticed that spring.profiles now deprecated, and it suggests to use: spring.config.activate.on-profile: dev

However setting: spring.profiles.active: dev has no effect, now boot spring says:

INFO 9830 --- [main] s.StudentOptionsSolverServiceApplication : No active profile set, falling back to default profiles: default

Where can I see any info regarding profiles changes in latest spring boot?
And how to set profile now?

acerdas84
@acerdas84
@bilak I think this post might help you https://netflixtechblog.com/tuning-tomcat-for-a-high-throughput-fail-fast-system-e4d7b2fc163f . Also maxThreads will be reached way before than acceptCount, to check on metrics for use you can use spring boot actuators (not sure if they will work for what you are looking for) maybe that is a path
1 reply
Vadim Bryksin
@Bryksin

ok, seems I found. docs related to changes in Spring Boot 2.4.0
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-Config-Data-Migration-Guide

it says:

You can still use the 'spring.profiles.active' property to activate specific profiles, however, you won’t be able to use this property in combination with 'spring.config.activate.on-profile'

but what should I use to activate profile then with spring.config.activate.on-profile ???

Phil Webb
@philwebb
@Bryksin I think I need to update the docs because you're not the first person to comment that things are confusing. What we're trying to do is remove the complexity when profile specific properties try activate further profiles. If you're able to share a small sample that shows what you're trying I can take a look. Be aware that there isn't yet a GA release of Spring Cloud that works with Boot 2.4.
Phil Webb
@philwebb
@Bryksin I see you've commented in issue https://github.com/spring-projects/spring-boot/issues/24167#issuecomment-731335173. We can continue the discussion there.
James Carman
@jwcarman
Has something changed recently (in 2.3.x and 2.4.x maybe) with respect to Hibernate's HBM2DDL and setting that to validate?