Re: Tomcat 11 JSPC using old package names

Luke Kolin <[email protected]>
Newsgroups gmane.comp.jakarta.tomcat.user
Message-ID <CAESxjtuTAv2Rc_bPYWPfijxPKxC9Mcrc_Teh1_Uj6mghMKAJQw@mail.gmail.com>
Thanks again for pointing that out.

I looked at the compiled JSPs and the header in the malformed is like the
following:

/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: JspC/ApacheTomcat9
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package net.afva.jsp.main;

My theory now is that it's a pathing issue, related to my Git usage. The
non-working app is still in the "master" branch, and what I'm doing in Ant
is defining jasper2 as "../<Project1>/lib/jspc/o.a.jsp.JspC" ... so it's
pointing to the "master" branch of Project1, which is still Tomcat9... I
think.

I'll create a proper branch for Project2 and see if that fixes this issue.
If not, I have a turkey to cook. :)

Cheers!

On Thu, Nov 27, 2025 at 10:03 AM Zdeněk Henek <[email protected]> wrote:

> you have typo in the search string try search for "javax.servlet"
> I have done recently upgrade from Tomcat9 to Tomcat 10.1
>
> Try searching in included jsp pages
> Maybe you use JSTL tags?
>
> Regards,
> Zdenek
>
> On Thu, Nov 27, 2025 at 2:51 PM Luke Kolin <[email protected]> wrote:
> >
> > Thanks for the suggestion. Unfortunately there are no imports in that
> JSP,
> > and "java.servlet" doesn't exist anywhere in the code base.
> >
> >
> > On Thu, Nov 27, 2025 at 9:07 AM Zdeněk Henek <[email protected]> wrote:
> >
> > > Hi,
> > >
> > > Are you sure there are no javax.servlet.... imports in afvHome.jsp ?
> > >
> > > This looks like you have there the javax. classes in jsp pages.
> > >
> > > Try Openrewrite
> > > https://docs.openrewrite.org/recipes/java/migrate/jakarta/jakartaee10
> > > to migrate from javax to jakarta package names where needed.
> > > Note some javax package prefixes are not renamed to jakarta.
> > >
> > > Regards,
> > > Zdenek Henek
> > >
> > > On Thu, Nov 27, 2025 at 12:55 PM Luke Kolin <[email protected]> wrote:
> > > >
> > > > I am attempting to port a (very old) app from Tomcat 9 to Tomcat 11,
> > > using
> > > > the new servlet/JSP package names. The app is built using an (even
> older)
> > > > Ant build script that uses JSPC to precompile the JSPs. One webapp
> builds
> > > > correctly, but the second fails - precompilation apparently
> succeeds, but
> > > > the compiled JSPs use the "old" javax.servlet packages instead of the
> > > newer
> > > > jakarta.servlet packages. Here's brief excerpt of the ant output:
> > > >
> > > > [jasper2] Nov 27, 2025 7:46:25 AM
> org.apache.jasper.servlet.TldScanner
> > > > scanJars
> > > >
> > > > [jasper2] INFO: At least one JAR was scanned for TLDs yet contained
> no
> > > > TLDs. Enable debug logging for this logger for a complete list of
> JARs
> > > that
> > > > were scanned but no TLDs were found in them. Skipping unneeded JARs
> > > during
> > > > scanning can improve startup time and JSP compilation time.
> > > >
> > > > [jasper2] Nov 27, 2025 7:46:25 AM org.apache.jasper.JspC processFile
> > > >
> > > > [jasper2] INFO: Built file [/jsp/main/afvHome.jsp]
> > > >
> > > > [jasper2] Nov 27, 2025 7:46:25 AM org.apache.jasper.JspC execute
> > > >
> > > > [jasper2] INFO: Generation completed with [0] errors in [6]
> milliseconds
> > > >
> > > > [javac] Compiling 1 source file to
> > > > C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\build\jsp
> > > >
> > > > [javac]
> > > >
> > >
> C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:24:
> > > > error: package javax.servlet.jsp does not exist
> > > >
> > > > [javac] private static final javax.servlet.jsp.JspFactory
> _jspxFactory =
> > > >
> > > > [javac] ^
> > > >
> > > > [javac]
> > > >
> > >
> C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:108:
> > > > error: package javax.el does not exist
> > > >
> > > > [javac] private volatile javax.el.ExpressionFactory
> > > _el_expressionfactory;
> > > >
> > > > [javac] ^
> > > >
> > > > [javac]
> > > >
> > >
> C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:123:
> > > > error: package javax.el does not exist
> > > >
> > > > [javac] public javax.el.ExpressionFactory
> _jsp_getExpressionFactory() {
> > > >
> > > > [javac] ^
> > > >
> > > > [javac]
> > > >
> > >
> C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:261:
> > > > error: package javax.servlet.http does not exist
> > > >
> > > > [javac] public void _jspService(final
> > > javax.servlet.http.HttpServletRequest
> > > > request, final javax.servlet.http.HttpServletResponse response)
> > > >
> > > > [javac] ^
> > > >
> > > > [javac]
> > > >
> > >
> C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:261:
> > > > error: package javax.servlet.http does not exist
> > > >
> > > > [javac] public void _jspService(final
> > > javax.servlet.http.HttpServletRequest
> > > > request, final javax.servlet.http.HttpServletResponse response)
> > > >
> > > > [javac] ^
> > > >
> > > > Why does JSPC use the "old" package names, and is there anything I
> can do
> > > > to force it? Again, the other webapp seems to work correctly, but I
> am
> > > > unsure of the differences.
> > > >
> > > > Thanks in advance
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [email protected]
> > > For additional commands, e-mail: [email protected]
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.