无法在AppEngine

时间:2015-09-02 13:30:12

标签: java jsp google-app-engine

我在java中创建了一个测验应用程序,以便在Google App Engine上托管。但是,当我尝试部署它时,它会产生无法编译JSP java类的错误。即使我尝试上传空白JSP。在本地服务器上,一切正常。 错误如下所示。

Eclipse上的控制台错误:

  

------------部署前端------------

     

准备部署:
    在以下位置创建了临时目录:   '/var/folders/2y/f99pqznd5m3g21gbjl7rgjc40000gn/T/appcfg966104224651839827.tmp'

     

扫描jsp文件。     编译jsp文件。   com.google.appengine.tools.admin.JspCompilationException:失败   编译生成的JSP java文件。 2015年9月2日下午6:35:38   org.apache.jasper.JspC processFile INFO:内置文件:/index.jsp

     

可以在中找到调试信息   /private/var/folders/2y/f99pqznd5m3g21gbjl7rgjc40000gn/T/appengine-deploy2339970973769784997.log

我已经尝试过找到解决方法。但到目前为止没有成功。 JSP文件如下所示。它没有做任何事情,我仍然得到错误:

的index.jsp

<html>
<head>
<meta charset="UTF-8">
<title>TechnoQuiz | Registration</title>
<meta
	content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
	name='viewport'>

<link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet"
	type="text/css" />
<link
	href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"
	rel="stylesheet" type="text/css" />
<link href="../../dist/css/AdminLTE.min.css" rel="stylesheet"
	type="text/css" />

</head>
<body class="register-page"
	style="background-repeat: repeat; background-image: url('dist/img/carbon_pattern.png');">
	<div class="register-box">

		<div class="register-box-body">
			<div class="register-logo">
				<a><b>ZapQuiz</b>.Space</a>
			</div>
			<hr>
			<p class="login-box-msg">Please fill in the details below</p>

			<form name="regform">

				<div class="form-group has-feedback">
					<input name="fullname" type="text" class="form-control"
						placeholder="Full name" /> <span
						class="glyphicon glyphicon-user form-control-feedback"></span>
					<p id="err1" class="text-red hidden">Can't be Empty</p>

				</div>
				<div id="email" class="form-group has-feedback">
					<input type="email" class="form-control" placeholder="Email"
						required /> <span
						class="glyphicon glyphicon-envelope form-control-feedback"></span>
					<p id="err2" class="text-red hidden">Can't be Empty</p>

				</div>

				<div id="phone" class="form-group has-feedback">
					<input type="tel" class="form-control" placeholder="Phone" /> <span
						class="glyphicon glyphicon-phone form-control-feedback"></span>
					<p id="err3" class="text-red hidden">Can't be Empty</p>
				</div>

				<div class="row">

					<div class="col-xs-12">
						<button type="submit" class="btn btn-primary btn-block btn-flat">Register</button>
					</div>
				</div>
				<hr>
				<p class="login-box-msg">
					Powered by <strong>Xibeat Technologies</strong>
				</p>

			</form>

		</div>

	</div>



	<script src="../../plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<script src="../../bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>



</body>
</html>

我尝试通过在Temp Directory中生成生成的Java类来解决此问题。但是,我没有看到任何错误。

AppEngine在临时目录中生成JAVA类

package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("<html>\n<head>\n<meta charset=\"UTF-8\">\n<title>TechnoQuiz | Registration</title>\n<meta\n\tcontent='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'\n\tname='viewport'>\n\n<link href=\"../../bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\"\n\ttype=\"text/css\" />\n<link\n\thref=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\"\n\trel=\"stylesheet\" type=\"text/css\" />\n<link href=\"../../dist/css/AdminLTE.min.css\" rel=\"stylesheet\"\n\ttype=\"text/css\" />\n\n</head>\n<body class=\"register-page\"\n\tstyle=\"background-repeat: repeat; background-image: url('dist/img/carbon_pattern.png');\">\n\t<div class=\"register-box\">\n\n\t\t<div class=\"register-box-body\">\n\t\t\t<div class=\"register-logo\">\n\t\t\t\t<a><b>ZapQuiz</b>.Space</a>\n\t\t\t</div>\n\t\t\t<hr>\n\t\t\t<p class=\"login-box-msg\">Please fill in the details below</p>\n\n\t\t\t<form name=\"regform\">\n\n\t\t\t\t<div class=\"form-group has-feedback\">\n\t\t\t\t\t<input name=\"fullname\" type=\"text\" class=\"form-control\"\n\t\t\t\t\t\tplaceholder=\"Full name\" /> <span\n\t\t\t\t\t\tclass=\"glyphicon glyphicon-user form-control-feedback\"></span>\n");
      out.write("\t\t\t\t\t<p id=\"err1\" class=\"text-red hidden\">Can't be Empty</p>\n\n\t\t\t\t</div>\n\t\t\t\t<div id=\"email\" class=\"form-group has-feedback\">\n\t\t\t\t\t<input type=\"email\" class=\"form-control\" placeholder=\"Email\"\n\t\t\t\t\t\trequired /> <span\n\t\t\t\t\t\tclass=\"glyphicon glyphicon-envelope form-control-feedback\"></span>\n\t\t\t\t\t<p id=\"err2\" class=\"text-red hidden\">Can't be Empty</p>\n\n\t\t\t\t</div>\n\n\t\t\t\t<div id=\"phone\" class=\"form-group has-feedback\">\n\t\t\t\t\t<input type=\"tel\" class=\"form-control\" placeholder=\"Phone\" /> <span\n\t\t\t\t\t\tclass=\"glyphicon glyphicon-phone form-control-feedback\"></span>\n\t\t\t\t\t<p id=\"err3\" class=\"text-red hidden\">Can't be Empty</p>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"row\">\n\n\t\t\t\t\t<div class=\"col-xs-12\">\n\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary btn-block btn-flat\">Register</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<hr>\n\t\t\t\t<p class=\"login-box-msg\">\n\t\t\t\t\tPowered by <strong>Xibeat Technologies</strong>\n\t\t\t\t</p>\n\n\t\t\t</form>\n\n\t\t</div>\n\n\t</div>\n\n\n\n\t<script src=\"../../plugins/jQuery/jQuery-2.1.4.min.js\"></script>\n\t<script src=\"../../bootstrap/js/bootstrap.min.js\"\n");
      out.write("\t\ttype=\"text/javascript\"></script>\n\n\n\n</body>\n</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

最后,这是AppEngine-web.xml文件和Web.xml文件。万一它可能会派上用场。

应用服务引擎-web.xml中

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>zapquiz-1054</application>
  <version>1</version>

  <!--
    Allows App Engine to send multiple requests to one instance in parallel:
  -->
  <threadsafe>true</threadsafe>

  <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  </system-properties>      
</appengine-web-app>

的web.xml

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
  
    
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>   
</web-app>

谢谢和问候, Prasun

更新:日志文件如下所示

  

无法更新:   com.google.appengine.tools.admin.JspCompilationException:失败   编译生成的JSP java文件。在   com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:854)     在   com.google.appengine.tools.admin.Application.compileJsps(Application.java:815)     在   com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:629)     在   com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:509)     在   com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)     在   com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:433)     在   com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:158)     在   org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)     在org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

0 个答案:

没有答案