我在项目中遇到注释/持久性错误,持久性库抛出
NullPointerException when trying to resolve the entities (org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.discoverMappedSuperclassesAndInheritanceParents(EntityAccessor.java:224)).
如何调试此类错误以查找有关错误原因的更多信息?
在 EntityAccessor
中设置断点并编译调试不起作用,编译器本身似乎没有在 Debug模式下运行。
我正在使用 Netbeans/Java/Maven。
最佳答案
据我了解,您需要在编译中进行调试 - 而不是 Debug模式下的 maven。
使用mvn编译,通过以下方式使用debug模式:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
</configuration>
</plugin>
debuglevel 可以是 CSV 格式中输入的三个值中的任何一个 需要强调的是,debug 和 debuglevel 是 maven 中包含的重要节点。
希望它能以某种方式提供帮助。
引用:maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
关于java - 如何在 Debug模式下编译? (netbeans, java, maven),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8155253/