On upgrading Hibernate from version 3 to version 5, I got the above error.
Turned out that we were also using Mockito and it also has a dependency on byte buddy. So there was conflict of versions of byet buddy.
So here is fix:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.2.28</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
</exclusions>
</dependency>
exclude the byte-buddy jar from mockito.