profile
viewpoint

spring-projects/greenhouse 1269

Reference web application for Spring technologies and social destination for Spring developers.

spring-projects/rest-shell 455

Command-line shell for interacting with Spring HATEOAS-compliant REST resources

spring-projects/eclipse-integration-gradle 303

Gradle Tooling for Eclipse

spring-projects/grails-data-mapping 151

Grails Data Mapping Project

spring-projects/gradle-plugins 134

Gradle plugins for use in building and publishing open-source Spring projects, e.g. Spring Framework, Spring Integration

spring-projects/html5expense 71

Expense reporting reference app demonstrating HTML5 and cross-platform mobile

spring-projects/flight627 47

prototype work towards cloud-based developer tooling

spring-projects/greenhouse-android 47

Greenhouse native Android client

spring-projects/eclipse-integration-commons 28

Common SpringSource components used to integrate tooling with Eclipse, like the SpringSource Dashboard, Eclipse Spring UAA, common framework components and workspace configurators

issue commentspring-projects/spring-boot

NoClassDefFoundError: org/apache/catalina/Lifecycle$SingleUse during shutdown

I ran into this error, specifically:

Exception in thread "SpringContextShutdownHook" java.lang.NoClassDefFoundError: org/apache/catalina/Lifecycle$SingleUse
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:269)
        at org.apache.catalina.startup.Tomcat.stop(Tomcat.java:469)
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stopTomcat(TomcatWebServer.java:269)
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.stop(TomcatWebServer.java:324)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.stopAndReleaseWebServer(ServletWebServerApplicationContext.java:306)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onClose(ServletWebServerApplicationContext.java:172)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1035)
        at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:948)

The problem turned out to be a premature call to URLClassLoader.close() on the classloader that loaded the application and all dependencies (including spring, tomcat, etc).

pawelantczak

comment created time in 5 minutes

startedspring-projects/spring-framework

started time in 10 minutes

startedspring-projects/spring-boot

started time in 10 minutes

PR opened spring-projects/spring-framework

Issue #24291 - Merge @Transactional annotations

My first PR with changes to spring-tx as discribed in the issue #24291 :)

Not sure how to unit test though. Would be great, if someone could help.

+62 -21

0 comment

1 changed file

pr created time in 40 minutes

startedspring-projects/spring-boot

started time in an hour

issue openedspring-projects/spring-batch

Preventing Multiple Batch Job Executions running at same time and limit to only 1

Have a Spring Batch application that is scheduled to run at a certain time of day. There are 2 container instances running the application but we want to limit the job run to one instance only at a given time. The tables show that some times multilple job execution entries are getting created for a single job instance entry in spring batch table. How can we prevent this? Spring Batch version used is 4.1.2

Have this snippet of code to prevent the second job from running. Does not work always.

private boolean isJobRunning(Job job) { Set<JobExecution> jobExecutions = jobExplorer.findRunningJobExecutions(job.getName()); LOGGER.info("Searching for Job {} and Total Running Jobs are {}", jobExecutions.size()); return !jobExecutions.isEmpty(); }

// run at 3am one time @Scheduled(cron = "1 am daily") public void runJob() { try { if (isJobRunning(myJob)) { LOGGER.info("#myJob Already Initiated, so Return"); return; } else { JobParametersBuilder jobParametersBuilder = new JobParametersBuilder(); jobParametersBuilder.addString("date", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm")));

    JobParameters jobParameters = jobParametersBuilder.toJobParameters();

    JobExecution execution = jobLauncher.run(myJob, jobParameters);
  }
} catch (Exception e) {

}

The Isolation Level for Job Create is Read_Uncommitted. The other levels result in more duplicate jobs running at same time.

What configuration are we missing here , which will ensure no 2 jobs will execute at same time.

created time in 2 hours

issue openedspring-projects/spring-security

Autoconfig bearer only clients OIDC

<!-- For Security Vulnerabilities, please use https://pivotal.io/security#reporting -->

Summary

I'm trying to connect Keycloak and Spring Boot with Webflux (Kotlin) and I'm trying to pass Keycloak token as Bearer in Authorization header. Spring Boot App is set as Bearer only client.

Actual Behavior

