Skip to content
Advertisement

Tag: spring

Clarify a situation with a cleaning Spring Prototype-beans from memory

I would like to understand whether I should clean prototype-beans from memory manually by myself. In the Spring documentation you can see: “The client code must clean up prototype-scoped objects and release expensive resources that the prototype bean(s) are holding.” So from this it seems that you should clean prototype-beans by yourself. However. I’m using VisualVM memory profiler. I have

CORS interfering with Spring Security oauth2

I’m having problems trying to get a token from oauth/token from the browser. I have a Spring Boot application with Spring Security and Spring Security oauth, and I’m trying to authenticate from a javascript SPA in a different port. When CORS is disabled in the backend, I can get tokens from the oauth endpoints no problem, using either Postman or

Spring boot: how to match all routes?

I’m developing a simple web application on Spring boot 1.5.3 and I need all the routes to send static index.html file. Now, I have this: My application contains only static assets and REST API. But the problem is that the controller shown above only matches the first-level url like /index, /department etc. I want to match all url levels like

Change Spring boot folder structure for source code and resources

How can I change the path where spring boot is looking for the source code and resources. I want to move from src/main to src/server/main. In pom I put: Error: Could not find or load main class ema.Application Answer Here is a sample build section of a POM that can be used to configure the directories. Below Sample:

Spring Boot not recognizing application.properties file

I’m trying to configure a DynamoDb client with Spring Boot, and placed my endpoints and configuration information in my resources/application.properties file. However, Spring Boot does not seem to pick up these properties. It does pick up the “server.default” key that I have stored in the same file, so it is definitely recognizing the the file itself. Here is my application.properties

How to abstract away java.time.Clock for testing purposes in Spring

I have a question with regards to the question Time dependent unit tests Let’s say I build Spring application which contains service interface and its implementation If I want to change clock in test, I would have to “pollute” production code and interface with e.g. setClock method as follows: In test, I can invoke, e.g.: How can I abstract away

Advertisement