Here is my Logging class Here is the exception I have Here is the structure I have. I have my controller classes under this dir, why is there no match? I do appreciate your help a lot! Answer You have some basically language type error check this and the other within(@…) that you have You should use @ w…
Tag: spring
StackOverflowError while fetching OneToMany mapped entity in Spring Data Jpa
I have two entities that have bidirectional mapping. The entities are given below, I need to fetch all the customer entities along with its mapped accounts. My service code looks like this, But I am getting StackOverFlowError. The log is mentioned below, Can anyone help?? What am I missing here? UPDATE toStri…
Method annotated with @Bean is called directly – function calling a bean in a @Service class
I just get an error over and over inside the function “save” that is saying: “Method annotated with @Bean is called directly. Use dependency injection instead.” when calling “passwordEncoder()” in this line user.setPassword(passwordEncoder().encode(user.getPassword())); Wha…
Exception with JPA Query Spring
I want to get List of my objects by jpa query I’m using this code: But I get the exception: What is the problem there? Answer There are some missing spaces at the end of string literals. For example after concat the result is like “…from VzClass vzjoin vz.PHClass…”. It should loo…
Loading XML into DOmSource is adding xmlns=”” to all bean tags
I am trying to programmatically edit an XML file by loading it into a Document object and manipulating it there. This portion on the program works however if I load the XML into either an InputStream or write it back to a file, all the bean tags have xmlns=”” attribute added to them. So if before …
How can I create http inbound channel adapter with JAVA config in Spring integration?
I have the following http inbound channel adapter. How can I do this configuration with Java Config or Spring DSL? Answer See Spring Integration Reference Manual: Java DSL at all: https://docs.spring.io/spring-integration/docs/current/reference/html/dsl.html#java-dsl HTTP Module specifics: https://docs.spring…
Should I specify key-type and value-type when using ECache in Spring Boot?
I’ve seen a lot of articles where those parameters where specified, like that: But what is the point of it? Everything seems to work even without them, moreover, if i specify these I have this exception Methods under test ( just call these 2 one by one ): Answer You should probably use two different cac…
Spring boot server receiving param with %20 instead of space
I have spring boot server with controller and one endpoint: And another spring boot application which is sending request with restTemplate.getForEntity info log with url prints this: Reference data URL http://some-name:8080/readProperty?channel=E&service_name=Some%20Value Problem is that when I call this …
Does @Transactional preserves the session open , if yes – why do I have 3 DB calls?
Here is my simple method – just returns DTOs I call it in @SpringBootTest with a @Transactional annotation. Does it perform all calls in a single session? I though it does, because of the @Transactional, but the problem is that I have 3 calls to DB. I thought that Hibernate First level cache makes sure …
How does Spring Security check @PreAuthorize and how does it call hasAuthority() method?
When I use Spring Security I found @PreAuthorize(“hasAuthority(‘authority_name’)”) How does Spring Security check @PreAuthorize and how does it call hasAuthority() method? Answer Spring Security (@PreAuthorize) use a SPEL (Spring Expression Language) expression that invoke an Object re…