java.lang.NoClassDefFoundError: javax/servlet/DispatcherType after migration to Spring Boot 3.0.0

8,924 views
Skip to first unread message

Branislav Beňo

unread,
Nov 30, 2022, 1:09:04 PM11/30/22
to wiremock-user
Hi Tom, hi guys,

after migration to Spring Boot 3.0.0 appears during `WireMockExtension` following error:

```
javax/servlet/DispatcherType
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:390)
    at java.base/java.lang.Class.forName(Class.java:381)
    at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.getServerConstructor(JettyHttpServerFactory.java:37)
    at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.<clinit>(JettyHttpServerFactory.java:30)
    at com.github.tomakehurst.wiremock.core.WireMockConfiguration.<init>(WireMockConfiguration.java:94)
    at com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig(WireMockConfiguration.java:135)
    at com.github.tomakehurst.wiremock.core.WireMockConfiguration.options(WireMockConfiguration.java:139)
    at com.github.tomakehurst.wiremock.junit5.WireMockExtension.<clinit>(WireMockExtension.java:40)
```

Is there a workaround how to either switch to `jakarta` or temporary import and use `javax`?

Thank you in advance for your response.

Best regards
Branislav

hantsy bai

unread,
Nov 30, 2022, 8:45:06 PM11/30/22
to Branislav Beňo, wiremock-user
I also encountered the issue, using the wiremock-jre8-standalone instead which includes all deps.
---

Regards,

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach, freelancer/remote worker

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy

Medium: https://medium.com/@hantsy


--
You received this message because you are subscribed to the Google Groups "wiremock-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wiremock-use...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wiremock-user/da089d49-a8e5-4610-8849-721522773109n%40googlegroups.com.

Branislav Beňo

unread,
Dec 1, 2022, 4:48:56 AM12/1/22
to wiremock-user
I'm using `wiremock-jre8:2.35.0`
Dátum: štvrtok 1. decembra 2022, čas: 2:45:06 UTC+1, odosielateľ: han...@gmail.com

Johannes Edmeier

unread,
Jan 6, 2023, 7:03:42 AM1/6/23
to wiremock-user
I've switched to wiremock-jre8-standalone to avoid this.

Tom Akehurst

unread,
Jan 6, 2023, 8:27:28 AM1/6/23
to wiremock-user
Have you tried upgrading to 3.0.0-beta-2?

Branislav Beňo

unread,
Jan 7, 2023, 9:06:36 AM1/7/23
to wiremock-user
Yes, I did upgrade to 3.0.0-beta-2 and it solved my problem.
When is 3.0.0 going to be officially released?

Dátum: piatok 6. januára 2023, čas: 14:27:28 UTC+1, odosielateľ: t.m.ak...@googlemail.com

hantsy bai

unread,
Jan 7, 2023, 9:11:27 PM1/7/23
to Branislav Beňo, wiremock-user
>     at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.getServerConstructor(JettyHttpServerFactory.java:37)
    at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.<clinit>(JettyHttpServerFactory.java:30)

I hope 3.0.0 will upgrade to jakarta namespace and use jetty 11+, and update to Jakarta EE 9+.

---

Regards,

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach, freelancer/remote worker

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy

Medium: https://medium.com/@hantsy

Tom Akehurst

unread,
Jan 8, 2023, 1:26:36 PM1/8/23
to wiremock-user
Yes, that's already in there in 3.0.0-beta-2. You should be able to use this right now with Spring Boot 3.
Reply all
Reply to author
Forward
0 new messages