Posts by Weslley Tavares • 978 points
44 posts
-
2
votes1
answer95
viewsA: JPA Error when inserting a product object that has reference to an existing object
Analyzing only the stacktrace posted, it is perceived that the problem lies in the mapping of the entity Compra, as shown in the following excerpt: Caused by: org.hibernate.AnnotationException: No…
-
0
votes1
answer1242
viewsA: java.lang.Nullpointerexception: Attempt to invoke virtual method 'java.lang.String java.lang.String.toString()' on a null Object Reference
You need to check if there is an object instance in your element response.body(), once you invoke a method, in case the toString(), that is not accessed in a static way. One solution would be to…
-
0
votes1
answer107
viewsA: Error trying to access JAVA WEB database
This error usually happens because your application server does not contain the driver library natively. Therefore, you should add it manually. If you are using Wildfly, you will need to make the…
-
2
votes2
answers65
viewsA: Nullpointerexception error on execution
Note that your array was only defined in the excerpt: public Cardapio() { this.menu = new Refeicao[6][7]; }// end contructor However, in addition, you still need to initialize the instances that…
-
0
votes1
answer296
viewsA: 403: Access is denied / Spring security
Spring Security uses the feature AccessDecisionManager for access control. This feature in turn implements the RoleVoter default of the framework itself. When using the default implementation (which…
-
1
votes1
answer146
viewsA: Mount recursive function for Treetable
Your problem is occurring due to the use of the parameter listaBancoPerguntas in his for. Note that every time you enter the call from the stretch: for (BancoPerguntas bdPergunta :…
-
0
votes1
answer346
viewsA: Join fetch multiple returning duplicate values JPA Criteria API
The simplest way to avoid repetition of entity-related information Empresa (since I don’t know your data model) would use the resource @JsonIgnoreProperties in class Empregado, including the…
-
0
votes1
answer142
viewsA: Tomcat Maven web project Rest application does not work netbeans
If you are not using the Tomee version (which supports the features of the JAX-RS package), you will need to add the following dependency to your project (assuming you are using Maven):…
-
0
votes1
answer112
viewsA: Selectevent autocomplete returns null object
Looking at the stacktrace of your problem it was possible to observe that the entity Aluno is referenced in the entity BancaDefesas. Since you have not included the classes referring to your…
-
0
votes1
answer45
viewsA: Error in code by classes
Your code problem is in the class constructor call Pill, since there is no constructor that meets what was called in the class Drawing. Since no constructor was defined with the parameters of the…
-
2
votes2
answers1584
viewsA: How to avoid infinite recursion without using the Jsonignore annotation in Springboot
Quite possibly your application has a design problem, as it is suffering from this circular reference problem (or circular dependency, as some call it). If this were the case to restructure the…
-
0
votes1
answer74
viewsA: Record method has no action and link of Dependent x Driver is not done
Looking at the HTML of the reported problem, I noticed that in the excerpt: <f:selectItems value="#{dependenteBean.motoristas}" var="motorista" itemLabel="#{motorista.nome}"…
-
1
votes1
answer303
viewsA: Error validating Java user, Spring
Maybe if you change the section @Repository public interface EntidadesAdministradoresRepository extends JpaRepository<Entidadesadministradores,Integer> { @Query(value="Select e from…
-
0
votes1
answer199
viewsA: XML SOAP -> WEBSERVICE REST
Yes it is possible to do it, but you will have to adapt the return of all endpoints that respond to a request via SOAP. There is a project that I took as a basis to guide me when I needed to do the…
-
0
votes1
answer181
viewsA: Send json to webservice and return status
Your problem is originated by the fact that you are sending a String for an attribute waiting for a BigDecimal, which in your case is valor. Where do you send: curl -i -H "Content-type:…
-
1
votes1
answer320
viewsA: Xmlhttprequest cannot load no Vue js
This type of error occurs due to CORS (Cross-origin Resource sharing). Browsers usually make a request is sent of type OPTIONS and the server will respond if the type of request you want to make (in…
-
0
votes1
answer13197
viewsA: How to resolve the following error: HTTP Status 500- Internal Server Error
Looking at your code, you can notice an error right in the variable String sql, where the value declared for the variable has no spaces between itself, thus removing the reserved words from SQL and…
-
3
votes2
answers590
viewsA: A person can have multiple phones. How to do this with vector and not with list?
Well, I made some adjustments to your code, but I tried to minimize the impact, just to facilitate your understanding of the changes and why you made them. Follow the adjusted code: Classe Pessoa…
-
0
votes1
answer67
viewsA: Push Notification Plugin for Phonegap
Well, in my projects using Phonegap, I’ve been using this one. Until then I had no problem with it. Active community in its development and improvement. []'s…
apache-cordovaanswered Weslley Tavares 978 -
4
votes2
answers7668
viewsA: What does the @Component annotation do?
According to the own definition of creators, it represents a component (bean) which is detected automatically when working with Annotations-based settings and searching for class paths. Other…
-
0
votes2
answers3170
viewsA: Is it possible to store an Arraylist in a Java database?
If you are working with JPA, I believe that the oracle documentation address the issue quite clearly. In the link above, it is exemplified in a very simple way how the annotation that makes the…
-
3
votes2
answers2013
viewsA: How to perform a SUM in Hibernate
Well, let’s first go to the possible cause of your problem. I believe your problem lies in the set of attributes you are receiving in your query. You need a class with a constructor defined to…
-
-1
votes1
answer522
viewsA: How to run a . jar using java jdbc on another machine
In the scenario you are reporting, the machine you want to run your jar must be on the same network as the machine containing the database. So, at the site you used the localhost in its connection…
-
7
votes3
answers394
viewsA: What does it mean to assign Math.Random() > 0.5 to a variable?
The Math.random() will generate a value between 0 and 0.999999 (tends to the limit of 1, but does not reach 1). Soon your code snippet: array[i] = Math.random() > 0.5; Is checking if the value…
-
4
votes2
answers327
viewsA: Why can this happen in a foreach?
foreach waits for a list of elements to be iterated. If the method to be invoked is signed to return a list, there is no breach of contract between the mechanisms involved. When you urge your class…
-
0
votes2
answers510
viewsA: Why does the main method receive parameters?
It will represent all command-line arguments when the program runs. Any interaction that occurs during the execution of your class’s main method will be performed through this array.
javaanswered Weslley Tavares 978 -
3
votes2
answers4626
viewsA: How to compare the content of two vectors?
I believe that with this adjustment, your score can be calculated effectively. Follows the solution: import java.util.Scanner; public class VetorTurma { public static void main(String[] args) { int…
-
1
votes1
answer392
viewsA: Error connecting with Firebird database
See if this material helps you find the "path of stones". In this example, a well-crafted authentication scheme is created. You don’t have to stick to the details the author deals with, just focus…
-
3
votes3
answers1794
viewsA: Java - Palindromic string inversion
Follows a small code I made according to the situation reported: public class Main { public static void main(String[] args) { String st = "socorram me subi no onibus em marrocos"; String stAux =…
-
7
votes2
answers3704
viewsA: How does the equals method work?
Well, come on. On the following point: What means this return of the equals method: Return (getConta() == ((Examples of match) obj). getConta()); It is checking whether the current instance of the…
-
1
votes2
answers1743
viewsA: Jdbctemplate - How to commit and rollback?
When you use Annotation @Transactional, you are saying that that component will take actions connecting to the database. Now on to the attributes that make up the Annotation, they will dictate the…
-
4
votes2
answers804
viewsA: How to use p:messages from Primefaces?
Have you tried using a p:message only for the component p:inputText? Would look like this: <h:form> <p:messages/> <p:panelGrid columns="2"> <f:facet name="header"> Cadastro…
-
0
votes2
answers1616
viewsA: Locating Object in a List
Take a look in this material about Comparator and Comparable, of Caelum. With it you can define the attribute id of your object as a parameter for comparison. I hope it will help the material (was…
-
1
votes1
answer688
viewsA: Navigation to pages in subfolders in JSF 2 does not work
I think it helps you public void seuMétodo() { ExternalContext externalContext = FacesContext.getCurrentInstance() .getExternalContext(); try {…
-
0
votes1
answer185
viewsA: Order By Hibernate in JSF
Well, right here in this piece of code: public List<Estabelecimento> ordenarPontos() { String jpql = "SELECT * FROM estabelecimentos ORDER BY pontos DESC"; return…
-
-1
votes1
answer75
viewsA: JSTL adding null option inside select element
This section does not point to the problem? Failed to Convert Property value of type java.lang.String to required type com.projecto.enums.Enumtypattribute A conversion is missing in this code, since…
-
1
votes3
answers2362
viewsA: How to Recover User Session
Well, in the stretch: HttpSession session = (HttpSession) req.getSession(); Usuario usuario = (Usuario) session.getAttribute("nomeDoSeuBean"); You are trying to get the managedBean, not the…
-
0
votes2
answers915
viewsA: datatable primeFaces shows the number of correct records but does not show the fields
On your datatable, where you have itemNotaFiscal.algumaCoisa replace with: tabelaItens.algumaCoisa, where the .algumaCoisa will be the attribute you want to reference. You should use the var that is…
-
3
votes1
answer119
viewsA: Translation of the word Portable referring to a programming language
One portable language if it is a language that supports several platforms. A possible translation, from this context, would be linguagem com suporte a várias plataformas.…
-
2
votes4
answers3583
viewsA: What is the best free and online tool as an alternative to Jira?
I have worked on some projects using the Trello. If you’re not looking for something as far-fetched as jira, it’s an option to consider. Another tool I was able to use was the Mantis, however, I…
project-managementanswered Weslley Tavares 978 -
2
votes2
answers226
viewsA: Is there a difference between using inline CSS or Ids for a lot of different elements?
Well, when using the option to create a CSS file, what prevents you from creating classes instead of setting directly to the component, through the ID? If your application changes (due to…
-
1
votes1
answer266
viewsA: Update graphicImage after fileupload
Well, I usually use a script for that. Follows: <script> var loadFile = function (event) { var output = document.getElementById('output'); output.src =…
-
1
votes2
answers95
viewsA: Hashmap type attribute appears as Object
A Typedquery would not be a possible solution for your case? Since you would create a class that would simulate the behavior of Hashmap.
-
2
votes0
answers163
viewsQ: Problem in jwplayer + Chrome combination
Hello, I am using jwplayer in a web application and am finding a problem with Chrome to execute the commands of the tool. The problem occurs when it is clicked on "play" for the second time. When…