Redirects me to root URL of Keycloak server

Expected Behavior

It would be good if Spring Security could detect Authorization header nad try to verify it without redirection to root URL

Configuration

Before I only used

  security:
    oauth2:
      client:
        registration:
          x-users:
            client-id: xxx
            client-secret: xxx
        provider:
          x-users:
            authorization-uri: https://xxx/auth/
            token-uri: https://xxx/auth/realms/test/protocol/openid-connect/token
            user-info-uri: https://xxx/auth/realms/test/protocol/openid-connect/userinfo
            user-name-attribute: sub
            jwk-set-uri: https://xxx/auth/realms/test/protocol/openid-connect/certs
            issuer-uri: https://xxx/auth/realms/test

Version

5.2.1 Release

Sample

<!-- Providing a complete sample (i.e. link to a github repository) will give this issue higher priority than issues that do not have a complete sample -->

created time in 3 hours

startedspring-projects/spring-data-examples

started time in 3 hours

startedspring-projects/spring-security

started time in 4 hours

startedspring-projects/spring-boot

started time in 4 hours

issue openedspring-projects/spring-framework

Is there a way to cache http responses on redis with WebClient

Hi

I decided to migrate existing Spring Boot projects to webflux. The Spring Boot version I update to is 2.2.4.RELEASE.

I have many microservices. I was caching http responses using in memory cache, and redis cache. I found a workaround to cache incoming responses in the current state. However, I need to use redis cache in some projects. Up to now, I couldn't find any way to do this.

Is there anyone who use redis cache with webflux? Or do you have any recommendation to do this?

In addition, will there be support for using @Cacheable annotation with webflux. If not, I would ask you to take it into planning.

created time in 5 hours

fork mehatabsyed/spring-kafka

Provides Familiar Spring Abstractions for Apache Kafka

https://projects.spring.io/spring-kafka

fork in 5 hours

startedspring-projects/spring-boot

started time in 6 hours

pull request commentspring-projects/spring-framework

Fix typos in tests

This has been merged into master.

Thanks

chenqimiao

comment created time in 6 hours

push eventspring-projects/spring-framework

Qimiao Chen

commit sha f78c21e40b99707827e815efd06de7f92cfc5f70

Fix typos in tests Closes gh-24566

view details

push time in 6 hours

issue commentspring-projects/spring-boot

Running "format" in buildSrc isn't possible when there are errors

+1 - I'd also like to see this in the contributing guidelines, I was having the same issue as a first time contributor and also had to make changes in buildSrc for the PR I submitted.

dreis2211

comment created time in 6 hours

issue commentspring-projects/spring-framework

A wrong logical for ConvertersForPair#getConverter

If you feel that the boolean logic is incorrect, please provide a failing test case which demonstrates that the current implementation is flawed and that your proposed change fixes the flaw.

Thanks

bonaluo

comment created time in 6 hours

pull request commentspring-projects/spring-data-jpa

DATAJPA-617 - Avoid potential transaction roll backs during named query lookups.

Looks line obtain dedicated EM is not enough and need to create specific transaction for lookup method.

thomasdarimont

comment created time in 6 hours

startedspring-projects/spring-boot

started time in 6 hours

startedspring-projects/spring-framework

started time in 7 hours

startedspring-projects/spring-boot

started time in 7 hours

pull request commentspring-projects/spring-data-jpa

DATAJPA-617 - Avoid potential transaction roll backs during named query lookups.

Looks like problem is still there when using spring-data-jpa with JTA transaction manager like bitronix or atomikos. Transaction is marked as rollbackonly after lookup is failed.

thomasdarimont

comment created time in 7 hours

startedspring-projects/spring-retry

started time in 7 hours

startedspring-projects/spring-petclinic

started time in 7 hours

issue commentspring-projects/spring-hateoas

x-forwarded-proto broken in Spring Boot 2.1.1

For future readers, use-forward-headers has been deprecated in favour of forward-headers-strategy:

server.forward-headers-strategy=native

forward-headers-strategy defaults to none.

CalamarBicefalo

comment created time in 7 hours

startedspring-projects/spring-framework

started time in 7 hours

fork linbener/spring-data-book

