Tests fail during Maven install (when following the tutorial documentation)
Opened this issue · 0 comments
phschimm commented
Expected behavior
As a developer, I want test deployment with Maven so that I can make sure, my app runs on a server.
Actual behavior
When running the command mvn install
as described here, the following error occurs:
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 51.021 s <<< FAILURE! - in com.devonfw.application.jtqj.general.service.impl.rest.Securi
tyRestServiceImplTest
[ERROR] testGetCurrentUser Time elapsed: 0.002 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity
[ERROR] testLogin Time elapsed: 0 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity
[ERROR] testGetCsrfToken Time elapsed: 0 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] SecurityRestServiceImplTest.testGetCsrfToken » IllegalState Failed to load App...
[ERROR] SecurityRestServiceImplTest.testGetCurrentUser » IllegalState Failed to load A...
[ERROR] SecurityRestServiceImplTest.testLogin » IllegalState Failed to load Applicatio...
[INFO]
[ERROR] Tests run: 6, Failures: 0, Errors: 3, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jtqj 0.0.1:
[INFO]
[INFO] jtqj ............................................... SUCCESS [ 3.417 s]
[INFO] jtqj-api ........................................... SUCCESS [ 19.981 s]
[INFO] jtqj-core .......................................... FAILURE [01:24 min]
[INFO] jtqj-server ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
Steps to reproduce (bug) / Use Case of feature request (enhancement)
- Follow the written tutorial up until this point.
Related/Dependent Issues
This is related to issue #47.
Comments/Hints:
The error message indicates, that the AccessCodeEntity requires an identifier, however, after adding the following code to src/main/java/accesscodemanagement/dataaccess/api/AccessCodeEntity.java
:
@Id @GeneratedValue
long id;
... and executing mvn clean install
, the same error persisted.
Affected version:
Using the devonfw IDE scripts 3.0.0 beta 25 from here.
- OS: Windows 7
- Browser: not applicable