I have a Spring Boot application using Thymeleaf, it works fine when using mvn spring-boot:run but when deploying it into the JAR file it gives me an error for all files that have th:replace statement for example templates/web/index in line: <div th:replace=”/web/includes/header :: header”></div> The exception when trying to run java -jar my-app.jar My project resources hierarchy My resources locations
Tag: spring-boot
After trying to test connection to h2 database or connect whitelabel error occurs
After running Spring boot project and going to localhost:8080/h2-console and after trying to connect to my database I get whitelabel error when i click any button on h2-console screen. I am using in memory database. I am trying to connect to database with classic username:sa and password:(blank) Even after clicking Save i get whitelabel error application properties: pom xml: configure
I can’t generate the gRPC stubs classes
I managed to generate the classes through the .proto file but they are in the build. I would like the classes to be generated within the main because when I am going to extend the stub, it is not being possible to implement the methods. Look: File .proto: The .proto file is inside the main folder. Does anyone know how
Spring Boot App does not recognize environment variables in application.yml file
there. I’m new to Java Spring Boot and I’m trying to set environment variables in application.yml. I’ve added dotenv maven dependency: I’ve set variables in the .env file: And in my application.yml: While running application I’m getting jdbc error: java.lang.RuntimeException: Driver org.postgresql.Driver claims to not accept jdbcUrl, ${SPRING_DATABASE_URL} I’ve tried some solutions like: or in application.yml: or or Am I
Message contains escape character in the message sent to MQ and cause exception when converting to JSON
I have a method: and my DTO’s toString(): I realise when the other application received the MQ message (using Spring Boot with JMS), the escape char appeared, causing errors. I tried to do replaceAll(“\\”, “”) but it couldnt find anything to replace. How can I get rid of the in the message sent to the MQ? Answer The
JPA duplicate entries on child when update parent several times
I am building the Rest API with Java, Spring Boot, Hibernate and JPA. I have 2 tables Users and Friends, where User will have an array of Friend. My client will send several update request on my User table. This the request the API will receive : If my client send this request, my API returns : This answer is
Getters and setters for List in Spring boot
I am creating my API in Spring Boot. I have that a product is composed of components: Here is my code: (Entity Layer) } My Question: In the controller class should I change the update method to be as follows, to have the following code, product.addProduct(myComponent) or should I have it as follows: product.setProductComponents((Component) myProduct.getProductComponents()): or is there a better
Spark UDF function fail on Standalone Spark
I have spring boot java application myapp.jar with something udf function. SparkConfuration.java ToIntegerUdf.java sparkJars contains path to myJar.jar. Application build with Maven. Spark library version is 3.02 and scala version is 2.12.10. When I running application on Spark Standalone 3.0.2 I have an error: In spark worker log I see, worker fetch myJar: 21/03/23 19:33:24 INFO Executor: Fetching spark://demo.phoenixit.ru:39597/jars/myJar.jar with
HTML5 video skips ranges after 32,768
I am exploring Http Range requests and video streaming with Java. I wanted to create a controller which streams a video to a tag. For some reason, after end range of 32768, the browser sends request for start of 100237312. Here are a slice of the logs from my console: My code: The client: I would appreciate if someone explains
IntelliJ could not initialize class org.jetbrains.jps.builders.JpsBuildBundle
I’m using IntelliJ for a Spring Boot application made with the Spring Boot Initializr. Added are two dependency’s: Spring Web and REST Repositories. Now that I try to build the main class, I get an error saying: Could not initialize class org.jetbrains.jps.builders.JpsBuildBundle The configuration is the one given by IntelliJ and I tried updating my JDK to version 16 but