nullpointerexception

What causes a "Cannot register a null resource" error in ICEfaces?

Java EE 5, JSF 1.2 with Facelets, ICEfaces 1.8.2 What can cause a "Cannot register a null resource" error in ICEfaces, using an ice:outputResource tag? From the ICEfaces source code, it looks like it's when the resource is null (duh), but I'm positive that it isn't. Are there any other possible causes? ...

New Activity nullpointerexception Problem

Hello, I have a noob problem. Here is my situation: I want to start a new activity from the main activity. The code to launch the new activity is found in a separate class file. I seem to be passing the wrong arguments and I am ending up in a nullpointerexception when trying to launch the new activity. The new activity launches fine whe...

Unable to compile class for JSP on JBoss6M4

We are updating our project from java 1.4 to java6 and trying to move to jboss6 with javaee6. We completely remade our ejb's and logic. So the the trouble we have now is that no jsp is comipilng on jboss6. So al jsp's run compiled and run correctly on jboss 3.2.1 and jboss5.1 but not on jboss6M4. So this is out jsp : http://pastie.org/1...

Android Eclipse - error trying to open or edit /res/values/strings.xml - NullPointerException

getting error: An error has occurred. See error log for more details. java.lang.NullPointerException when I attempt to edit this file in my eclipse Android sdk project. Not seeing anything in LogCat or the Console. I need to update this file to rename the Project. ...

Does Android kill local variables after some time?

I seem to be getting a crash after a long period of time on my device: E/AndroidRuntime( 1115): FATAL EXCEPTION: main E/AndroidRuntime( 1115): java.lang.RuntimeException: Unable to resume activity {org.stocktwits.activity/org.stocktwits.activity.Main}: java.lang.NullPointerException E/AndroidRuntime( 1115): at android.app.ActivityThr...

How to handle nulls when using Java collection sort

Hi, When using Collection.sort in Java what should I return when one of the inner objects is null Example: Collections.sort(list, new Comparator<MyBean>() { public int compare(MyBean o1, MyBean o2) { return o2.getDate().compareTo(o1.getDate()); } }); Lets say o2 is not null but o2.getDate() it is, so should I return...

Java ConcurrentHashMap not thread safe.. wth?

Hello I was using HashMap before like public Map<SocketChannel, UserProfile> clients = new HashMap<SocketChannel, UserProfile>(); now I've switched to ConcurrentHashMap to avoid synchronized blocks and now i'm experiencing problems my server is heavily loaded with 200-400 concurrent clients every second which is expected to grow...

Why does JComboBox.removeAllItems() throw NullPointerException?

jComboBox.removeAllItems does not complain until after items are added (it gets called once before the JComboBox is populated from a configuration file). Stepping through this code I see jComboBox.removeAllItems calls JComboBox.removeAllItems which calls DefaultComboBoxModel.removeAllElements which calls fireIntervalRemoved. There are se...

How to return resultset from web service in java

Hi All, i am writing an application in which i am creating web services. i am creating an operation(method) which retrieves database table values from database table in resultset. Hence we can't return resultset value directly in web services. i am creating a class which holds the values from resultset. instead of resultset i am returni...

Why am I getting a null pointer exception

Hi, Today is my first day learning java :) I'm having problems running a very simple example (not a great start). It's just a simple example that asks a user for input and prints it back out but I'm getting a null pointer exception when I try to read a line from the console. I don't understand because everything seems to be instantia...

Multi-Test TestNG.xml file results in java.lang.NullPointerException

Multi-Test TestNG.xml file results in java.lang.NullPointerException Hello Quality Team, I need help getting TestNG to run multiple tests from one XML file. So far my efforts to do this result in a java.lang.NullPointerException OR the test(s) fake_execute="says it ran...but how can it have run if it didn't start selenium?" One final...

Android starting application after searching for it

I installed my application through clicking run in eclipse. When I search for my application to start it and click on it I get the following error. Do I have to add some magic phrase to the manifest? 09-21 11:25:33.138: ERROR/AndroidRuntime(23360): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Questionaire/com.Q...

TextView is not initializing

My layout xml has a Tablelayout with TextViews for a cell: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1"> <TableRow> <TextView android:text="S...

ListPreference is throwing a strange null pointer exception

I have an app that obtains a list of available Calendars and displays them in the Spinner. I have checks to ensure that if the available Calendar list is empty, then ListPreference will still display "None available" in the Spinner. I am using the ListPreference to display the Spinner in the Preferences tab. Here is the preferences.xm...

Problem with C3P0 connection pooling in ServletListenerContext when deploying to Tomcat 6

Hello there, first things first: I've read various related questions on here, before actually deciding to enter my question anyway. The reason is that my problem is somewhat different from the others I've read about. My aim: I have an application written in GWT (I'll explain later why it's relevant) that access some servlet via RPC. Th...

Why does this map retrieval produce a NPE?

Consider this class: public class TestMap extends HashMap<String, Float> { public static void main(String[] args) { TestMap tm = new TestMap(); tm.put("A", 0F); tm.put("B", null); String[] keys = new String[]{"A", "B"}; for (String key : keys) { System.out.println(key); ...

How to fix Android WebView crash due to pending MotionEvent

My Android app is experiencing this crash randomly during operation, and I think it is due to a pending MotionEvent that is dispatched to a null object, but not sure. here is the crash output: java.lang.NullPointerException at android.webkit.BrowserFrame.getRequestInterceptor(BrowserFrame.java:1108) at android.webkit.FrameLoader.handle...

JPA/Hibernate Static Metamodel Attributes not Populated -- NullPointerException

I would like to use JPA2 Criteria API with metamodel objects, which seems to be pretty easy: ... Root<JPAAlbum> albm = cq.from(JPAAlbum.class); ... albm.get(JPAAlbum_.theme) ... ; but this Root.get always throws a NullPointerException. JPAAlbum_.theme was automatically generated by Hibernate and looks like public static volatile Sing...

NullPointerException with StringBuilder

I get a very common crash below from the code below. I thought my try, catches will have handled that. java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:200) at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273) at java.util.concurrent.Fu...

Order of operators in IF statement

I often do this when necessary to prevent a null pointer exception: // Example #1 if (cats != null && cats.Count > 0) { // Do something } In #1, I've always just assumed that the cats != null needs to be first, because order of operations evaluate from left to right. However, unlike example #1, now I want to do something if the obj...