Spring Data - The Definitive Guide - Modern Data Access for Enterprise Java Developers

fork in 7 hours

issue openedspring-projects/spring-batch

JobRepository persistence for Neo4j

Hello all, I've created a project: https://github.com/valb3r/springbatch-neo4j-adapter

This allows Spring-batch to persist its metadata directly in Neo4j. If there is an interest, I would like to contribute and possibly adapt it to your requirements if you have any.

created time in 8 hours

startedspring-projects/spring-framework

started time in 8 hours

startedspring-projects/sts4

started time in 8 hours

fork CodingSta/spring-petclinic

A sample Spring-based application

fork in 8 hours

startedspring-projects/spring-boot

started time in 9 hours

startedspring-projects/spring-framework

started time in 9 hours

startedspring-projects/spring-boot

started time in 9 hours

startedspring-projects/spring-boot

started time in 9 hours

startedspring-projects/spring-data-examples

started time in 9 hours

startedspring-projects/spring-framework

started time in 10 hours

startedspring-projects/spring-cloud

started time in 10 hours

startedspring-projects/spring-framework

started time in 10 hours

startedspring-projects/greenhouse

started time in 10 hours

startedspring-projects/spring-petclinic

started time in 10 hours

startedspring-projects/spring-framework

started time in 10 hours

issue openedspring-projects/spring-batch

SimpleJobBuilder does not accept List<Step>.

It would be convenient to overload SimpleJobBuilder#next(Step) with the new method: SimpleJobBuilder#next(List<Step>). This new overload will help increase readability for the Job.

For instance, code snipped described here will become:

@Bean
public Job job() {
    List<Step> steps = ...

    return jobs.get("job")
            .incrementer(new RunIdIncrementer())
            .start(startingStep())
            .next(steps)
            .build();
}

created time in 10 hours

startedspring-projects/spring-petclinic

started time in 11 hours

startedspring-projects/spring-boot

started time in 11 hours

startedspring-projects/spring-framework

started time in 12 hours

fork Andy0898/spring-petclinic

A sample Spring-based application

fork in 12 hours

fork nstdio/spring-batch

Spring Batch is a framework for writing offline and batch applications using Spring and Java

http://projects.spring.io/spring-batch/

fork in 12 hours

PR opened spring-projects/spring-data-mongodb

DATAMONGO-2479 - Add AfterConvertCallback and ReactiveAfterConvertCal…

…lback.

Currently, only BeforeConvertCallback and BeforeSaveCallback are supported (and their reactive counterparts). This PR adds support for 'after-convert' event using entity callbacks feature.

Please note that I changed ReactiveMongoTemplate.DocumentCallback interface making its only method reactive. It seems ok because it is only used inside reactive contexts (actually, it was only called when doing a map() on a Flux/Mono, so now it is used in concatMap()/flatMap()).

I've only implemented one callback type ('after-convert') for now because I'd like to get an opinion from project member(s) on this issue: am I on the right track, or maybe it should not be implemented at all. After all, the original authors only implemented 2 callbacks for some reason.

What do you think?

<!--

Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request. Make sure that:

