• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.NullPointerException on file save  RSS feed

 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I'm having a strange problem. Well, strange to me anyway. I'm working on a project with a group of people. We're using JSF 1.2, Richfaces, WAS 7, and developing on RAD 7.5. We're using Rational Clearcase for source control.

I'm trying to make a change to a file and am running into some problems. I've updated my view to ensure I have the most current versions. I just want to work on my local for now so I'm hijacking a class file. The file doesn't have any compile errors or anything like that in it's current state. However, when I try to make any changes, no matter what the change is, and save it, I get a window saying:

Save Failed

java.lang.NullPointerException


When I click on the "Details" box, it just gives me the same information again. I'm not making any major changes. I tried it just adding a comment or a space, no matter what I add, I get the same result. Anybody have an idea of what this might be?

Thanks!

As an update, I seem to be the only person on my team having this problem with this file. I've tried restarting RAD, rebooting my PC, nothing seems to help much.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what the WAS server logs are for, Look there and you should see a stacktrace. Without that, we have no idea what's blowing up, much less why.
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This isn't a run-time error that would produce anything on the server logs. It won't let me save the file, it won't compile. When I try to save, nothing shows up in the console area, I just get a pop-up error message when I hit the save button.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J Miller wrote:This isn't a run-time error that would produce anything on the server logs. It won't let me save the file, it won't compile. When I try to save, nothing shows up in the console area, I just get a pop-up error message when I hit the save button.


I'm afraid I'll have to disagree. NullPointerException is a Java runtime exception. To get a Java runtime exception, you have to be executing Java code, ergo there was code compiled.

In order for there to be no stacktrace, some twerp would have had to have intercepted the exception and silently discarded it (which is a great way to incite me to physical violence; NEVER silently discard an exception! ). However, I'm at a loss as to how that would happen here, since supposedly all the mechanics of the JSF file upload process are done in pre-written/pre-debugged code except for the parts where you actually take the uploaded content and figure out what to do with it.

Without diagnostics, there's not much I could do. If I were actually in front of the terminal, I'd rebuild with debug-level logging enabled and look for places to set debugger breakpoints. If that didn't work, I'd have to assume that the server had been corrupted and consider re-installing it.
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally I wouldn't argue, but I promise you I wasn't running the code. This is a web application, so I would've had to have saved it, published it, opened a web browser and gone to the web page that uses it in order to get a run time exception. And I never even published it, I was simply trying to save it.

However, doesn't matter anymore. I'm not sure what the root cause of my problem was, but I have it fixed now. I simply created a new workspace and imported the same project back into it, and it's working like a champ. Maybe my workspace just got corrupted or something? The world may never know.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. Now I think I understand.

You posted this question in the JSF forum, but on re-reading, it appears that you mean that you were getting the dialog when saving a file in your IDE.

This was the wrong place to ask about IDE problems. We have an entirely different forum for WAS and its friends.

WAS does save a stack trace, but its log files are buried deep within the metadata of the workspace and it's useless to anyone who isn't interesting in debugging Eclipse/WAS.
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aaah ok. That makes sense. I'm still fairly new to Java in general, so please forgive my ignorance. But thanks for the responses. This has quickly become one of my favorite places to search for answers because it's one of the few message boards where you consistently get responses! Hopefully soon enough I can be the one answering the questions
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!