Posts by leandro.dev • 192 points
21 posts
-
1
votes1
answer23
viewsA: Spring boot application.properties problem
Make sure the dependency of driver connection with the bank is in your project. In your case it would be the driver for the SQLServer. If you’re a Maven, see if you have: <dependency>…
-
0
votes1
answer20
viewsA: error: non-static variable this cannot be referenced from a Static context / Java 8
Quick fix Key missing to close Main class. public class Main { public static void main(String[] args) throws IOException { InterfaceTexto i = new InterfaceTexto(); i.executar(); } // aqui } class…
-
-1
votes1
answer28
viewsA: Exclusion of related tables
I played your code and had no problem. I did the mapping as you did above. User: @Entity @Data public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long userId;…
-
-1
votes2
answers19
viewsA: Intellij - Java Error - Gradle Sync failed: Cannot Convert relative path ~/GRADLE_HOME/daemon/6.8 to an Absolute file
Intellij is unable to transform the directory set with ~ from the Gradle path to a disk directory. On the MAC: Intellij --> Preferences On Windows/Linux: File --> Settings Then, independent of…
-
0
votes1
answer57
viewsA: "Nullpointerexception" error is null
Declare a list with no elements (empty) instead of just declaring the list, in the case of Data. Like you did: private List<DadosProfessor> dadosProf; How can it be done: private…
-
0
votes1
answer32
viewsA: Deploy Heroku Error - Java
In some cases, the problem is that the diretório git is an external directory and the project folder (with code itself and containing the pom.xml) is inside that same directory git "root". Example:…
-
-2
votes1
answer82
viewsA: application springboot does not connect with mysql in the Docker environment
No depends_on api_commerce, put like this: depends_on: mysql_server: condition: service_healthy In mysql_server, put: healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] timeout: 20s…
-
0
votes1
answer27
viewsA: Get a list of objects with custom message (Spring Boot)
Quick and "unusual solution" You can define which fields will appear on the return of the list with json, and you can even generate new fields. For this, use @JsonProperty that will return a new…
-
0
votes1
answer41
viewsA: HTML in Spring Boot does not find files
Some steps should be followed to have Thymeleaf in a spring boot project. Dependencies <dependency> <groupId>org.springframework.boot</groupId>…
-
0
votes1
answer30
viewsA: Persist entity history (objects) using Mongodb
Mongodb as a choice How to build a model for History that communicates with the product model? The idea of MongoDB is good, in my view. The communication from one bank to the other would be…
-
0
votes1
answer199
viewsA: Error Creating bean with name 'transactionController'
In the TransactionRepoCustom, delete the method: void deleteTransactionId(String id); Like TransactionRepoCustom is the daughter of JpaRepository, she inherits deleteById(id). So, when you need to…
-
0
votes1
answer39
viewsA: How to load an external . jar in Java 11
Try to run as follows using the getSystemClassLoader: public static void addClassPathURL(File jar) throws Exception { ClassLoader classLoader = ClassLoader.getSystemClassLoader(); try { Method…
-
1
votes1
answer76
viewsA: Error: Unable to access jarfile
Access a terminal project folder and run mvn package to generate the jar. The jar will be generated inside the folder target. This mvn command is from Maven.
-
0
votes2
answers39
viewsA: How to solve Sonarqube’s criticism: Read of unwritten field Connector
Has a code smell in: mensagem = connector.findServicoReturnList(args, "lms.radar.usuarioFacade.findRecursosMensagem"); return mensagem; Only return direct without assigning to the message variable.…
-
-5
votes2
answers97
viewsA: My calculator from the while in position 2, skips the insertion of the first value someone can help me?
The code is long, so pouco legível, what is normal when we are doing the work having little experience. It is part of learning. My suggestion even to make it easier to find any possible error, is…
javaanswered leandro.dev 192 -
0
votes1
answer41
viewsA: Problem when making a POST request
If the mistake is 401 it has to do with your header. Mount the request header (headers) this way: String accessToken = "Bearer " + getToken(); MultiValueMap<String, String> headers = new…
-
0
votes2
answers361
viewsA: Maven POM.xml file starting with Eclipse error
Try the following, based on documentation. In POM.xml inside properties, add: <maven.compiler.source>1.8</maven.compiler.source>…
-
-1
votes1
answer115
viewsA: Hikari timeout oracle springboot
From what I noticed your bank is oracle. When this problem is generated, it is related to maxTimeLife and database wait_timeout. The generated WARN is because maxTimeLife is high (you said yourself…
-
0
votes1
answer16
viewsA: Fetch.Azy keeps loading the attribute what can it be?
I performed a test with your mapping, and did not generate the reported problem. Departmental class: @Entity @Data public class Departamento { @Id @GeneratedValue(strategy = GenerationType.IDENTITY)…
-
1
votes1
answer638
viewsA: Problems with Springboot - o.s.boot.Springapplication : Application run failed
Usually, when errors occur like this, try to check the caused by described in the log. We see the following in your mistake: Caused by: java.lang.Classcastexception: class…
-
1
votes2
answers37
viewsA: How to run a . sql file containing a Procedure (oracle) in Java
First of all, is the trial tape in the bank? Because normally a precedent is a procedure that gets we say "stored in the bank" and you call for it to be executed. Or do you want to create Procedure…