Tuesday, May 14, 2013

Google Apps Engine com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp files.

My Google Apps Engine was working fine till I installed Windows 7 (62 bit). After shifting to Windows 7, when I tried to deploy my GAE code to google, I got below error:

------------ Deploying frontend ------------

Preparing to deploy:
Created staging directory at: 'C:\Users\sbinod\AppData\Local\Temp\appcfg5079868666950863187.tmp'
Scanning for jsp files.
Compiling jsp files.
com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp files.
May 15, 2013 8:04:53 AM org.apache.jasper.JspC initClassLoader
WARNING: TLD files should not be placed in /WEB-INF/lib
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:238)
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:214)
at org.apache.jasper.JspC.processFile(JspC.java:1181)
at org.apache.jasper.JspC.execute(JspC.java:1341)
at com.google.appengine.tools.development.LocalJspC.main(LocalJspC.java:40)
Caused by: java.lang.NullPointerException
at com.google.appengine.tools.development.LocalJspC$LocalCompiler.(LocalJspC.java:53)
... 7 more

I tired many solution like to upgrade GAE SDK to 1.8 and re-installed Java 6 in different folder and change some script into appcfg.cmd, BUT did not worked.

Then I changed my laptop path variable and kept my jdk path before C:\Windows\system32.
So, simply I went to start -> Computer -> Right Click -> Properties - > Advanced System Settings ->
Environment Variable  -> Inside System Variable -> click on Path variable -> Click on Edit button -> Add these path (as per you system) C:\Java\jdk1.6.0_39\bin; at first. -> ok.
Restart Eclipse then try to deploy your code to Google.

Second thing, copy tools.jar from your java JDK (in my caseC:\Java\jdk1.6.0_39\lib\tools.jar) to your Apps Engine SDK (E:\Software\Google_Apps_Engine\appengine-java-sdk-1.8.0\appengine-java-sdk-1.8.0\lib\shared)

Other possible Solution:
There could be any real compilation issue in your JSP file, but while trying to build your project into google apps engine, problem would be show there, then follow these steps to know what exactly issue there:

run \bin\appcfg.cmd update  in a command window, it will provide you with a more detailed output then the plugin does and will most likely enable you to resolve the problem in a matter of minutes.

For Example:
E:\Software\NOC\Eclipse-Juno\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.7.7.1\appengine-java-sdk-\bin>appcfg.cmd update "E:\Binod\Demo\demogaeprojectWorkspace\LIC\war"

Dear Friend,
You can add your feedback if your problem solved by any other way.