问题描述
上面的异常在创建一个hibernate会话工厂时一直在抛出。在应用程序库文件夹中有hibernate-jpa-2.1-api和javax.persistence.2.1.0。我可以在jar中看到NamedStoredProcedureQuery类。但是我得到了classnotfoundexception的运行时错误。任何建议?
NamedStoredProcedureQuery类可用于hibernate-jpa-2.1-api jar。但是这个jar在运行时引用了其他jar。所以我没有在编译时遇到错误,并在运行时遇到异常。我只是通过maven repository添加了其他休眠库。最初我只使用hibernate-core。现在artifactID是hibernate-core,hibernate-validator,hibernate-commons-annotations,hibernate-jpa-2.0-api和hibernate-entitymanager。
Above exception has been throwing While creating a hibernate session factory.
In application lib folder have hibernate-jpa-2.1-api and javax.persistence.2.1.0. I can able to see the NamedStoredProcedureQuery class in both jar. But I am getting runtime error for classnotfoundexception. Any suggestion?
NamedStoredProcedureQuery class is available in hibernate-jpa-2.1-api jar. But this jar refers some other jar in run time. So I didn't get error in compile time and getting exception during runtime. I just added other hibernated libs through maven repository.Initially i used only hibernate-core. Now artifactIDs are hibernate-core,hibernate-validator,hibernate-commons-annotations,hibernate-jpa-2.0-api and hibernate-entitymanager.
这篇关于java.lang.ClassNotFoundException:javax.persistence.NamedStoredProcedureQuery - 休眠错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!