日期:2014-05-17  浏览次数:20800 次

新手jsp页面错误提示请教
写了一个简单的代码,在本地的tomcat上运行是正常的,一放到服务器上就报错了。

代码原文
Java code

<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>
<%@ page import="com.allinpay.api.internal.util.CryptoUtils"%>
<%@ page import="java.text.DateFormat"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.TimeZone"%>
<%@ page import="java.util.Date"%>

<%
    
String DATE_TIME_FORMAT = "yyyyMMddHHmmss";
String DATE_TIMEZONE = "GMT+8";

String keyData = request.getParameter("keydata"); //= "123456";
//Long  timestamp = Long.parseLong(request.getParameter("timestamp")); //20120310123025L;
Long timestamp = new java.util.Date().getTime();
String dataSecret = "abcdefgh";
String key = com.allinpay.api.internal.util.CryptoUtils.encryptKeyData(keyData,timestamp,dataSecret);
DateFormat df = new SimpleDateFormat(DATE_TIME_FORMAT);
df.setTimeZone(TimeZone.getTimeZone(DATE_TIMEZONE));
String timestamps = df.format(new Date(timestamp));
//key = URLEncoder.encode(key, "UTF-8");
out.print(key+" "+timestamps);
%>



错误提示:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /apis.jsp at line 17

14: //Long timestamp = Long.parseLong(request.getParameter("timestamp")); //20120310123025L;
15: Long timestamp = new java.util.Date().getTime();
16: String dataSecret = "abcdefgh";
17: String key = com.allinpay.api.internal.util.CryptoUtils.encryptKeyData(keyData,timestamp,dataSecret);
18: DateFormat df = new SimpleDateFormat(DATE_TIME_FORMAT);
19: df.setTimeZone(TimeZone.getTimeZone(DATE_TIMEZONE));
20: String timestamps = df.format(new Date(timestamp));


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: com/allinpay/api/internal/util/CryptoUtils
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840)
org.apache.jsp.apis_jsp._jspService(apis_jsp.java:97)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.serv