Home » Tag Archives: Spring (page 7)

Tag Archives: Spring

Spring Boot with Scala

spring-interview-questions-answers

A while back I had tried out a small Spring Boot  based sample with Scala as the language and found that the combination works out quite nicely – no big surprises there actually as Scala programs ultimately run in the JVM. I have now updated the sample with the latest version of Spring Boot and some of the supporting libraries. ...

Read More »

Setting Up Distributed Infinispan Cache with Hibernate and Spring

jboss-hibernate-logo

A pretty typical setup – spring/hibernate application that requires a distributed cache. But it turns out not so trivial to setup. You obviously need cache. There are options to do that with EhCache, Hazelcast, Infinispan, memcached, Redis, AWS’s elasticache and some others. However, EhCache supports only replicated and not distributed cache, and Hazelcast does not yet work with the latest ...

Read More »

Retrying Method Execution using Spring AOP

spring-interview-questions-answers

One of my blog follower sends an email asking me to show an example of  “RealWorld Usage of Spring AOP”. He mentioned that in most of the examples the usage of Spring AOP is demonstrated for logging method entry/exit or Transaction management or Security checks. He wanted to know how Spring AOP is being used in “Real Project for Real Problems”. ...

Read More »

Creating Custom SpringBoot Starter for Twitter4j

spring-interview-questions-answers

SpringBoot provides lot of starter modules to get up and running quickly. SpringBoot’s auto-configure mechanism takes care of configuring SpringBeans on our behalf based on various criteria. In addition to the springboot starters that comes out-of-the-box provided by Core Spring Team, we can also create our own starter modules. In this post we will look into how to create a ...

Read More »

Insights from Stackoverflow: Most voted for Spring 4 questions

spring-interview-questions-answers

What are the most voted for Spring 4 question asked and answered on Stackoverflow? Here are the top five questions and answers. What’s the difference between @Component, @Controller, @Repository & @Service annotations in Spring, can they be used interchangeable or do they have specific functionality? Where does the @Transaction annotation belong? The DAO class, the service that calls the DAO ...

Read More »

Skip SSL certificate verification in Spring Rest Template

spring-interview-questions-answers

How to skip SSL certificate verification while using Spring Rest Template? Configure Rest Template so it uses Http Client to create requests. Note: If you are familiar with sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target the below should help you. Http Client Firstly, import HttpClient (>4.4), to your project compile('org.apache.httpcomponents:httpclient:4.5.1') Configure RestTemplate Configure SSLContext using Http Client’s ...

Read More »

Spring-managed Transactions Explained – Part 2 (JPA)

spring-interview-questions-answers

In the first part of the series, I showed how transactions work in plain-vanilla JDBC. And then I showed how Spring manages JDBC-based transactions. In this second part of the series, I’ll show how transactions work in plain-vanilla JPA first. And then show how Spring manages JPA-based transactions. Funds Transfer To help illustrate transactions, I’ll be using the same case ...

Read More »

One Thing Good Spring Developers Know

spring-interview-questions-answers

In my recent training sessions on the (core) Spring Framework, I was asked, “If there was one thing that a (Java) Spring developer should know, what should that be?” That question caught me off guard. Yes, the (core) Spring Framework does cover a lot of areas (e.g. beans, configuration, aspect-oriented programming, transactions). And it was difficult for me to point ...

Read More »

Advanced config with configuration meta-data in Spring Bootstrap

spring-interview-questions-answers

After a short introduction to configuration meta-data and covering the basics in my previous post called Pimp your config with configuration meta-data in Spring Boot, it is time to take a look at how to take this one step further and further customize the configuration. In this post, I plan to present deprecation of a configuration property and discuss various value ...

Read More »

Web service application with JAX-WS and Spring

spring-interview-questions-answers

1. Introduction It has been a long wait, but I am finally publishing a tutorial on creating the first SOAP based web service application with Spring. JAX-WS (Java API for XML Web Services) is a set of APIs for creating web services in XML format, which we also most commonly call as SOAP based web service, which hope we all are aware of ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns