javaantweblogic

Couldn't precompile jsps using ANT script-Weblogic server


I'm working on an ANT script now for a web application(And I have very minimal knowledge in ant script and weblogic server administration).

When I execute the ant script , everything work fine except the script fail to precompile the jsps. PFB the ant script for jsp precompile

  <!-- run jsp compile -->
  <target name="jspc" unless="warBuild.notRequired" depends="compileAll">
    <java classname="weblogic.jspc" fork="yes" failonerror="true">
    <arg line="-compiler ${WL_COMPILER} -nowarn -compileAll -webapp ${build} -depend -d ${classes}"/>
      <classpath>
        <pathelement path="${app.classpath};${classes}"/>
      </classpath>
    </java>
  </target>

And PFB the error log

jspc: [java] java.lang.NullPointerException [java] at weblogic.jsp.internal.java.JavaCompilationContext$JavacJavaCompilationContext.init(JavaCompilationContext.java:67) [java] at weblogic.jsp.internal.CPL.createJavaCompilationContext(CPL.java:584) [java] at weblogic.jsp.internal.CPL.setClassLoader(CPL.java:555) [java] at weblogic.servlet.jsp.JspCLLManager.initCompilerOptions(JspCLLManager.java:396) [java] at weblogic.servlet.jsp.JspCLLManager.initialize(JspCLLManager.java:235) [java] at weblogic.servlet.jsp.JspCLLManager.(JspCLLManager.java:228) [java] at weblogic.servlet.jsp.JspCLLManager.(JspCLLManager.java:221) [java] at weblogic.servlet.jsp.JspCLLManager.compileJsps(JspCLLManager.java:126) [java] at weblogic.servlet.jsp.jspc20.runBodyInternal(jspc20.java:456) [java] at weblogic.servlet.jsp.jspc20.runBody(jspc20.java:265) [java] at weblogic.utils.compiler.Tool.run(Tool.java:158) [java] at weblogic.utils.compiler.Tool.run(Tool.java:115) [java] at weblogic.jspc.main(jspc.java:22) [java] Unexpected exception while compiling jsps :java.lang.NullPointerException


Solution

  • The issue is because the JRE version of Weblogic and JRE version used in the workspace(Eclipse) was different. As a result the compilation of jsps were failed. I have changed the recommended JRE version, i.e. jre1.6 (for Weblogic 10.3.5) and it worked fine.