Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail during Maven install (when following the tutorial documentation) #48

Open
phschimm opened this issue Jan 10, 2020 · 0 comments

Comments

@phschimm
Copy link
Member

phschimm commented Jan 10, 2020

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)

  1. 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
@phschimm phschimm added bug and removed bug labels Jan 10, 2020
@phschimm phschimm changed the title Maven tests are failing during deployment Tests fail during Maven install (when following the tutorial documentation) Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant