SpringMVCDemo
SpringMVCDemo copied to clipboard
关于如何解决persistence.xml问题
问题描述:配置没问题,运行出现错误,提示“defaultPersistenceUnit”找不到。这里一般情况时*dispatcher.xml中value名字与persistence.xml文件名不一致导致的,第二种情况是persistence.xml在发布时丢失,出现这种情况的原因是maven不会將resources java webapp test 以外的其它文件打包。可以將main/java/META-INF移入道main/resources下。链接:https://stackoverflow.com/questions/10871109/where-to-put-persistence-xml-in-library-jar-using-maven
或者配置POM.XML 中build 标签 添加
来源参考: http://outofmemory.cn/code-snippet/3822/maven-compile-bushu-src-main-java-de-resource-file