Posts by Cristiano Bombazar • 453 points
21 posts
-
0
votes2
answers2434
viewsA: Error while booting application with Spring Boot
The problem was because my main class, which contains Bootapplication, by my carelessness, was not in the root package of the project. Therefore, he could not read my configuration class posted…
-
2
votes1
answer93
viewsQ: Why does my synchronized method not work as expected?
I have a class called GerenciadorServerSocket: @Service public class GerenciadorServerSocket { private CopyOnWriteArrayList<Integer> portasUsadas = new CopyOnWriteArrayList<>(new…
-
0
votes2
answers261
viewsQ: Multithread and Data Competition + Spring
I am rewriting a software that serves as a communication bridge between two services. Communication is done via sockets. The environment has high data competition, especially a list of active…
-
1
votes2
answers417
viewsA: Count with null value return zero
If you use 9.4+ postgres, use the FILTER command (See doc here). Works for any aggregation function. See: select 0, a.seqpessoa, a.nomerazao, a.cidade, a.uf, a.bairro, a.fone, a.dtaultfat, a.datref,…
-
-1
votes1
answer41
viewsQ: Endpoint Rest with Jersey shows no expected result
I created a Javaee project directly in Intellij and added the Javaee 8 dependencies via Maven. The structure of the project is in this link. web xml.: <?xml version="1.0" encoding="UTF-8"?>…
-
0
votes1
answer1090
viewsQ: Access database that is outside the Docker environment
I created an Microservices environment, more precisely 5 services, where they are connected to each other and access the same database (Postgresql). After development, I started creating the Docker…
-
2
votes1
answer242
viewsA: Object Serialization Error with Spring Data and Spring Web
So the problem was in my repository. I have a class called ImovelRepository extending JpaRepository. In an earlier version, I used the method findOne passing the ID of the object I wanted to load.…
-
2
votes1
answer242
viewsQ: Object Serialization Error with Spring Data and Spring Web
I was creating a simple endpoint of an entity and ended up getting the following exception: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class…
-
3
votes0
answers120
viewsQ: Doubt with Loadbalance and Circuitbreaker in Microservices
I have a service structure as follows: server (Eureka), immovable (Eureka-client) and client (Eureka-client). The customer service makes a request for immovable service, using feign. I own the…
-
0
votes2
answers164
viewsA: PHP/Mysql Select products below a value in the table
So to get the values below 300 real, just do this: SELECT * FROM tabela WHERE valor < 300 AND outrasCondicoes...; To take with the highest value: SELECT max(valor) FROM tabela WHERE…
-
0
votes2
answers2434
viewsQ: Error while booting application with Spring Boot
I am creating an application using Spring Boot with JPA. When I go up the application, the following message is launched: Description: Cannot determine Embedded database driver class for database…
-
3
votes1
answer403
viewsQ: How to use Java 8 Stream in an Object[] list
Imagine the following scenario: A list of Object[]. Something like that: List<Object[]> lista = new ArrayList<>(); Object[] dados = new Object[3]; dados[0] = 1; dados[1] = 20; dados[1] =…
-
-2
votes3
answers181
viewsQ: Sum of a column is not giving the expected value
I have a fictitious table with two columns and some data in it, according to the image. When I run my SQL statement below, the result of the query is 22. Shouldn’t the result be only 12? I couldn’t…
-
1
votes0
answers126
viewsQ: Send objects larger than 5 Gb using Amazon S3 SDK
I’ve been using the Amazon S3 SDK for cloud server communications for a while, called Dreamhost or Dreamobjects. My application uses files for my Buckets. However, I started having problems because…
-
3
votes2
answers1662
viewsA: Apply filters to a Jtable
I would always advise to do the query directly in the database, for the simple fact that at any minute, the information on the screen may have been updated/deleted and even entered new records. But…
-
2
votes2
answers140
viewsA: Problem with IN condition in sub-select
Below, I only updated the outside of your SQL with two ways to do it. Anyway, which you choose, you copy and use also in the IN of the internal query. SELECT (SELECT COUNT(*) AS 'Colaboradores' FROM…
-
2
votes1
answer1930
viewsQ: Calculation of hours with Java 8
I was doing some tests with Java 8, and I was trying to calculate the difference between times of two dates. I did it in three ways, but I don’t know which one would be the right one and I’d like…
-
1
votes0
answers225
viewsQ: Jasper report does not update data
Good night, you guys, I’m having a bit of a frustrating problem. I have an employee report in the system that works fine. Brings the data all correctly. However, when I register a new employee and I…
-
4
votes1
answer423
viewsQ: Try/catch does not "catch" to Exception
I’m using JPA and was trying to create an Entitymanager, and was testing some expcetions treatments in a class of mine. However, I have a problem, that Exception is not being "caught" by catch.…
-
5
votes2
answers7594
viewsQ: Send objects via socket
I have a chat that exchanges messages (String) to each other. Everything is working correctly. However, now I want to start sending objects via Socket, like for example, a class that has some…
-
5
votes2
answers1540
viewsQ: Jtextarea receives the append but does not display the text
I’m having trouble using a Jtextarea. I need that every time something happens on my system, information is added in real time. However, he appears nothing. I’ve tried using the setText() and the…