This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Development under Tomcat - deployment to JRUN  RSS feed

 
Bharat Shah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need some directions - I developed a simple JSP form to fetch/insert/update/delete records in a simple table, using servlets to handle all database actions. The 'system' works just fine on localhost under Tomcat.

BUT, when I 'deploy' it to JRUN, I get a null pointer error. By 'deploy', I mean, I copied the entire directory structure under my 'root' to the recommended directory under JRUN.

Any hints to correct this will be appreciated.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Look at the stack trace of the exception.

2) Find the line that is causing it.

3) Find the null reference.

4) Back-track to try and find out why it's null when it shouldn't be.
 
Bharat Shah
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the quick reply.

I was doing all along what you suggest, but it did not yield results - the stack was pointing me in the wrong direction.

Anyway, today I was looking at the place where I am logging database failure activities, and I found my error. I was writing to a file /temp/logfilename, and there is no such directory in a unix system. I changed that to /tmp/logfilename, and voila, everything works as expected.
 
Darren Edwards
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should avoid hard coding paths like that into your application and instead use
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!