nullpointerexception

NullPointerException thrown from EntityManager

ε祈祈猫儿з 提交于 2019-12-25 13:59:35
问题 I have a problem with an EntityManager , it throws a NullPointerException . This is the code: PersonServiceJpa.java package com.smartpump.service.jpa; import org.springframework.stereotype.Service; import com.smartpump.persistent.entity.Person; import com.smartpump.service.PersonService; import java.util.List; import javax.jdo.annotations.Transactional; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.Query; @Service("personService"

Parsing xml: attributes.getValue() returns null?

ⅰ亾dé卋堺 提交于 2019-12-25 12:44:45
问题 See this part of my xml: <blocktype> <properties name="normal_blue" type="1"/> <resources image="brick_blue"/> <properties powerup="0" shield="0" /> </blocktype> I'm using this code to parse it: @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (localName.equalsIgnoreCase("level")) { block = null; inLevel = true; // parsing level Log.d("MyContentHandler", "Parsing Level = " + Boolean.toString(inLevel)); } if

Creating an Object array from another class

为君一笑 提交于 2019-12-25 11:59:51
问题 Okay this should be simple. But I have been at this for a good hour and cannot figure out why its a nullpointerexception. I need to create an array for "Sally" and then test its length, which should be 0. This is in the main method of the driver class. LendingItem[] sallysItemList = sally.getSignedOutItems(); if (sallysItemList.length == 0) and this is in the object class that created sally. that rotten B. private LendingItem[] signedOutItems; public LendingItem[] getSignedOutItems() { return

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

穿精又带淫゛_ 提交于 2019-12-25 10:21:49
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

Not able to get rid of NullPointerException when changing brightness of an image and passing the brightness value to another intent

左心房为你撑大大i 提交于 2019-12-25 10:21:13
问题 In my app, I am changing the brightness of an image within an ImageView in Activity B and I'm passing the image as well as the brightness changed to Activity A. But when recieving the result in Activity A, I get a NullPointerException. Here is part of code in Activity A: On a button click: btn_Edit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent editIntent = new Intent(HowItWorksActivity.this, EditPhotoActivity.class); if (current_working_image

Debug NullPointerException

筅森魡賤 提交于 2019-12-25 09:20:37
问题 I am building a music player. The error occurs when launching the application. I have searched the term "Caused by: java.lang.NullPointerException" on Google, finding out the cause for this and it seems like it's throwing back null commands of some sort? Whilst looking at the logcat I saw this... 04-06 13:25:16.444: E/AndroidRuntime(30139): Caused by: java.lang.NullPointerException 04-06 13:25:16.444: E/AndroidRuntime(30139): at com.ascendapps.nexplay.SongsManager.getPlayList(SongsManager

OptaPlanner Nurse Rostering accumulate sum Null Pointer Exception

南楼画角 提交于 2019-12-25 09:10:06
问题 I try to modify the OptaPlanner nurse Roster example. So far, I want to write a rule in the drl file which reacts when an employee works more than 13 hours per day. I expanded the class shiftType to get hours per Shift. At first look, the rule seems to work but when there is no feasible solution after a while I get a NullPointerException. Here is some relevant code: rule "dailyRestPeriod" when ShiftAssignment($employee : employee, $shiftType : shiftType, $shiftDate : shiftDate, $employee!

PDFTextStripper NullPointerException

社会主义新天地 提交于 2019-12-25 08:57:40
问题 I am trying to fetch some data from a PDF file in Java using apache PDFBox(1.8.9). I have added the jar in my buildpath and classpath (in Eclipse-Mars) I am getting a null pointer exception while creating a PDFTextStripper object. import java.io.File; import org.apache.pdfbox.util.PDFTextStripper; import org.apache.pdfbox.pdmodel.PDDocument; public class MainClass { public static void main(String[] args) { PDDocument pd ; try{ StringBuilder sb = new StringBuilder(); File input = new File("C:\

LoginButton facebook android NullPoiunterExecptioi

人走茶凉 提交于 2019-12-25 08:02:00
问题 I wanted to add the login button to my app and so i followed the guide of facebook about that. I created my app project i add an android project telling the name of the package and the path of the mainactivity and the hash code generated from the default keystore (i used as they tell to me the android debug keystore because for the moment the app is only in alfa test and so for personal developing reason i prefer to use the debug version generated from android studio). Then i put in string

Android Null Pointer Exception on My Database [duplicate]

情到浓时终转凉″ 提交于 2019-12-25 07:35:35
问题 This question already has answers here : What is a NullPointerException, and how do I fix it? (12 answers) Closed 2 years ago . My insert function public void AddBakim(){ btn_bakimkaydet.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { db.insertBakim("1","2","3"); } }); } My database function public boolean insertBakim(String bAd,String bFiyat,String bTarih){ /*String FK_aID*/ SQLiteDatabase db = this.getWritableDatabase(); ContentValues deger = new