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 7413531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:27+00:00 2026-05-29T06:55:27+00:00

A client is running a web app through Tomcat and is getting an unusual

  • 0

A client is running a web app through Tomcat and is getting an unusual NullPointerException in a seemingly innocuous area. As you can see a NullPointerException cannot occur in the constructor of the inner class BookingDetail. And what is this access$300() method and how would it be called? Yes it’s very annoying that I don’t have the line numbers but I cannot replicate this issue.

Here is a snippet of the code from the LeaveCalculator class:

private class BookingDetail {
    private Date from;
    private Date upto;
    private String wpat;
    private String pubh;
    private BookingDetail(Date from, Date upto, String wpat, String pubh) {
        this.from = from;
        this.upto = upto;
        this.wpat = wpat;
        this.pubh = pubh;
    }
}

private void calculatePayHoursAndLeaveHoursForLSLHours(Date from, Date upto) {
    String pubhMaster = ((LSLLeave) leave).getPublicHoliday().trim();
    List<PositionHistory> histories = findHistories(from, upto);
    Map<Integer, BookingDetail> table = new HashMap<Integer, BookingDetail>();
    for (PositionHistory h : histories) {
        BookingDetail position = table.get(h.getEmployment());
        if (position == null) {
            table.put(h.getEmployment(), new BookingDetail(h.getFromDate(), h.getUpToDate(), h.getWorkPatternCode(), pubhMaster.isEmpty() ? h.getPublicHolidayCode() : pubhMaster));
        } else {
            if (position.from.after(h.getFromDate()))
                position.from = h.getFromDate();
            if (position.upto.before(h.getUpToDate()))
                position.upto = h.getUpToDate();
        }    
    }
    double payHoursTotal = 0;
    double leaveHoursTotal = 0;
    boolean error = false;
    Set<Integer> keys = table.keySet();
    for (Integer employment : keys) {
        BookingDetail row = table.get(employment);
        if (row.from.before(from))
            row.from = from;
        if (row.upto.after(upto))
            row.upto = upto;
        calculatePayHoursAndLeaveHours(row, false);
        error |= !verifyLeaveHours();
        payHoursTotal += payHours;
        leaveHoursTotal += leaveHours;
    }
    leaveHours = error ? WORK_PATTERN_ERROR : leaveHoursTotal;
    payHours = payHoursTotal;
    BookingDetail lowestEmployment = table.get(employment);
    wpat = lowestEmployment.wpat;
    pubh = lowestEmployment.pubh;
}

Here is the stack trace:

java.lang.NullPointerException
    at com.empower.ess.logic.leave.LeaveCalculator$BookingDetail.access$300(Unknown Source)
    at com.empower.ess.logic.leave.LeaveCalculator.calculatePayHoursAndLeaveHoursForLSLHours(Unknown Source)
    at com.empower.ess.logic.leave.LeaveCalculator.calculatePayHoursAndLeaveHours(Unknown Source)
    at com.empower.ess.logic.leave.LeaveCalculator.calculateAmountToDisplay(Unknown Source)
    at com.empower.ess.logic.leave.LeaveCalculator.calculateAmountToDisplay(Unknown Source)
    at com.empower.ess.logic.leave.dwr.LeaveTypesLookup.calculateAmount(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1190.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.empower.mawson.core.web.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:236)
    at com.empower.mawson.core.web.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:44)
    at com.empower.mawson.core.web.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:79)
    at com.empower.mawson.core.web.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:151)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:444)
    at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:472)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
    at java.lang.Thread.run(Thread.java:619)
  • 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-05-29T06:55:27+00:00Added an answer on May 29, 2026 at 6:55 am

    The “access$300()” call is a synthetic method which gives access to a private member, here probably “from”, “upto”, “wpat”, or “pubh”. One of those is probably null when looping through your for-each loop. You need to validate that “row.from”, for example, is not null before de-referencing it further.

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

Sidebar

Related Questions

I want to call some RESTful web services from a J2ME client running on
I have a web application where the client will be running off a local
I have a .NET Web Service running in VS2005 and a client that consumes
I have a web application running on Google App Engine (GAE) for JAVA. I'm
I'm running a simple web app backed by node.js, and I'm trying to use
I have a self-hosted WCF web service running, and an Android client application. I
We made an application for a client. The app is .NET/Silverlight 4, running on
I am working on a grails web-app The application is running on a very
Is it possible, pragmatically, to tell whether an ASP.NET web app is running in
I have a ASP.Net web app with jquery implemented on the client side. within

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.