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-1.7.7.1\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.


4 comments:

  1. Develop apps, accumulate points, win cash prizes & A Nokia Lumia 920 at The #LeagueofDevelopers http://www.developerleague.com/?pcode=LOD1&src=10002

    ReplyDelete
  2. Hi,

    i have been try to solve it for a week and i ddint find any solution!

    Unable to update:
    com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp files.
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:797)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:615)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:418)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
    at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)
    at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:155)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


    Beside of it do you have another solution ?


    JDK = 1.7_40
    SDK= 1.8.5

    ReplyDelete
  3. thanks a lot...you solved a huge problem...it was annoying,..i tried many things but your trick worked finally...

    ReplyDelete

  4. I was getting this below exception while deploy GAE project to goole.
    java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.

    Then I add java path as first in both box 1. User Variable for ***** 2. System variable.

    User Variable for ***
    JAVA_HOME C:\Java\jdk1.7.0_71
    path %JAVA_HOME%\bin;***********

    Same info in System Variable also.

    Thanks

    ReplyDelete

You can put your comments here (Either feedback or your Question related to blog)