• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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: 28347
97
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?
 
rubbery bacon. rubbery tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic