0

我刚刚创建了一个应用程序,它开始工作正常。然后我生成了一个实体并重新启动它,现在我收到了这个错误。有什么建议么?

我也想知道启动方法之间有什么区别:

  1. mvn 弹簧启动:运行

  2. 咕噜服务器

我得到前者的编译错误,它开始但不会让我对后者进行身份验证。我没有使用 IDE。我只是从 iTerm 运行它。

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jhipster 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.0.2.RELEASE:run (default-cli) @ jhipster >>>
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ jhipster ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jhipster ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 22 resources
[INFO]
[INFO] --- maven-dependency-plugin:2.8:copy (copy) @ jhipster ---
[INFO] Configured Artifact: io.github.jhipster.loaded:agent:0.8:jar
[INFO] Copying agent-0.8.jar to /Users/Dan/work/jhipster-mongo/spring_loaded/springloaded-jhipster.jar
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jhipster ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 80 source files to /Users/Dan/work/jhipster-mongo/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/Dan/work/jhipster-mongo/src/main/java/com/dancancro/picker/domain/Decision.java:[7,33] package org.hibernate.annotations does not exist
[ERROR] /Users/Dan/work/jhipster-mongo/src/main/java/com/dancancro/picker/domain/Decision.java:[8,33] package org.hibernate.annotations does not exist
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.603 s
[INFO] Finished at: 2014-06-19T19:03:32+01:00
[INFO] Final Memory: 28M/135M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jhipster: Compilation failure: Compilation failure:
[ERROR] /Users/Dan/work/jhipster-mongo/src/main/java/com/dancancro/picker/domain/Decision.java:[7,33] package org.hibernate.annotations does not exist
[ERROR] /Users/Dan/work/jhipster-mongo/src/main/java/com/dancancro/picker/domain/Decision.java:[8,33] package org.hibernate.annotations does not exist
[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
4

3 回答 3

2

它只是意味着您的 pom.xml 文件不包含org.hibernate.annotations依赖项

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-annotations</artifactId>
  <version>3.5.6-Final</version>
</dependency>

将其复制并粘贴到标记内的pom.xml文件中:<dependencies> </dependencies>

于 2017-07-21T08:02:36.623 回答
1

hazelcast pom 将休眠视为“提供” cf https://github.com/hazelcast/hazelcast/blob/3.2-fix-eacg/hazelcast-hibernate/hazelcast-hibernate4/pom.xml#L68

您需要添加休眠依赖项

我还没有在主树中看到修复。因此:https ://github.com/jhipster/generator-jhipster/issues/604

于 2014-09-25T13:42:59.407 回答
1

这是 MongoDB 的错误(它使用的是 Hibernate 注释,但不是 Hibernate - 不是一个简单的用例!)。现在已更正。

于 2014-06-20T07:51:28.510 回答