Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/Cac

我在做hibernate的小示例时报的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/Cacheable
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:953)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:596)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType...



解决办法:
javax.persistence.Cacheable 是 JPA 2.0 规范中的东西!

需要加入hibernate中的hibernate-jpa-2.0-api-1.0.0.Final.jar
到path中

你可能感兴趣的:(java,thread,Hibernate,jpa)