https://bz.apache.org/bugzilla/show_bug.cgi?id=64259

            Bug ID: 64259
           Summary: Cannot precompile jsps with jetty-jspc-maven-plugin
                    since 8.5.51
           Product: Tomcat 8
           Version: 8.5.53
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: runningt...@googlemail.com
  Target Milestone: ----

Created attachment 37117
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37117&action=edit
Very simple maven project to reproduce

Since 8.5.51 we cannot precompile jsps. We are using jspc-maven-plugin:

[WARNING] org.apache.jasper.JasperException: javax.el.ELException: Unable to
find ExpressionFactory of type [# Licensed to the Apache Software Foundation
(ASF) under one or more]

This is the stacktrace:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.eclipse.jetty:jetty-jspc-maven-plugin:9.4.24.v20191120:jspc (jspc) on
project ...: Failure processing jsps
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:215)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
   at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
   at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
   at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
   at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
   at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
   at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke (Method.java:566)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:289)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:229)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:415)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failure processing
jsps
   at org.eclipse.jetty.jspc.plugin.JspcMojo.execute (JspcMojo.java:278)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:210)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:156)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute
(MojoExecutor.java:148)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81)
   at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute
(LifecycleStarter.java:128)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
   at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
   at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
   at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
   at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
   at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   at jdk.internal.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:62)
   at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke (Method.java:566)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:289)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:229)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:415)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:356)
Caused by: org.apache.tools.ant.BuildException: Generation completed with [17]
errors in [43] milliseconds
   at org.apache.jasper.JspC.execute (JspC.java:1543)
   at org.eclipse.jetty.jspc.plugin.JspcMojo.compile (JspcMojo.java:347)
   at org.eclipse.jetty.jspc.plugin.JspcMojo.execute (JspcMojo.java:272)

It can be easily reproduced with a simple Maven project:

<dependencies>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jasper</artifactId>
            <version>8.5.53</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>tomcat-jasper-compiler</finalName>
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-jspc-maven-plugin</artifactId>
                <version>9.4.27.v20200227</version>
                <executions>
                    <execution>
                        <id>jspc</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>jspc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                   
<webAppSourceDirectory>${project.basedir}/src/main/webapp</webAppSourceDirectory>
                    <sourceVersion>1.8</sourceVersion>
                    <targetVersion>1.8</targetVersion>
                </configuration>
            </plugin>
        </plugins>
    </build>

With a single jsp in it, "mvn clean install" causes the error. Switching jasper
to 8.5.50 solves it. Debugging revealed that the classname for the expression
factory cannot be resolved, instead it tries to load the first comment from
javax.el.ExpressionFactory services file in tomcat-jasper-el-8.5.53.jar:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

org.apache.el.ExpressionFactoryImpl

Since this is reproduceable with only one dependency (tomcat-jasper) and a very
minimal setup I don't know what I could change.

Thanks,
Marek

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to