nullpointerexception

Rengine.eval returns null

空扰寡人 提交于 2019-12-23 04:54:12
问题 I have the following implementation: public static void main(String[] args) { // new R-engine Rengine re = new Rengine(new String[] { "--vanilla" }, false, null); if (!re.waitForR()) { System.out.println("Unable to load R"); return; } else System.out.println("Connected to R"); re.eval("library(RMySQL)"); re.eval("library(xts)"); re.eval("library(forecast)"); re.eval("db = dbConnect(MySQL(), user='root', password='', dbname='stats_server', host='localhost')"); re.eval( "data = fetch

How to read a text file from assets in Android Studio?

梦想与她 提交于 2019-12-23 04:42:17
问题 I have may wifi2.txt file in my assets file directory in Android Studio. However, I keep getting a NULLPointException when I try to access it. My code is below: (Thanks so much in advance) //CSV FILE READING File file = null; try { FileInputStream is = new FileInputStream(file); try { BufferedReader reader = new BufferedReader(new InputStreamReader(getAssets().open("wifi2.txt"))); String line; Log.e("Reader Stuff",reader.readLine()); while ((line = reader.readLine()) != null) { Log.e("code"

Guice AssistedInject won't inject the factory

坚强是说给别人听的谎言 提交于 2019-12-23 04:18:11
问题 I am trying to use Guice 3.0 AssistedInject , and it won't instantiate the factory. SSCCE Code: Parent class public class ParentClass() { @Inject private MyFactory myFactory; private final Foo foo; private final Bar bar; public ParentClass() { if(myFactory == null) System.err.println("Error: I should have injected by now!"); foo = myFactory.create(new Map<String, Object>()); // etc. } } Factory Interface public interface MyFactory { Foo create(Map<String, Object> mapA); Bar create(Map<String,

NullPointerException in RadioGroup.setOnCheckedChangeListener in APIS 15 & 16

徘徊边缘 提交于 2019-12-23 03:39:10
问题 Actually, I've to ask you a question about NPE in setOnCheckedChangeListener of RadioGroup. I've tested this code in APIs from 15 to 23, and only crashes is APIs 15 & 16. At first, i dont need to solve the NPE, i did it. I need to know why android assigns a negative value to radioButton ID, which causes NULL return in 'group.findViewById'. Here we've the code: private List<Question> listItems; private Question getItem(int position) { return listItems.get(position); } @Override public

getting Null value + probably query isn't working

戏子无情 提交于 2019-12-23 02:44:26
问题 Actually I'm following mvc-3 tier architecture to my application.and here is my Search option's implementation. In my servlet(controller) I'm doing this : String select = request.getParameter("select"); // getting value String search = request.getParameter("search"); // getting value request.setAttribute("select", select); request.setAttribute("search", search); System.out.println("Select : "+select+" Search : "+search); int page = 1; int recordsPerPage = 20; if(request.getParameter("page") !

ParseQuery NullPointer Exception Paradox

∥☆過路亽.° 提交于 2019-12-23 02:39:17
问题 This is a follow-up to my previous question: Parse RecyclerView Image Query I am now having a paradoxical nullpointer exception. I am attempting to extract a list from an inner method, in the way outlined below. public List<ParseObject> objectList; public List<String> getData(String filter){ ParseQuery<ParseObject> query = ParseQuery.getQuery("Images"); query.whereEqualTo("category", filter); query.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> downloads

ParseQuery NullPointer Exception Paradox

旧街凉风 提交于 2019-12-23 02:39:10
问题 This is a follow-up to my previous question: Parse RecyclerView Image Query I am now having a paradoxical nullpointer exception. I am attempting to extract a list from an inner method, in the way outlined below. public List<ParseObject> objectList; public List<String> getData(String filter){ ParseQuery<ParseObject> query = ParseQuery.getQuery("Images"); query.whereEqualTo("category", filter); query.findInBackground(new FindCallback<ParseObject>() { public void done(List<ParseObject> downloads

NullPointerException while generating web service with Apache CXF

依然范特西╮ 提交于 2019-12-23 02:25:32
问题 I want to create a web service and using Apache CXF 2.7.12. My jdk version is 1.8.0_20. While generating WSDL file in eclipse got this exception. java.lang.NullPointerException at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:187) at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:141) at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generateAndCompile(BeanGenerator.java:91) at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator

Android Action Bar SearchView NullPointerException adjustDropDownSizeAndPosition

坚强是说给别人听的谎言 提交于 2019-12-23 01:17:50
问题 The problem occurs when interacting with the SearchView or when the activity with the Searchview loads. When using setIconifiedByDefault(true) the problem occurs after the activity loads when interacting with the SearchView, but when using setIconifiedByDefault(false) the problem occurs when the activity loads. The following error is output in LogCat: java.lang.NullPointerException at android.widget.SearchView.adjustDropDownSizeAndPosition(SearchView.java:1244) Here is the code:

mapView deprecated method getZoomControls?

杀马特。学长 韩版系。学妹 提交于 2019-12-22 16:45:13
问题 I'm trying to get the default zoom controls to show on a google mapView. I was looking at this code. But getZoomControls() is deprecated. I'm trying to use setBuiltInZoomControls instead, but am getting errors; When I debug, the exception is; java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.maptab2/com.test.maptab2.MapTabView}: java.lang.NullPointerException 02-05 09:49:21.239: W/dalvikvm(357): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 02