nullpointerexception

Use of request.getParameter in JSP results in NullPointerException

对着背影说爱祢 提交于 2019-12-14 03:26:19
问题 Trying to get a query string parameter and take an appropriate action in a JSP page. Here is a snippet: <%@ page import="com.companyx.portal.model.LDAPAttributes" %> <%@ page import="com.companyx.portal.service.LDAPAttributesLocalServiceUtil" %> <%@ page import="com.liferay.portal.model.User" %> <%@ page import="com.liferay.portal.util.PortalUtil" %> <%@ page import="javax.servlet.http.HttpServletRequest" %> <% User user = PortalUtil.getUser(request); String screenName = user.getScreenName();

Exception java.lang.NullPointerException

家住魔仙堡 提交于 2019-12-14 03:25:16
问题 Iam working in a desktop application for windows version using java. In my application there is a requirement to search all .php i use recursive methods; and REGEX my code : import java.io.File; public class Copier { public static void find(String source,String rep) { File src=new File(rep); if(src.exists() && src.isDirectory()) { String[] tab=src.list(); for(String s:tab) { File srcc=new File(rep+"\\"+s); if(srcc.isFile()) { if(srcc.getName().matches(".*"+source+"$")) System.out.println(s);

Android Parse.com populate listview with custom adapter issue

混江龙づ霸主 提交于 2019-12-14 03:20:05
问题 I am receiving a NullPointerException when retreiving data from parse.com. I have traced through the program and I am indeed receiving data. I will copy in my source code for the adapter and done method. FATAL EXCEPTION: main java.lang.NullPointerEXception at adapter.GroupChatAdapter.add(GroupChatFragment.java.79) this is my custom add public class GroupChatAdapter extends ArrayAdapter<GroupChat>{ private List<GroupChat> chat; private Group subscrib; private ListView listView; public

Null pointer when using doubly linked list

我的未来我决定 提交于 2019-12-14 03:15:25
问题 I am trying to create 2d doubly linked circular array, reading data from a txt file and creating nodes automatically. My program is reading the first line properly, but when it reaches next line and time to create next node, null pointer occurs. I dont understand why it is happening please help me. public class project1 { public static void main(String[] args) { File file = new File("Input0.txt"); List mList = new List(); try { Scanner sc = new Scanner(file); while (sc.hasNextLine()) { String

Java 2D API: Null Pointer Exception

一个人想着一个人 提交于 2019-12-14 03:10:05
问题 Please have a look at the following code package java2D; import java.awt.BasicStroke; import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.Graphics2D; import javax.swing.*; import java.awt.*; public class Joins extends JFrame { private JPanel centerPanel; public Joins() { this.setLayout(new BorderLayout()); this.add(createCenterPanel(),"Center"); this.setSize(200,250); this.setVisible(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private JPanel

SolR : NullPointerException when using spellcheck.q

丶灬走出姿态 提交于 2019-12-14 02:29:34
问题 I've already post about a problem wich brought me to this error, but I write it something more specific about the error : When I use spellcheck.q in my query to define what will be "spellchecked", I always have this error, for every configuration I try : java.lang.NullPointerException at org.apache.solr.handler.component.SpellCheckComponent.getTokens(SpellCheckComponent.java:476) at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:131) at org.apache.solr

Impossible NPE being thrown (java)

孤人 提交于 2019-12-14 02:21:37
问题 In this example code a NullPointerException is being thrown on line 4. 1. private <O,T> void generate(Suggestion suggestion, GeneratorFactory<O, T> generatorFactory) { 2. final Generator<O, T> generator = generatorFactory.getGenerator(suggestion); 3. while (generator.hasNext()) { 4. generator.doGenerate(); 5. } 6. // post-generate stuff here 7. } It only happens occasionally, but it has happened a few times on a live server, so it's not some kind of "ghost" bug - it definitely needs fixing.

Apache POI .getCell() error, java.lang.NullPointerException Cannot Read Cell if blank

馋奶兔 提交于 2019-12-14 02:18:52
问题 I have been having trouble recently with Apache POI's .getCell() method for Excel files. If I try to implement Cell newCell = sheet.getRow(rowNumber).getCell(columnNumber) or something similar, I always get the error Exception in thread "main" java.lang.NullPointerException at ExcelWriter.getWorkbook(ExcelWriter.java:80) at Gui2.<init>(Gui2.java:93) at Main.main(Main.java:24) which points to the line I am implementing the .getCell() method in if the cell is null. I have code that is supposed

.setPreviewDisplay(holder) throwing null pointer exception

喜你入骨 提交于 2019-12-14 02:12:51
问题 I am developing a custom camera application.Given below is my Activity class. public class MyCustomCam extends Activity { private Camera mCamera; private CameraPreview mPreview; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mCamera = getCameraInstance(); mPreview = new CameraPreview(this, mCamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera

Getting 'Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference' when there is no such method

你。 提交于 2019-12-14 01:51:52
问题 I'm getting this error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference even when there is no such method in my activity. Here's the code: public class MyActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { AppCompatSpinner iSpinner, nSpinner, dSpinner, vSpinner; AppCompatButton btnP; String itemID, currentLatString,