nullpointerexception

Null pointers everywhere because data is suddenly sparse.

Someone designed code that relied on full data; the XML always had every element. The data source is now sending sparse XML; if it would have been empty before, it's missing now. So, it's time to refactor while fixing bugs. There's 100+ lines of code like this: functionDoSomething(foo, bar, getRoot().getChild("1").getChild("A"). ...

Android Layout AutoCompleteTextView NullPointerException Workaround

I'm working in with the Android SDK 2.0 / Galileo / ADT 0.9.4 (latest to date). Against Android 1.5 API layer. If I go to the layout editor and add an AutoCompleteTextView the screen immediately gives me a NullPointerException. Does anyone have a documented workaround for this problem? I can't seem to find one. This is obviously a bug...

Android - WebView dies on resume

I have Activity with some data displayed in WebView that I load with WebView#loadDataWithBaseURL Then I have/click menu option that fires android.content.Intent.ACTION_SEND Choose email from the chooser Google email comes up (as expected) Discard email and hit back button Action with WebView tries to resume Bang - I get NullPonterExcep...

Eclipse debugging problem

Hello, I am facing a problem while debugging in eclipse. I keep getting pop-up Exception processing async thread queue java.lang.NullPointerException Does anyone know what the exact problem is? Thanks Yogesh ...

PreferenceActivity NullPointer Error

I keep getting nullpointer exception when i switch to my preferenceactivity. I have no idea what wrong but i keep getting a error when i load in my preference which is done programmitically. public class SettingsFrontEnd extends PreferenceActivity implements OnSharedPreferenceChangeListener { public static final String NO_SELECTION...

Android - NPE in BrowserFrame

I get this exception triggered by users occasionally that I cannot reproduce. Since it's issued from looper I suppose it is result of Handler-type callback. I found similar bug on Google code but putting the solution into code didn't solve it. The problem is at this line of code in BrowserFrame: WebAddress uri = new WebAddress( mCa...

2d String Array NullPointerException (java)

I am currently creating a java application in which I have a 2d array which I want to get some data into. I am creating the 2d array as such String[][] addressData; and then when I am trying to put data in I am using reference the exact position in the 2d array I want to enter the data into e.g addressData[0][0] = "String Data"; ...

How to pass object from main thread to another thread in java

In my main application class I have an object of JTextArea(say txtArea). I have created two another threads in main_application program. The two threads I have created is for reading and writing in serial port. Now I want to put the serial port read buffer data into an JTextArea object. So I need to pass the JTextArea object created in m...

Java: null pointer exception?

This code is causing a null pointer exception. I have no idea why: private void setSiblings(PhylogenyTree node, Color color) throws InvalidCellNumberException { PhylogenyTree parent = node.getParent(); for (PhylogenyTree sibling : parent.getChildren()) { if (! sibling.equals(node)) { Animal animal = sibling....

External entity in XML causing null pointer exception during DocumentBuilder.parse("file");

Hello All, I was trying to parse a XML Document using DOM Parser. I got null pointer exception while executing doc = builder.parse(xmlDataFile); There were few entities in the XML data file. On removing a particular entity, i was able to parse the file successfully The entity was some thing like this <!ENTITY SAMPLE.TIF SYSTEM "S...

Calling DisplayTag returns NullPointerException

We've been using DisplayTag for awhile now without any problems, but recently, we had a wonky hdd and so we had to restore some of the stuff on there. Unfortunately, DisplayTag broke and stops everything else when called: <display:table name="pageScope.userKeyList.licenseKeyList" id="userKey" pagesize="10" defaultsort="7" defaultorder="...

Why does it throw a NullPointerException?

Hi, I have a database class which has this method and it will be called in the other bean class (when I choose an image)(imagin I work with name and family,... not with id) my method: public static void insertImageToBirthTable(String name, String family, String fatherName, String motherName, String dateOfBirth, String placeOfBirth, Str...

Why is addBirth method returns null???

I have this method but in run-time it will be thrown nullpointerexception,why? my method: public static boolean isAddBirth(String name, String family, String fatherName, String mName, String dOfBirth, String pOfBirth) { ResultSet rst; boolean bool = false; Statement stmt; try { stmt = conn.createStatement(); ...

NullPointer Exception when calling method from a difference class

JAVA- Hi, I am writing a minesweeper program (first biggie) and am really stuck. The program itself is comprised of 2 classes (one for the logic, one for the GUI) as per the specifications that I am to follow. I have done a fair bit in both classes but am not finished either. However, I am attempting to test implementing call methods fro...

How to enforce jsf to create new instance of bean instead of throwing NullPointerException?

I'm almost sure that I do something wrong and thus the question's title is a bit incorrect. I have a form with several fields for creating a new User-objects (fields like login, password, birthday etc). And I have 2 buttons - Cancel and Create. I didn't finish Create yet :) , but when I press Cancel I see NullPointerException. Here is s...

Making Java version of Notepad and I have a problem

I am trying to load all types of files (like Microsoft Notepad). The SwingWorker I have can load normal text just fine but when a file such as mp3, pdf, etc. is attempted to be loaded I receive a NullPointerException. Can someone take a look at my code and possibly see why I keep getting this error for files such as mp3, pdf, etc.? Lik...

Java InputReader. Detect if file being read is binary?

I had posted a question in regards to this code. I found that JTextArea does not support the binary type data that is loaded. So my new question is how can I go about detecting the 'bad' file and canceling the file I/O and telling the user that they need to select a new file? class Open extends SwingWorker<Void, String> { File fil...

Handling Exception in a MediaFile app

I'm developing a media file app that is meant to play sounds stored in my raw folder. There are about 32 sounds in all. And this is what i'm doing on the click of each button: Button btnGrowUp = (Button) this.findViewById(R.id.GrowUp); btnGrowUp.setOnClickListener(btnGrowUpListener); private OnClickListener btnGrowUpListener = new OnCl...

Android XML parsing

hi friends... a strange problem has cropped up... I checked several websites but couldnt find anything wrong with the code... But it returns NullPointerException... try{ SAXParserFactory f = SAXParserFactory.newInstance(); SAXParser parser = f.newSAXParser(); XMLReader reader = parser.getXMLReader(); reader.setContentHan...

Why does my icon handling code throw a NullPointerException?

I have added an image for my button,but when I run that frame this exception will be thrown .why?please help me. init: deps-jar: compile-single: run-single: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:138) at ClientGUI.IdAndPasswordFrame.initCompon...