Cannot get Glassfish to compile JSP using version 7

I have a legacy application. I am moving from WebSphere to Liferay while working on a Glassfish server.

I got an error while trying to deploy the application to Glassfish:

* org.glassfish.deployment.common.DeploymentException: JSP compilation error: org.apache.jasper.JasperException:

PWC6033: Error compiling Javac for JSP

PWC6199: Servlet generated error: diamond operator is not supported in source 1.5 (use source operator 7 or higher to enable the diamond operator)

PWC6199: Servlet generated error: try-with-resources is not supported in source 1.5 (use source 7 or later to enable try-with-resources)

PWC6199: Servlet Error Generated: Some input files use unverified or unsafe operations.

PWC6199: Servlet generated error: Recompilation with -Xlint: unchecked for details.

- PWC6033: error in compiling Javac for JSP PWC6199: Generated servlet error: diamond operator is not supported in source 1.5 (use operator 7 or higher to enable the diamond operator) *

I added a section to glassfish-web.xml :

<jsp-config> 
<property name="keepgenerated" value="true"> 
<description>Keep a copy of the generated servlet class' java code.</description> 
</property> 
<property name="compilerSourceVM" value="7"/> 
<property name="compilerTargetVM" value="7"/> 
</jsp-config> 

This was immediately resolved on my local machine, but not on the test server we are running on. I could not find a specific solution for this anywhere. Please, help:)

+4
source share
1

GlassFish Domain → Applications Configuration Precompiles JSP ( ). , glassfish-web.xml .

1 , index.jsp :

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.util.Map,java.util.List,java.util.ArrayList"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                       "http://www.w3.org/TR/html4/loose.dtd">

<html>
  <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">


        <title>GlassFish JSP Page</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    <%List <String> testerList = new ArrayList<>(); 
      testerList.add("hello");
    %>  
  </body>
</html> 

" ", PWC6033: Javac JSP

<property name="compilerSourceVM" value="7"/> 
<property name="compilerTargetVM" value="7"/> 

glassfish-web.xml. Precompile , . , GlassFish.

+2

All Articles