java.lang.NoSuchFieldError: UUID

When I try to deploy my WAR archive on the tomcat 10 I just set up (Debian, Tomcat 10.1.23, MySQL 8.24), I get the following error:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: UUID
at
...
Caused by: java.lang.NoSuchFieldError: UUID
at
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: UUID
at
...
Caused by: java.lang.NoSuchFieldError: UUID
at
...
The only thing I could find on the internet about it was https://stackoverflow.com/q/76296222/6336728 I use Hibernate 6.2.7, so I downgraded to JPA 3.0.12 and Hibernate 6.1.7.Final. Now I get a java.util.zip.ZipException: zip END header not found, even though jar xvf archive.war works fine.
6 Replies
JavaBot
JavaBot11mo ago
This post has been reserved for your question.
Hey @<Tim>! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st11mo ago
The second error looks like maybe the WAR file is corrupt in some way But can you show the whole stack trace you get?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
<Tim>
<Tim>OP11mo ago
(I don't use UUIDs in my code, this is something internal from hibernate/jpa) Uhm it works now 😂 I had to replace all pattern matcher strings like apiUrl + "/auth" with mvc.pattern(apiUrl + "/auth"). This somehow magically fixed it all?? I'm so confused?? Thanks for your help! Always helps me to write a post here when I'm so frustrated/lost that I nearly give up
JavaBot
JavaBot11mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot11mo ago
Post Closed
This post has been closed by <@330307656105328640>.

Did you find this page helpful?