aspose file tools*
The moose likes Java in General and the fly likes My query is null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "My query is null" Watch "My query is null" New topic
Author

My query is null

Alan Duke
Greenhorn

Joined: Apr 12, 2011
Posts: 26
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.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18127
    
    8

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

Joined: Apr 12, 2011
Posts: 26
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

Joined: Apr 12, 2011
Posts: 26
This is the glassfish log.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Alan Duke
Greenhorn

Joined: Apr 12, 2011
Posts: 26

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

Joined: Apr 12, 2011
Posts: 26
This is error:


I don't know resolve. How can I get a logged user?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: My query is null
 
Similar Threads
Do not carry my list on page XHTML
clearing ltpa cache
Sessions in JSF
View cannot be restored exception
Logout in JSF with Security managed by Glassfish v3.1