spring-in-action-5-samples
spring-in-action-5-samples copied to clipboard
CHapter 06 - I can't start de apllication
Hello. When i run the command mvnw clean package i get the next:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.615 s <<< FAILURE! - in tacos.TacoCloudApplicationTests [ERROR] contextLoads(tacos.TacoCloudApplicationTests) Time elapsed: 0.001 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/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] Caused by: java.lang.reflect.InvocationTargetException Caused by: java.lang.NullPointerException
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] TacoCloudApplicationTests.contextLoads » IllegalState Failed to load Applicati...
[INFO]
[ERROR] Tests run: 4, Failures: 0, Errors: 1, Skipped: 3
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] taco-cloud-parent .................................. SUCCESS [ 0.283 s]
[INFO] tacocloud-domain ................................... SUCCESS [ 4.553 s]
[INFO] tacocloud-data ..................................... SUCCESS [ 1.317 s]
[INFO] tacocloud-security ................................. SUCCESS [ 1.422 s]
[INFO] tacocloud-api ...................................... SUCCESS [ 1.639 s]
[INFO] tacocloud-ui ....................................... SUCCESS [ 26.006 s]
[INFO] taco-cloud ......................................... FAILURE [ 13.429 s]
[INFO] tacocloud-web ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.808 s
[INFO] Finished at: 2020-04-09T17:50:23-06:00
[INFO] Final Memory: 68M/224M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project taco-cloud: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\jgutierrez\Documents\Projects\Spring\ch06\tacos\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn
i will appreciate any help. Thanks
For me this solution helped(jdk-12) add this dependencies to root pom:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.25.0-GA</version>
</dependency>
here other solutions: https://stackoverflow.com/questions/40058001/error-creating-bean-with-name-entitymanagerfactory-defined-in-class-path-resou
Just change jdk version to jdk8.