ClassNotFoundException on EasyAuth Middleware

Luca Regazzi (ICONSULTING) 21 Reputation points
2025-03-04T18:54:06.08+00:00

We have a Java application deploy on Azure App Service that worked fine until some days ago when we had to deploy an update.

After deploying the update the application become unresponsive and started to return error 500 to every request.

The application is developed with Java 17 and is deployed on Tomcat 10. We have Authentication turned on and that is configured with a custom provider via OpenID.

Since the updated deploy we are seeing the following errors on Application Insights:

java.lang.NoClassDefFoundError: jakarta/json/Json
	at com.microsoft.azure.appservice.servlet5.EasyAuthContext.Parse(EasyAuthContext.java:95)
	at com.microsoft.azure.appservice.servlet5.EasyAuthContext.Parse(EasyAuthContext.java:84)
	at com.microsoft.azure.appservice.servlet5.EasyAuthFilter.getContext(EasyAuthFilter.java:157)
	at com.microsoft.azure.appservice.servlet5.EasyAuthFilter.createRequestForEasyAuth(EasyAuthFilter.java:199)
	at com.microsoft.azure.appservice.servlet5.EasyAuthFilter.doFilter(EasyAuthFilter.java:44)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:663)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ClassNotFoundException: jakarta.json.Json
	... 24 more


We already tried to deploy the previous, functioning, WAR but the error doesn't change and remains the same.

We tried rebooting the app multiple times but nothing changes.

Any suggestions?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,505 questions
{count} votes

Accepted answer
  1. Prabhavathi Manchala 240 Reputation points Microsoft External Staff
    2025-03-06T04:46:43.1933333+00:00

    Hi Luca Regazzi (ICONSULTING),

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer

    Ask:  ClassNotFoundException on EasyAuth Middleware

    Solution: Actually we fixed the problem by downgrading the Tomcat version to the oldest available.

    For now it's ok, we will then investigate why upgrading tomcat version breaks something in EasyAuth (which is not code from our application).

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members. 

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.