-->

  • [ ] You have read the Spring Data contribution guidelines.
  • [ ] There is a ticket in the bug tracker for the project in our JIRA.
  • [ ] You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • [ ] You submit test cases (unit or integration tests) that back your changes.
  • [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
+769 -97

0 comment

9 changed files

pr created time in 12 hours

startedspring-projects/spring-framework

started time in 13 hours

fork ekffhd/spring-petclinic

A sample Spring-based application

fork in 13 hours

issue openedspring-projects/spring-framework

A wrong logical for ConvertersForPair#getConverter

<!-- !!! For Security Vulnerabilities, please go to https://pivotal.io/security !!! --> Affects: <5.2.3>

if (!(converter instanceof ConditionalGenericConverter) ||
        ((ConditionalGenericConverter) converter).matches(sourceType, targetType)) {
    return converter;
}

it should be

if ((converter instanceof ConditionalGenericConverter) &&
        ((ConditionalGenericConverter) converter).matches(sourceType, targetType)) {
    return converter;
}

<!-- Thanks for taking the time to create an issue. Please read the following:

  • Questions should be asked on Stack Overflow.
  • For bugs, specify affected versions and explain what you are trying to do.
  • For enhancements, provide context and describe the problem.

Issue or Pull Request? Create only one, not both. GitHub treats them as the same. If unsure, start with an issue, and if you submit a pull request later, the issue will be closed as superseded. -->

created time in 13 hours

issue openedspring-projects/spring-framework

RequestContextHolder.getRequestAttributes always return null in resttemplate interceptor.

I have a spring cloud application which have multiple spring boot micro services. I'm using resttemplate to call other services in someone, and for security reason I use an interceptor to pass through the Authorization header. The full source code can be found at Spring Cloud in Practice.

package net.jaggerwang.scip.common.api.interceptor;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.io.IOException;
import java.util.Collections;
import java.util.Set;

public class HeadersRelayInterceptor implements ClientHttpRequestInterceptor {
    private Set<String> headers;

    public HeadersRelayInterceptor(Set<String> headers) {
        this.headers = headers;
    }

    @Override
    public ClientHttpResponse intercept(HttpRequest request, byte[] body,
                                        ClientHttpRequestExecution execution) throws IOException {
        var requestAttrs = RequestContextHolder.getRequestAttributes();
        if (requestAttrs instanceof ServletRequestAttributes) {
            var upstreamRequest = ((ServletRequestAttributes) requestAttrs).getRequest();
            for (var header: headers) {
                request.getHeaders().addAll(header,
                        Collections.list(upstreamRequest.getHeaders(header)));
            }
        }
        return execution.execute(request, body);
    }
}

But the requestAttrs above is always null, and I see the request executed by resttemplate is not in the main thread. Does this is the reason and how can I solve this problem.

Spring Boot: 2.2.2 Spring Cloud: Hoxton.SR1

<?xml version="1.0" ?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.jaggerwang</groupId>
        <artifactId>spring-cloud-in-practice</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <groupId>net.jaggerwang</groupId>
    <artifactId>spring-cloud-in-practice-user</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>spring-cloud-in-practice-user</name>
    <description>Spring cloud in practice user</description>

    <dependencies>
        <dependency>
            <groupId>net.jaggerwang</groupId>
            <artifactId>spring-cloud-in-practice-common</artifactId>
            <version>${scip-common.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-resource-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-jose</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-discovery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-consul-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId>
        </dependency>

        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>${apt-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/generated-sources/java</outputDirectory>
                            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

created time in 13 hours

pull request commentspring-projects/spring-framework

Performance improvement on NamedParameterJdbcTemplate

@benelog thank you very much,Now I understand why use a ConcurrentHashMap and a LinkedHashMap

benelog

comment created time in 13 hours

startedspring-projects/spring-boot

started time in 13 hours

startedspring-projects/spring-framework

started time in 13 hours

issue openedspring-projects/spring-boot

Logback console appender incomplete thread name

The logback console appender configured in \org\springframework\boot\logging\logback\defaults.xml logs thread name up to 15 characters: [%15.15t] causing logged thread names to be incomplete. The file log pattern logs the full thread name: [%t].

Console log pattern should be production ready and expected to be used for log parsing, so it must contain whole information.

Example use case: Using spring boot inside a docker container, the console output will be used by docker logs command and parsed by some log extracting service (filebeat).

created time in 13 hours

startedspring-projects/spring-data-examples

started time in 13 hours

startedspring-projects/spring-boot

started time in 13 hours

startedspring-projects/spring-boot

started time in 15 hours

startedspring-projects/spring-boot

started time in 15 hours

startedspring-projects/spring-boot

started time in 15 hours

startedspring-projects/spring-security-oauth2-boot

started time in 15 hours

startedspring-projects/spring-data-book

started time in 17 hours

startedspring-projects/spring-framework

started time in 17 hours

startedspring-projects/spring-boot

started time in 17 hours

startedspring-projects/spring-boot

started time in 17 hours

startedspring-projects/spring-boot

started time in 18 hours

startedspring-projects/spring-cloud

started time in 19 hours

IssuesEvent

issue commentspring-projects/spring-boot-data-geode

Remove all uses of internal Apache Geode APIs

This has not been completely resolved yet!

jxblum

comment created time in 19 hours

more