Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

My query is null

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My query is not executed. The result is NULL, but the log GlassFish, it is mounted and if I run on direct Postgresql she returns the list. But in the app it comes null. Below my query.
 
Sheriff
Posts: 26966
84
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can you test the query when you don't know what it is???

This is not a query:

It's Java code which generates a query based on some unknown data. You can't test it unless you know what "login.getPessoa().getIdPessoa()" returns.
 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The query result is:


This login.getPessoa().getIdPessoa() returns idpessoa wich case it is 1.

if I make , I have the same result.
 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the glassfish log.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that the stack trace tells you exactly where the problem happens. In this case, it is in line 43 of ListaEscola.java, in the method br.com.mosaicodigital.modelo.ListaEscola.findAll (which is called from line 37 of MostraEscolaAtiva.java).

Go to that place in your source code and try to see what is null there that should not be null. When you call a (non-static) method on a variable that is null, or when you try to access a member variable on a variable that is null, you will get a NullPointerException.
 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

My FactorySingleton

The qury work on postgresql. It returns 2 records. The query from glassfish work too. But in app do not work. The return is null.
 
Alan Duke
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is error:


I don't know resolve. How can I get a logged user?
 
reply
    Bookmark Topic Watch Topic
  • New Topic