2014-04-01 37 views
0

我收到下面的跟蹤JSP org.eclipse.persistence.platform.database不存在錯誤

[#|2014-04-01T14:56:57.824+0200|WARNING|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=215;_ThreadName=Thread-1;|StandardWrapperValve[ServletExample]: 
PWC1406: Servlet.service() for servlet ServletExample threw exception 
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation 
for JSP 

PWC6199: Generated servlet error: package 
org.eclipse.persistence.platform.database does not exist 

package com.example.tutorial; 

import java.io.IOException; 

import javax.servlet.ServletException; 
import javax.servlet.annotation.WebServlet; 
import javax.servlet.http.HttpServlet; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 

@WebServlet("/servletexample") 
public class ServletExample extends HttpServlet { 
    private static final long serialVersionUID = 1L; 

    protected void service(HttpServletRequest request, 
      HttpServletResponse response) throws ServletException, IOException { 


     if (request.getParameter("vorname") == null 
       || request.getParameter("nachname") == null) { 
      getServletContext().getRequestDispatcher("/index.jsp").forward(
        request, response); 
      return; 
     } 
     String vorname = request.getParameter("vorname"); 
     String nachname = request.getParameter("nachname"); 

     request.setAttribute("vorname", vorname); 
     request.setAttribute("nachname", nachname); 
     getServletContext().getRequestDispatcher("/output.jsp").forward(
       request, response); 
    } 

} 

我使用Glasfish版本3.

任何人都可以給我一個快速提示嗎?

編輯:增加了output.jsp的

<?xml version="1.0" encoding="ISO-8859-1" ?> 
<%@page import="org.eclipse.persistence.platform.database.FirebirdPlatform"%> 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
    pageEncoding="ISO-8859-1"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 
<title>Insert title here</title> 
</head> 
<body> 
<h1>Your first and last name is:</h1> 
<% 

String vorname = (String)request.getAttribute("vorname"); 
String nachname = (String)request.getAttribute("nachname"); 
out.print(vorname+" "+nachname); 

%> 
</body> 
</html> 
+1

您已經註冊了Servlet代碼。該錯誤似乎是在output.jsp中。你能發佈output.jsp的源代碼嗎? – andih

+0

@andih yepp你是對的,eclipse在output.jsp中生成了一個導入失敗 – CodeFanatic

回答

0

它失敗,原因是此Eclipse中生成的導入,這是我output.jsp的

<%@page import="org.eclipse.persistence.platform.database.FirebirdPlatform"%> 

刪除它解決了這一問題。