This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unknown NullPointerException  RSS feed

 
zohaib K khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting NullPointerException when calling oracle package and procedure from JSP.

Following is the source code for package and JSP.

Oracle Procedure and Packages




JSP Source Code.


Any idea?

- Thanks
Zohaib.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first suggestion would be to move the Java code from the JSP to a Java class. Java code has no place in a JSP in 2013.

And without knowing what line caused the NPE, all we can do is guess. So don't just tell us about the error, show it to us.
 
zohaib K khan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am getting exception from following



Exception=>java.lang.NullPointerException

I know no java in jsp but requirement is like this and we want more business logic should be in oracle packages and jsp to display UI.

I am not getting what is wrong in package,procedure or call from JSP.

-Thanks
Zohaib.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zohaib K khan wrote:

That's a terrible way to code, and this is a good reason why. Now you you don't know where the exception occurred! If you are not going to handle the exception, don't catch it!

At the very least, print out the stack trace. But since you aren't doing anything to handle the exception you should not be catching it in the first place.

I know no java in jsp but requirement is like this and we want more business logic should be in oracle packages and jsp to display UI.

It's a requirement to write poor code? There is no display UI in this JSP, so why is it a JSP in the first place?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!