Skip to content
Advertisement

Tag: spring-boot

Error creating bean with name ‘entityManagerFactory’ defined in class path resource (Invocation of init method failed)

When I try to run my spring-boot project with hibernate and MySql, I got following error. My application.properties In pom.xml I have following dependencies, and my Course model looks like below, I also referred previous questions(Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed) regarding this issue, But nothing helps. Full code

Spring Boot Error @Autowired RestTemplateBuilder with junit

Trying to @Autowired a RestTemplate in Spring Boot 2.1.4 using RestTemplateBuilder. When i run junit tests i get an error when trying to autowired RestTemplate. I saw here: How to autowire RestTemplate using annotations It seems that RestTemplateBuilder is better so i would like to use that. This is the configuration file : This is the test class: The error

Java interceptor not getting called

I have a Spring boot application and I am implementing and interceptor in order to log some data. The problem is that is not getting called, I have tried: And then I’ve applied to methods or classes and in both of them doesn’t work: Or Does someone knows what I am doing wrong? Thanks Answer If you are having a

java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl , when throwing BadRequestException

I have a handler class in my springbootapp that performs some validation on incoming REST requests and throws BadRequestException back to the controller class. But instead of controller catching the BadRequestException, it catches Exception and throws java.lang.ClassNotFoundException: org.glassfish.jersey.internal.RuntimeDelegateImpl I spend some time looking around for solution but dont seem to find any. Here is my validation code in handler Here

how to zipping multiple files and encode to base64?

I have made a few lines of code and worked for a while, the program I created is like this. When I compress the .zip format, an example.zip file will be formed in the directory. The next step the program runs the command to look for the .zip filename in the directory. If found it will be converted into base64

Avro – java.io.IOException: Not a data file

I am using https://github.com/allegro/json-avro-converter to convert my json message into an avro file. After calling the convertToAvro method I get a byte array: byte[] byteArrayJson. Then I am using the commons library from Apache: The file is created. When I try to reconvert it to json, using: I have created a Junit test and used convertToJson method (from the previous

Advertisement