GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes help in debug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "help in debug" Watch "help in debug" New topic
Author

help in debug

Diogo Del Gaudio
Greenhorn

Joined: Aug 24, 2007
Posts: 4
g'day, this is my first and desperate post.
please, i need help with debugging this project. i have looking for all the code searching errors or something like this, but unsucessfuly. so i'm doing it (in a last desperate action), i'm posting my project here, i hope you guys could help me-pleaaaaaase -

so here is...
http://rapidshare.com/files/51058871/project.zip.html

thanks, guys!
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
You are currently asking volunteers to download and debug a very large multi-file project.

I think that you'll have much greater success on getting help if you do one of two things:

1) Pay a professional programmer to review and correct your project

or

2) (most likely the preferred solution) Greatly limit the scope of your question. For this I recommend isolating each error and creating a Short, Self Contained, Correct (Compilable), Example (SSCCE) based on each error. For info on just what an SSCCE represents, please look here.

Good luck!

Pete
Diogo Del Gaudio
Greenhorn

Joined: Aug 24, 2007
Posts: 4
thanks for the tips, pete... i'm sorry about the previous post, i was really desperate.
i guess i founded where is the error, the error happens in my connection pool, because he returns a null pointer exception on the method getconexao, where happens the connection with the DataBase... i alredy saw my Context.xml and my Access class, but it looks fine. :S i'm starting to think that the problem is in my DB(MySql) config.

the Acesso Class :



my Context.xml:



and... the error :
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
br.com.ag7.ImpostoAg7.jdbc.acesso.Acesso.update(Acesso.java:60)
br.com.ag7.ImpostoAg7.jdbc.implementacao.CadastroCliente.incluirCliente(CadastroCliente.java:41)
br.com.ag7.ImpostoAg7.servlet.imposto.CadastrarCliente.processRequest(CadastrarCliente.java:53)
br.com.ag7.ImpostoAg7.servlet.imposto.CadastrarCliente.doPost(CadastrarCliente.java:85)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:36

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
v ray
Ranch Hand

Joined: Mar 15, 2007
Posts: 223


PreparedStatement pstm = getConexao().prepareStatement(sql);



Is it that line which is giving the null pointer exception? Just check if the String is null.
Diogo Del Gaudio
Greenhorn

Joined: Aug 24, 2007
Posts: 4
yeah, is that line. the string isnt null :S i'm getting the parameters of the jsp with getParameter(). and inputing a sql string with this code:




its in another class.
v ray
Ranch Hand

Joined: Mar 15, 2007
Posts: 223
Just to debug, try to print that statement before you try to create the preparedstatement.
Another thing is, check if the connection is available in that method, maybe thats creating a problem? Maybe the connection was closed?
Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
Your try/catch in getConxeao() could cause it to return null without being noticed unless you check your log files for the output of the stack traces. Get the Connection first and verify that it's not null, or check your logs.
Diogo Del Gaudio
Greenhorn

Joined: Aug 24, 2007
Posts: 4
guys, its done! finally!


the problem was in the driver instalation, it was in a wrong directory. thanks for all!
the right directory is:

C:\Arquivos de programas\netbeans-5.5.1\enterprise3\apache-tomcat-5.5.17\common\lib

its for who uses netbeans
Chris Corbyn
Ranch Hand

Joined: Jan 14, 2007
Posts: 114
/WEB-INF/lib/ should work fine too if you don't need this to be available to all applications in your container.
 
GeeCON Prague 2014
 
subject: help in debug