Two Meta-Inf folders - normal structure?

試著忘記壹切 提交于 2019-12-03 17:00:01

The "weird one" location is correct; JSR-220/JSR-317 (Java Persistence API 1.0/2.0) in section 6.2/8.2 say:

The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit. In Java EE, the root of a persistence unit may be one of the following:

  • an EJB-JAR file
  • the WEB-INF/classes directory of a WAR file
  • a jar file in the WEB-INF/lib directory of a WAR file
  • a jar file in the root of the EAR*
  • a jar file in the EAR library directory
  • an application client jar file.

*) Only valid for JPA 1.0

So, directly in a WAR file, the only correct location is WEB-INF/classes/META-INF/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!