Integration issue with ehcache 3 with spring boot 3.x

3,154 views
Skip to first unread message

James Zhang

unread,
May 5, 2023, 9:22:10 AM5/5/23
to ehcache-users
Hey,

We are using ehcache 3.x in our current project without any problem. However, after we upgraded the spring boot version to 3.x, we got a runtime error from ehcache like below:

Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/ValidationEventHandler

Since spring boot 3.x replaced package javax.xml.bin with new package name jakarta.xml.bin, is there any way to configure ehcache to use the new package name?

Thanks!

James Zhang

Hiren Sinh

unread,
May 17, 2023, 2:40:21 AM5/17/23
to ehcache-users
Hi James,

Can you please provide more information on exactly which version of ehcache you are using. Also can you please share the entire stack trace of the issue? It would be helpful if you can share the ehcache configuration.

Thanks,
Hiren

Chris Dennis

unread,
May 17, 2023, 8:52:48 AM5/17/23
to ehcach...@googlegroups.com

If you want to use Ehcache 3 with Jakarta then you need to request that variant in your dependency declarations:

 

In Gradle that means:

 

implementation('org.ehcache:ehcache:3.10.8') {

  capabilities {

    requireCapability('org.ehcache:ehcache-jakarta')

  }

}

 

In Maven it would be:

 

<dependency>

  <groupId>org.ehcache</groupId>

  <artifactId>ehcache</artifactId>

  <version>3.10.8</version>

  <classifier>jakarta</classifier>

</dependency>

 

Let me know if things don’t work out with these changes.

 

Chris

--
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/064a917b-af51-4449-83d2-b217fa0eb511n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages