Karen,

On 3/1/23 10:21 AM, Karen Goh wrote:
  hi Chris,
I am following advice from ClassNotFoundException: javax.servlet.jsp.JspFactory
ClassNotFoundException: javax.servlet.jsp.JspFactory

I have a maven-based app that I copied exactly and tried to run mvn jetty:run 
And now getting this error:Cau...

  where it says scope provided must be added
Anwyay, I have removed the scope and the jars that are put in the lib folder in 
WEB-INF, it is no use.
The same error still persists.
I removed <scope>provided<scope> on all the Jakarat ee replated dependencies as 
shown in the pom just now.
Hope you could advise me now.
Tks.

If you are using jetty:run then you are probably not using Tomcat. >:|

-chris

     On Wednesday, March 1, 2023 at 10:19:18 PM GMT+8, Christopher Schultz 
<ch...@christopherschultz.net> wrote:
Karen,

On 3/1/23 09:09, Karen Goh wrote:
Hello experts,
I need desperate help to fix this java.lang.ClassNotFoundException: 
jakarta.servlet.jsp.JspFactory
Here are my dependencies which I have installed but still Tomcat will still 
purge out the ClassNotFound error :
<dependencies>
           <dependency>
               <groupId>com.fasterxml.jackson.core</groupId>
               <artifactId>jackson-databind</artifactId>
               <version>2.13.3</version>
           </dependency>
           <!-- https://mvnrepository.com/artifact/com.squareup.retrofit2/retrofit 
-->
           <dependency>
               <groupId>com.squareup.retrofit2</groupId>
               <artifactId>retrofit</artifactId>
               <version>2.9.0</version>
           </dependency>
           <dependency>
               <groupId>com.squareup.retrofit2</groupId>
               <artifactId>converter-gson</artifactId>
               <version>2.9.0</version>
           </dependency>
           <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
           <dependency>
               <groupId>com.google.code.gson</groupId>
               <artifactId>gson</artifactId>
               <version>2.10.1</version>
           </dependency>
           <!-- 
https://mvnrepository.com/artifact/jakarta.servlet.jsp.jstl/jakarta.servlet.jsp.jstl-api
 -->
           <dependency>
               <groupId>jakarta.servlet.jsp.jstl</groupId>
               <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
               <version>3.0.0</version>
               <scope>provided</scope>
           </dependency>
           <!-- 
https://mvnrepository.com/artifact/jakarta.platform/jakarta.jakartaee-web-api -->
           <dependency>
               <groupId>jakarta.platform</groupId>
               <artifactId>jakarta.jakartaee-web-api</artifactId>
               <version>10.0.0</version>
               <scope>provided</scope>
           </dependency>
               <dependency>
               <groupId>jakarta.servlet</groupId>
               <artifactId>jakarta.servlet-api</artifactId>
               <version>6.0.0</version>
               <scope>provided</scope>
           </dependency>
           <dependency>
               <groupId>org.glassfish.web</groupId>
               <artifactId>jakarta.servlet.jsp.jstl</artifactId>
               <version>3.0.1</version>
               <scope>provided</scope>
           </dependency>
           <dependency>
           <groupId>jakarta.el</groupId>
           <artifactId>jakarta.el-api</artifactId>
           <version>5.0.0</version>
           <scope>provided</scope>
       </dependency>
I have even attached the jar - jakarta.servlet.jsp.jstl-3.0.1.jar
jakarta.servlet.jsp.jstl-api-3.0.0.jarto the lib folder.
Java 17, Eclipse on Windows 10.
I am not sure how to tackle this problem, as I need to get an assignment 
done.Would appreciate advice from this group.Tks.

Your POM shows both jstl artifacts as "provided" meaning they won't be
downloaded and bundled into your application. I think you actually need
to allow those to be downloaded as they are not provided by Tomcat (I
think! I'm no JSTL expert).

But Tomcat definitely ships with a copy of
jakarta.servlet.jsp.JspFactory so if you are adding a JAR which contains
that class, you are likely causing a conflict.

Tomcat really should be prohibiting that class from being provided by an
application, but maybe you have put it somewhere that is confusing the JVM.

Which lib/ folder did you put those JARs into?

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to