The Spring Blog

Engineering
Releases
News and Events

Spring Data Geode 1.0.0.APACHE-GEODE-INCUBATING-M3 Released

I apologize to both the Spring and Apache Geode communities for the delay, relative to the Apache Geode M3 release announcement, but I am very excited and pleased to follow that with the release of Spring Data for Apache Geode 1.0.0-incubating.M3.

You can get the bits from Maven Central by including the following dependency in either your application Maven or Gradle build files …

Maven

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-geode</artifactId>
  <version>1.0.0.APACHE-GEODE-INCUBATING-M3</version>
</dependency>
Read more...

This Week in Spring - October 11, 2016

Welcome to another installment of This Week in Spring! It’s already almost mid October and I can’t believe we’re almost in 2017! Time is sure flying quickly!

Read more...

This Week in Spring - October 4th, 2016

Welcome to another installment of This Week in Spring! We’ve got a lot to look at so let’s get to it!

Read more...

This Week in Spring - September 27, 2016

Wow! It’s already almost October! This year has sure gone by quickly!

Welcome to another installment of This Week in Spring! This week I’m in the studio with Phil Webb recording the next installment of our Livelessons series on building Microservices with Spring Boot. It’s been a lot of fun so far and we’ve only just begun!

Tonight, I hope you’ll join me for Cloud Native Java on the vJUG’s worldwide and live event going on in timezones all around the world!

We’ve got so much to cover, so let’s get to it!

Read more...

New in Spring 5: Functional Web Framework

As mentioned yesterday in Juergen’s blog post, the second milestone of Spring Framework 5.0 introduced a new functional web framework. In this post, I will give more information about the framework.

Keep in mind the functional web framework is built on the same reactive foundation that we provided in M1 and on which we also support annotation-based (i.e. @Controller, @RequestMapping) request handling, see the M1 blog post for more on that.

Example

We start with some excerpts from our sample application. Below is a reactive repository that exposes Person objects. It is quite similar to a traditional, non-reactive repository, except that it returns Flux<Person> where you would return a List<Person> traditionally, and Mono<Person> where you would return a Person. Mono<Void> is used as a completion signal: to indicate when the save has been completed. For more information on these Reactor types, refer to Dave’s blog post.

Read more...

This Week in Spring - September 20, 2016

Hello world! Since we last talked, I’ve been in multiple cities in China, including Hangzhou, Shanghai, Beijing, Guangzhou, Shenzhen and Hong Kong, talking to customers and community members alike. It’s fascinating to see what our amazing customers in China do with our technologies in the hypercompetitive Chinese market. And, tasty!

Read more...

This Week in Spring - September 13, 2016

Welcome to another installment of This Week in Spring! It’s been an amazing week here in China, hanging out with Alibaba and Huawei, bringing the Spring. This week it’s off to Shanghai, Beijing, Guangzhou, Shenzhen and Hong Kong!

Our pal Pieter Humphrey has been busy this week getting the SpringOne Platform 2016 videos up and online for us to enjoy so there’s a lot of good stuff this week! Thanks Pieter!

Read more...

This Week in Spring - September 6th, 2016

Welcome to another installment of This Week in Spring! This week I’m in Shanghai, China and Hangzhou, China where I spoke at the ginormous Huawei Connect conference in Shanghai and where I’ll be working with Alibaba and Huawei for a week or so. I’ll also be speaking at the Hangzhou Java User Group, too.

(Can you believe we’re already in September?? Seriously blown away! 2017 is just around the corner!)

I’m also, technically, on vacation, so I’ll keep this post to a minimum! :)

Read more...

Spring Security OAuth2 - Client Authentication Issue

Issue #808 was recently reported that allowed a user to authenticate as a client and obtain an access token via the client_credentials or password grant flow.

This unique scenario occurs when a client and user have the same identifier (clientId and username). The user’s credentials are used for client authentication during a client_credentials or password grant flow and is successful in obtaining an access token with the authorities of the client.

The Fix

This bug has been fixed in 1ed986a and released in 2.0.11.RELEASE.

If you’re using Java-based configuration, please update to 2.0.11.RELEASE.

However, if you’re using XML-based configuration, please take the following actions:

  • Update to 2.0.11.RELEASE

  • Look at this JUnit test and it’s associated XML configuration to ensure the AuthenticationManager for client authentication and the AuthenticationManager for user authentication is setup the same in your configuration.

  • As a precautionary step, make sure your XML configuration is NOT setup the same as in this JUnit test and associated XML configuration as it demonstrates the original issue.

Read more...

Custom test slice with Spring Boot 1.4

Spring Boot 1.4 includes a major overhaul of testing support and one of these features is test slicing. I’d like to take the opportunity in this blog post to further explain what it is and how you can easily create your own slices.

Test slicing is about segmenting the ApplicationContext that is created for your test. Typically, if you want to test a controller using MockMvc, surely you don’t want to bother with the data layer. Instead you’d probably want to mock the service that your controller uses and validate that all the web-related interaction works as expected. This can be summarized in the example below:

Read more...