![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Exception in thread "main" java.lang.NullPointerExceptionHi I was wondering if anyone could see why i'm getting the Error
Code:
Heres the code thanks: JAVA Code:
Last edited by LuciWiz : 29-Dec-2006 at 15:15.
Reason: Please insert your Java code between [java] & [/java] tags
|
|||
|
#2
|
||||
|
||||
Re: Exception in thread "main" java.lang.NullPointerExceptionLike, oh my god!, let's like totally do a stack trace of that 'Exception'...
(from the bottom->up) line 37 is this statement, in main(): JAVA Code:
line 56 is this statement [note the <init> implies "during construction" (or "in the constructor")] JAVA Code:
to line 99: JAVA Code:
So, what is it about this statement [line 99] that could possibly be null? I'll stop here to let you ponder it, but if you get stuck, post another reply. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: Exception in thread "main" java.lang.NullPointerExceptionHi thanks for your help but I still don't understand how it is null. I'm kinda new to java and debugging so if im appearing naiive, sorry, but is there anything else that you can tell me as a hint.
thanks again, Kirsty |
|
#4
|
||||
|
||||
Re: Exception in thread "main" java.lang.NullPointerExceptionAnother hint: follow your constructor code...
What is the value of 'jToolBar' when it is used from the call point at line 56? __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
|||
|
|||
Re: Exception in thread "main" java.lang.NullPointerExceptioni m facing similar problems any help???
|
|
#6
|
||||
|
||||
Re: Exception in thread "main" java.lang.NullPointerExceptionFollow the stack trace from bottom->up.
I can't refer to exact lines, because you didn't post any code -- nor the dump, but the dump does provide the <file.java>:<line#> reference that should be easy to follow. Java is typically pretty good at pinpointing the problem, but it's not always obvious, so if you still have trouble, post another reply with more details. (i.e. the dump and source) Follow the guidelines about code posting, please, so that it will be formatted. (see the first two posts) __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#7
|
|||
|
|||
Re: Exception in thread "main" java.lang.NullPointerExceptionoh yes here's the code and the error
code.... JAVA Code:
error Code:
Thanks Idris Last edited by admin : 18-Jun-2009 at 08:16.
Reason: Please insert your example Java codes between [JAVA] and [/JAVA] tags
|
|
#8
|
|||
|
|||
Re: Exception in thread "main" java.lang.NullPointerExceptionafter i changed my log4j level to debug i also get this error besides the above errors.....
************************ log4j:WARN No appenders could be found for logger (org.springframework.context.s upport.ClassPathXmlApplicationContext). log4j:WARN Please initialize the log4j system properly. **********************************************8 the log4j.xml is below Code:
|
|
#9
|
||||
|
||||
Re: Exception in thread "main" java.lang.NullPointerExceptionI've never used log4j, but if you can get the debug to also provide the file and line#, then that would be helpful.
Post #8, is a WARNing, it can't seem to locate an appender based on the message it gives. I don't know what to tell you for that one. ============= Post #7. Although there appears to be no line#'s, (probably a log4j option that's needs to be applied, and I don't know what that needs to be), but following the dump that was given, it appears that the problem is AFTER this statement: JAVA Code:
JAVA Code:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#10
|
|||
|
|||
Re: Exception in thread "main" java.lang.NullPointerExceptioni put try catch on all the listeners in the constructor..
i am using IntelliJ and things r working fine when i run from it... but now i m trying to make an executable jar which cna be used to run from other computers... it compiles well thru ant but when i try to run thru the command "java -jar example.jar" it gives me all these errors... JAVA Code:
dump is as Code:
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thread Stopping Exception | Gix | .NET Forum | 12 | 28-Nov-2006 05:30 |
| Thread | itch | C++ Forum | 7 | 10-May-2006 16:10 |
| please help in solving: Exception in thread "main" java.lang.nullpointerexception | vkiran_v | Java Forum | 8 | 09-May-2006 08:06 |
| C++ Copy Constructor & Exception issues | greymalkin | C++ Forum | 3 | 05-Oct-2005 22:36 |
| Sending message to GUI thread that ISNT the main thread | mpviii | MS Visual C++ / MFC Forum | 1 | 20-Apr-2005 13:49 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The