# JWT Authentication example not working?

**URL:** <https://community.auth0.com/t/jwt-authentication-example-not-working/41216>\
**Category:** JWT.io\
**Tags:** spring, java\
**Created:** [April 16, 2020, 9:38pm UTC](https://community.auth0.com/t/jwt-authentication-example-not-working/41216 "2020-04-16T21:38:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rossyoung990](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rossyoung990/32/12835_2.png) [@rossyoung990](https://community.auth0.com/u/rossyoung990)\
**Post date:** [April 16, 2020, 9:38pm UTC](https://community.auth0.com/t/jwt-authentication-example-not-working/41216/1 "2020-04-16T21:38:58Z")

</div>

Hi all I am trying to follow this [JWT Authentication Auth0 Tutorial](https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/) but as soon as I try to gradle build I get the below error. Has this occurred for anyone else?

**Stack Trace:**  
22:10:43.560 [DEBUG] [TestEventLogger] org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory’ defined in class path  
resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.Persistenc  
eException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hiberna  
te.persister.entity.SingleTableEntityPersister

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 29, 2023, 9:43pm UTC](https://community.auth0.com/t/jwt-authentication-example-not-working/41216/2 "2023-08-29T21:43:35Z")

</div>

For future users, please user the following updated tutorial:

> **[Spring Code Sample: Basic API Authorization](https://developer.auth0.com/resources/code-samples/api/spring/basic-authorization)**
>
> Java code sample that implements token-based authorization in a Spring Web API server to protect API endpoints, using Spring Security.

Hope this helps! 🔮

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 12, 2023, 9:43pm UTC](https://community.auth0.com/t/jwt-authentication-example-not-working/41216/3 "2023-09-12T21:43:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
