0

I'm using Neatbeans to deploy a simple project to GAE, I managed to deploy the "empty" project but now that I added a class I'm getting an error.

When I run: appcfg update C:\Users\lsarni\Documents\NetBeansProjects\TestMemcache\web

I get the following error:

8% Compiling jsp files.
sep 15, 2016 3:16:16 PM org.apache.jasper.JspC processFile
INFO: Built File: \index.jsp
C:\Users\lsarni\AppData\Local\Temp\1473963375861-0\org\apache\jsp\index_jsp.java:6: error: package Memcache does not exist
import Memcache.GoogleMemcache;
               ^
C:\Users\lsarni\AppData\Local\Temp\1473963375861-0\org\apache\jsp\index_jsp.java:6: error: package Memcache does not exist
import Memcache.GoogleMemcache;
               ^
C:\Users\lsarni\AppData\Local\Temp\1473963375861-0\org\apache\jsp\index_jsp.java:56: error: cannot find symbol
        GoogleMemcache x = new GoogleMemcache();
        ^
  symbol:   class GoogleMemcache
  location: class index_jsp
C:\Users\lsarni\AppData\Local\Temp\1473963375861-0\org\apache\jsp\index_jsp.java:56: error: cannot find symbol
        GoogleMemcache x = new GoogleMemcache();
                               ^
  symbol:   class GoogleMemcache
  location: class index_jsp
3 errors

com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files.
Unable to update app: Failed to compile the generated JSP java files.

The log says:

Unable to update:
com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files.
    at com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:1048)
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:1001)
    at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:776)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:708)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:570)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:57)
    at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1490)
    at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:357)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:218)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:119)
    at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:115)
com.google.appengine.tools.admin.AdminException: Unable to update app: Failed to compile the generated JSP java files.
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:578)
    at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:57)
    at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1490)
    at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:357)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:218)
    at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:119)
    at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:115)
Caused by: com.google.appengine.tools.admin.JspCompilationException: Failed to compile the generated JSP java files.
    at com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:1048)
    at com.google.appengine.tools.admin.Application.compileJsps(Application.java:1001)
    at com.google.appengine.tools.admin.Application.populateStagingDirectory(Application.java:776)
    at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:708)
    at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:570)
    ... 6 more

This is the structure of my project, I'm not sure if placing the class GoogleMemcache there is the right thing to do.

enter image description here

Clean and build from Netbeans work just fine.

This is the code in index.jsp:

<%@page import ="Memcache.GoogleMemcache" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
        GoogleMemcache x = new GoogleMemcache();
        %>
    </body>
</html>

I have tried the different answers I found to similar questions without any luck.

moondaisy
  • 4,303
  • 6
  • 41
  • 70

2 Answers2

0

Instead of using scriplet tag for declaration of Object x

<%  GoogleMemcache x = new GoogleMemcache(); %>

use declarative tag

<%!  GoogleMemcache x = new GoogleMemcache(); %>
0

In the end I was trying to deploy the wrong folder:

appcfg update C:\Users\lsarni\Documents\NetBeansProjects\TestMemcache\web

Should have been:

appcfg update C:\Users\lsarni\Documents\NetBeansProjects\TestMemcache\build\web

I realized that was the wrong one because it was missing a META-INF folder so it didn't match the one described in this answer

Community
  • 1
  • 1
moondaisy
  • 4,303
  • 6
  • 41
  • 70