Questions tagged as 'java'

2
answers

What are the ways to avoid infinite recursion without using the JsonIgnore annotation in SpringBoot

I have a @OneToMany relationship between Produto and TipoProduto where TipoProduto can have multiple Produto s and a Produto can only have TipoProduto . I would like to list all Produto s...
asked by 30.10.2017 / 00:33
1
answer

Error while changing table SQLITE - no such column

Include a new column in a table. I reinstalled the application and at the time of saving the data there is a message saying that there is no path picture column, in my case, in the clients table. I read some things about it and was advised to in...
asked by 26.01.2016 / 03:57
0
answers

JAVA Commons SimpleEmail

My code does not release any exception, but it does not send the email either, I've tried several possibilities, I think there may be some logic error: <form method="POST" action="sendEmail.do"> <legend st...
asked by 26.10.2017 / 03:24
0
answers

Write image format in the database

By registering the product data in my database it presents the error in getFileType at line 124 follows error Line 124 String extensao = nomeDoArquivo.substring(nomeDoArquivo.indexOf('.' + 1)); java.lang.StringIndexOutOfBoundsException: S...
asked by 26.10.2017 / 03:31
0
answers

When sending Java object from an android app to the database one of the attributes goes as null

Produto produto = new Produto(); produto.setNome(edtNome.getText().toString()); produto.setPreco(Double.parseDouble(edtPreco.getText().toString().replace(",", "."))); produto.setUnidMedida(txtUnidMedida.getText().toString()); I'm trying to se...
asked by 05.11.2017 / 07:11
1
answer

Optimize Java code

Well, I'm creating an alarm in android and I wanted to know if you inves to make a switch for each editText if it was a way to check all in one switch, I tried with a for and I was incremented, but without success, here this is my code, I hope y...
asked by 05.11.2017 / 00:21
1
answer

Servlet is giving 404 error

I am trying to create a post application, I started to study Java Web and every time I run the servlet in Apache 8, a 404 error page appears. My servlet package app.web4.servlets; import java.io.IOException; import java.util.ArrayList;...
asked by 25.10.2017 / 14:05
1
answer

Error trying to delete with DELETE method using web service rest in Java [duplicate]

I created a REST Web Service in Java. All operations are working less than DELETE which returns the following error: HTTPDELETEmethod:@DELETE@Path("excluir/{idpromocao}") public void excluir(@PathParam("idpromocao") int idpromocao){...
asked by 25.10.2017 / 04:40
4
answers

How to compare Strings in Java?

The == operator says that the Strings are different, and they store the same literal value, see example: public class TesteString { public static void main(String[] args) { String str1 = "teste"; String str2 = "Otes...
asked by 03.02.2014 / 16:19
3
answers

Error persisting data in JPA

I'm following algaworks exercises from the java-ee-7-with-jfs-primefaces-and-cdi-2a-edicao module. When registering post I get the following error: WARNING: #{cadastroLancamentoBean.salvar}: javax.persistence.PersistenceException: org.hiberna...
asked by 01.11.2017 / 10:40