Question

I am getting the following trace

 [#|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

when clicking on the Submit Button

<form action="servletexample" method="post">


<table border="0">

                <tr>
                    <td>Vorname</td>
                    <td><input type="text" name="vorname" /></td>
                </tr>
                <tr>
                    <td>Nachname</td>
                    <td><input type="text" name="nachname" /></td>
                </tr>
                <tr>
                    <td colspan="2"><input type="submit" value="submit" /></td>
                </tr>
            </table>
        </form>

This is my JSP class:

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);
    }

}

I am using Glasfish version 3.

Could anyone give me a quick hint?

EDIT: Added the 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>
Was it helpful?

Solution

It failed due to this Eclipse Generated import, which was in my output.jsp

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

removing it fixed the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top