现在的位置: 首页 > 综合 > 正文

各种曾经遇到的ERROR

2018年02月06日 ⁄ 综合 ⁄ 共 1034字 ⁄ 字号 评论关闭

javax.persistence.PersistenceException: No Persistence provider for EntityManager named

不管是jpa的单独使用还是spring整合jpa等情况下都可能出现这个错误,此时上百度实在解决不了问题,好的办法就是上google。

 下面的链接就是各种可能及解决办法,

http://stackoverflow.com/questions/1158159/no-persistence-provider-for-entitymanager-named(自己一个一个看看,总有一个适合自己的)

帮助我的是,我的理解就是本身在reference libraries有hibernate-entitymanager.jar,再在lib目录下直接放hibernate-entitymanager.jar包,一试就OK了。

Put the "hibernate-entitymanager.jar" in the classpath of application.

If you are running through some IDE, like Eclipse: Project Properties -> Java Build Path -> Libraries.

Otherwise put it in the /lib of your application.

Eclipse项目上出现红色的感叹号,项目启动出现各种错误,如为实现filter和未实现listener

 出现该问题的原因只是你的build path中有jar包错误或者加入了不该加的东西,我这次的错误是由于自己讲一个libd文件放进了build path,找了半天的错误才发现。

Structs2由于FilterDispatcher已经不提倡使用deprecated,使用了可能会出现未知的错误,如"org.apache.struts2.dispatcher.Dispatcher Exception occurred during processing request: NULL"

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> 
改为
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>

抱歉!评论已关闭.