File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with moving app from Netbeans to Tomcat

 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
When I run my applicaton on netbeans it runs fine.
When I move it in tomcat (by moving the content of the build directory) in tomcatHome/webapps/myApp I got a nullpointer exception in line 1 indicated bellow:


the result set in still null in Tomcat ?
anybody knows why ??
thank you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:\jdk1.5.0_06\jre\lib\ext\mysql-connector-java-3.1.12-bin.jar
and I have this on the path environment variable.
What can be wrong ?

thank you....
regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that's the JRE directory Tomcat is looking in?

As a policy, unless I'm using container managed connection pooling, I always pack all of the needed libraries inside the web application ({your webapp/WEB-INF/lib/{needed jar files}. Then, I put the jars in Tomcat/shared/lib.
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
How can I know what is the directory Tomcat is looking in?

I am developping the application in netBeans IDE (easier) and then to deploy it I just move it to Tomcat. (by simply moving the content of build directory)

Is this a bad idea.
Is there any other alternatives on how to move?

regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has really become Tomcat specific so I'm going to move the thread to Apache Tomcat.
Will pick up there....
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What OS are you using and how did you install Tomcat?
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Windows XP professional.
I installed tomcat 5.5.17 by double clicking on the .exe installation file.

regards,
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try to run the select query seperately in the databse and check if it returns any rows. Moreover please post the stack trace to help you better.
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well the same application using Netbeans (when I click build) it runs correctly .
so the query is correct.

here is the stack trace:
java.lang.NullPointerException
signupServlet.processRequest(signupServlet.java:53)
signupServlet.doPost(signupServlet.java:132)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I think it's the driver.
How can I make sure Tomcat is reaching the driver ??
thank you.

regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by aymane chetibi:

I think it's the driver.
How can I make sure Tomcat is reaching the driver ??
thank you.

regards,



The best way, in my opinion, is to put it under {your app}/WEB-INF/lib unless you are using container managed connection pooling, in which case, you need to make the driver available to Tocmat itself.
If that's the case, put it in
{tomcat home}/common/lib
 
aymane chetibi
Ranch Hand
Posts: 175
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it's working ...
thank you sooo much.


regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic