nullpointerexception

Seam - @In Identity identity not injecting & throws nullpointer exception

I am using Seam 2.0 and I have an instance variable inside my bean as @In Identity identity and when I use identity.getUserName() it throws NullPointerException. Can anyone tell me please what I am missing here additionally? Update: I have defined bean instance variable as below: @In Identity identity; Then in my bean construc...

Why nullpointerexception when parsing xml in android application?

Hi, we have a android application that works fine up to android 2.1, but when we try to release it for android 2.2 we get a nullpointerexception. This happens when we're parsing a xml, on the following line of code: ((node) getText.item(0).getNodeValue(); help appreciated! ...

c# embed resources problem on windows xp (NullReferenceException)

Hi, I'm using an embed resources in my c# application string sPath = System.IO.Path.GetTempFileName(); System.IO.File.WriteAllBytes(sPath, Properties.Resources.test) workbook = app.Workbooks.Open(sPath,missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing); It wo...

NullPointerException called indirectly by SQLite database?

My Android application crashes when I try to call MyCursorAdapter.bindView. Here is the LogCat log: 08-10 15:22:57.269: ERROR/AndroidRuntime(463): FATAL EXCEPTION: main 08-10 15:22:57.269: ERROR/AndroidRuntime(463): java.lang.NullPointerException 08-10 15:22:57.269: ERROR/AndroidRuntime(463): at com.mohit.gtodo.TasksCursorAdapter.bi...

Check chains of "get" calls for null

Hi. Let's say I'd like to perform the following command: house.getFloor(0).getWall(WEST).getDoor().getDoorknob(); To avoid a NullPointerException, I'd have to do the following if: if (house != null && house.getFloor(0) && house.getFloor(0).getWall(WEST) != null && house.getFloor(0).getWall(WEST).getDoor() != null) ... Is there a...

Android ListView help

I have an EditText that has a onKeyListener. Whenever a key is pressed, the EditText string is compared with a set of words in a String array, to display a list of matches that begin with the string in EditText01. But the app always force closes. The log says java.lang.NullPointerException. This is my code: public class listupdate exte...

Why does this Android FileOutputStream throw a NullPointerException?

There does not seem to be any Android manifest permission that needs to be set for file io. public class Device extends Activity { private static final Configuration config = new Configuration(); ... private boolean applyMenuChoice(MenuItem item) { switch (item.getItemId()) { ... case R.id.menuSave: ...

NPE when i update custom node

Hi all I am trying to upgrade jackrabbit version in my project from 1.6 to 2.1.1. Some things from 2.1.1 are very usable. After transition on new version i get "magic" problems. I often catch NPE exception from inside jackrabbit api. After some investigations and tests i had found one of many problems. What i do in my test? I declare c...

Bug: Null pointer deference of String

Hi, The test code below leads to a "null pointer deference" bug on a String Array(on line 6). This leads to a NullPointerException. public class TestString { public static void main (String args[]) { String test [] = null; for (int i =0; i < 5; i++) { String testName = "sony" + i; test [k] = testName; } } } -- How do I fix this? ...

Nullpointer Exception

I've got the following MapOverlay. The following line is throwing a NullPointer but I don't understand why :S mapView.getProjection().toPixels(p, screenPts); could anyone help me out? public class Mapview extends MapActivity { GeoPoint p; MapView mapView; MapController mc; @Override protected boolean isRouteDisplayed() { return f...

NullPointerException while working with Android development in Eclipse.

Hi, I'm just getting started with Android app development on a Mac, and I keep getting a NullPointerException everytime I go into Strings.xml to edit it. Here's the steps I followed - Downloaded eclipse 3.5 Installed the Android SDK Downloaded SDKs from Android SDK manager. Created a basic Hello World Project. The project compiles ...

Does this NullPointerException refer to getFoos returning null or some problem with the cast from a Collection to an ArrayList?

Why does this line cause a NullPointerException: List<Foo> foos = new ArrayList<Foo>(userDetailsService.getFoos(currentUser)); The getFoos method simply returns a Collection of Foos: public Collection<Foo> getFoos(final String username) I can't tell if the NullPointerException refers to getFoos returning null or some proble...

Android : HttpClient POST : NullPointerException

Hello, I am new to Android development since my EVO purchase a few months ago. Anyway, I am developing my first Android app using Eclipse and Android SDK emulator. I am trying to do a simple HTTP POST. My real code has my login information hard coded in so I replaced it with test information and I changed the url as well to simply POS...

PreferenceActivity gives a NullPointerException when option selected from ListPreference

Hi all, I'm new to using the PreferenceActivity. Task: Allow user to choose the program layout from the Preferences Problem: Selecting an option in the PreferenceList causes a NullPointerException Exception arises: At android.preference.ListPreference.onDialogClosed() (Shortened) Code: private static final String PREF_LAYOUT_KEY =...

Double != null is causing a NullPointerException

Hi, I have the following snippet of code that is causing me bother, where currentRate and secondCurrentRate are Double objects, correctly defined: (currentRate != null && secondCurrentRate != null) ? currentRate * secondCurrentRate : null; This should check each each Double for null-ness and assign the value null accordingly. However...

AbstractWizardFormController: java.lang.NullPointerException at processFinish(...)

Hi, Could someone please help me understand that why am I getting this error at RegisterServiceProviderController.java when processFinish(...) method is called? java.lang.NullPointerException at com.inception.web.RegisterServiceProviderController.processFinish(RegisterServiceProviderController.java:66) at org.springframework.web.servl...

How do you understand the cause of exception having stacktrace?

We have written an Android application which sends stack traces to our server, if any occur. Sometimes we get weird stack traces that seem not to be an exception from our application. For example: java.lang.NullPointerException at android.widget.FastScroller.scrollTo1(FastScroller.java:306) at android.widget.FastScroller.onTouchEvent(F...

android spinner NullPointerException

Hey guys I'm having trouble with a spiner throwing a nullPointerExpression I'm sure I'm missing something stupid? Thanks for you help here is my code: public class main extends Activity { /** Called when the activity is first created. */ public TextView strCurrency; public TextView strCurrencyOUT; Button butCalc; private Spinner...

EntityManager not injected

I'm getting an NPE for my EntityManager and can't figure out why - can anyone spot my mistake? UserManagerImpl.java @Stateless public class UserManagerImpl implements UserManager { @PersistenceContext(unitName = "persistenceUnit") EntityManager em; public List<User> findUsers() { return (List<User>) em.createQuery("from User").g...

NullPointerException error

I am developing in Eclipse a new Java project which uses an existing application (I have added its jar in my project build path). When I create an object of a class (say Model) from this existing application and use any of its methods, Model model = new Model(); model.start(); I get the following error: Exception in thread "main" ja...