NPE Hard to Debug

A little background on the project. It is for a Learning Management System (Blackboard). The overall project was finished, but we were tasked with minor changes. We decided to incorporate Gradle into the project to make certain parts easier. Now onto the problem, the original war file given to us works. We broke it apart and created a new project. The project was separated into two subprojects, utilities and web, where the web project is dependent on the utilities project. I think that I have set all of the dependencies within the build file correctly. So far, the NPE doesn’t point to any line in the project files. I don’t know what other general information that I could provide to help, but please let me know and I can get it.

Part of the error message:
java.lang.NullPointerException at blackboard.portal.servlet.JspModuleClass.getModuleBody(JspModuleClass.java:108) at blackboard.web.portal_005fjsp.layout.display_005fmodule_jsp._jspService(display_005fmodule_jsp.java:130) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:277)

Web project build file:

version = '1.5'
project.ext {
     learnVersion = "9.1.110082.0"
    deployServer = "205.174.62.96"
    deployInstance = "BBLEARN"
}

repositories {
  mavenCentral()
  maven {
    url "https://maven.blackboard.com/content/repositories/releases/"
  }
}



dependencies {
    compile project(":utils")

    providedCompile files("BBLibs/bb-platform.jar")
    providedCompile files("BBLibs/bb-cms-admin.jar")
    providedCompile files("BBLibs/bb-taglibs.jar")
    providedCompile files("BBLibs/servlet-api.jar")
}

war {
from ('utils') {
    include '*.jar'
    into 'WEB-INF/classes/'
}
// Replace version in Blackboard Manifest
inputs.property('version', version)

filesMatching("**/bb-manifest.xml") {
    expand version: version
}
filesMatching("**/web.xml") {
    expand version: version
}

manifest {

    attributes(
        'Implementation-Title': 'Leaderboard Blackboard building block',
        'Implementation-Version': version,
        'Implementation-Vendor': 'GroupThree',
        'Provider': 'Gradle'
    )
    
}

manifest.from(jar.manifest)

}

Your NPE appears to be in one of your JSP files (one of the reasons for not allowing scriptlets in JSPs).

If you’re using Eclipse, you might try installing the “JD-Eclipse Realign” plugin so that you can decompile the code in that class and possibly set breakpoints.

There’s no indication yet this is a Gradle problem.

The original project was developed in Eclipse, but, when we moved towards using Gradle, we included the Eclipse plugin. We mostly developed the project in Notepad++. I will make sure that I setup the Eclipse side right and try your suggestion. How could you tell that it was in one of my JSP files? The biggest problem with me going through this was I couldn’t figure out where to start.

I could tell by the following stack trace entries:

blackboard.portal.servlet.JspModuleClass.getModuleBody(JspModuleClass.java:108) at 
blackboard.web.portal_005fjsp.layout.display_005fmodule_jsp.jspService(display005fmodule_jsp.java:130) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at 

The presence of “jsp” everywhere was a huge clue, but the obviously dynamically constructed package path usually goes with compiled JSP pages.