Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8161517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:30:57+00:00 2026-06-06T18:30:57+00:00

While I thought of setting array list value to array list bean it is

  • 0

While I thought of setting array list value to array list bean it is returning null pointer exception.
Please check action class:

public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception {

    ArrayList dailysheetdata;
    DailysheetForm dailyform = (DailysheetForm) form;
    Class.forName("com.mysql.jdbc.Driver");
    Connection connect = DriverManager.getConnection("jdbc:mysql://localhost/Stonecrusher?"
                        + "user=Stonecrusher&password=xxxxxx");
    System.out.println("Connection"+connect);
    dailysheetdata = StoneCrusherData.getDailysheetData(connect);
    if(dailysheetdata==null)
        System.out.println("dailysheetdata null");
    else if(dailyform==null)
    System.out.println("dailyform null");
    else
    dailyform.setArraylist(dailysheetdata) ;//iam getting exception here
    return mapping.findForward(SUCCESS);
     }

and my action form is

public class DailysheetForm extends ActionForm {
    // some getter and setter methods i used

    protected ArrayList arraylist;
    public ArrayList getArraylist() {
        return arraylist;
    }

    public void setArraylist(ArrayList arraylist) {

        this.arraylist = arraylist;

    }

When I run it I get following exception and in Tomcat log it is showing “dailyform is null”

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NullPointerException
    org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.NullPointerException
    com.myapp.struts.DialysheetListAction.execute(DialysheetListAction.java:59)
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.

I am not able to find the reason. Please help to solve it and please state the reason.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:30:58+00:00Added an answer on June 6, 2026 at 6:30 pm

    Problem is DailysheetForm class object is not created by framework.

    reasons are you din’t configure FormBean class and Action class are properly in struts-config.xml

    First you should check what page(which data ?) is submitted to action class ie

    DailysheetForm dailyform = (DailysheetForm) form; 
    

    check this line you are type casting form into DailysheetForm type object then framework automatically call the setter methods of DailysheetForm action form so maybe here you are getting NullPointerException i think so check it..

    and One more thing you have to check in struts-config.xml entries
    i.e in <action> tab name attribute value must be match with <form-beans> mappings
    check the package names also…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought null bytes were not allowed in shellcode. While understanding some shellcode, I
I've been using scala for a while now and I thought I was really
I've been a JavaScript developer for a while now, and I've always thought that
While making some final tests of a class-library that I'm writing for Windows Mobile
I thought the whole idea was to have only computation with NO state and
Alright, I thought I had this whole setTimeout thing perfect but I seem to
While reading through another question here, on creating a URL shortening service, it was
While editing .scm files it would be great if Vim would automatically put the
While my ASP.NET project uses version 3.5 of the framework , the event log
I'm currently working on setting up a new project of mine and was wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.