Error: Maximum response size reached get method Json object along with file part (Spring boot rest api)

This is a Postman specific error and it is generated because there is a Max Response Size limit available in the settings. By default it is 50 MB. Which means, Postman will fail the request if the response size exceeds 50 MBs. Since, you are receiving JSON data along with file part or file base64 … Read more

Spring @Bean(name =”name”) vs @Bean @Qualifier(“name”)

Yes there is a difference: @Bean(“foo”) (or @Component(“foo”)) gives your bean the name “foo” in the Spring Context, whereas @Qualifier(“foo”) only adds information without changing the name of the bean. As the bean name is the bean’s unique identifier in the Context, you can only have 1 bean named “foo”, whereas you can have multiple … Read more

Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException

The error comes from JpaTransactionManager line 403: TransactionSynchronizationManager.bindResource(getDataSource(), conHolder); The error means that the transaction manager is trying to bind the datasource (not the entity manager) to the thread, but the datasource is already there and this is unexpected. Note that the transaction manager had not started yet to bind the Entity Manager to the … Read more

Spring @RequestBody and Enum value

I’ve found what I need. http://chrisjordan.ca/post/50865405944/custom-json-serialization-for-enums-using-jackson. It was 2 steps. Override the toString method of the Reos enum @Override public String toString() { return text; } Annotate with @JsonCreator the fromText method of the Reos enum. @JsonCreator public static Reos fromText(String text) And that’s all. I hope this could help others facing the same problem.

Spring boot 3 – Jakarta and Javax

The answer will really depend on which specific libraries you’re using and how they interact with each other, but generally speaking trying to mix Java EE and Jakarta EE them would be a bad idea. As an example, if you’re writing a Spring MVC application then you’ll be using the DispatcherServlet. In Spring Framework 6 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)