Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IO NullPointerException  RSS feed

 
William Kohus
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to nail down why I'm getting this null pointer exception. I've exhausted all of my brain cells attempting to get it going. Any help would be greatly appreciated!






Here is where the SKUList is



 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A stacktrace would be useful here...
 
William Kohus
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Koen Aerts wrote:A stacktrace would be useful here...



Test save =false
java.lang.NullPointerException
at SKUDictionaryPackage.SKUDictionaryR2.main(SKUDictionaryR2.java:71)

That is what I get from it.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And which line is that in the above code? Because its line 71 is part of a comment.
 
William Kohus
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:And which line is that in the above code? Because its line 71 is part of a comment.


I'm sorry in the SKUDictionaryR2 it's line 57. ----SKUList.add(foo5); ---- That is the code it doesn't like.

I can print the SKUList SKUDictionary.printSKUList(b); and it prints out what I've added, but when I have "SKUList.add(foo5); " In my code it gives the Null pointer.


Thanks so much!
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would mean that SKUList is null.

I find it peculiar that SKUList is declared as static, but only initialized when the SKUDictionary constructor is run. That would suggest you haven't created any SKUDictionary objects yet.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!