最近学习Spring-Data-JPA运行时发现缺少jar包报异常!网上找了一下相关信息,留作参考...

在使用idea工具开发时,你建文件的时候会根据你的选项下载一些包,但是有时候不全

在我引用jpa的jar包后运行的时候报错:

然后去网上查了一下,是缺少相应的jar包:

以下是相应jar缺失出现的异常(仅供参考):

1、Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/aop]

 缺少:spring-aop-3.2.0.RELEASE.jar

 

2、Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

 缺少:aopalliance-1.0.jar

 

3、 Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/aspectj/lang/annotation/Around

  缺少:aspectjrt-1.6.9.jar

 

4、 nested exception is java.lang.ClassNotFoundException: org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor

  缺少:spring-orm-3.2.0.RELEASE.jar

 

5、java.lang.NoClassDefFoundError: org/springframework/dao/DataAccessException

  缺少:spring-tx-3.2.0.RELEASE.jar

 

6、nested exception is java.lang.ClassNotFoundException: com.alibaba.druid.pool.DruidDataSource

  缺少:druid-0.2.11.jar

 

7、java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/lookup/DataSourceLookup

  缺少:spring-jdbc-3.2.0.RELEASE.jar

 

8、Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No PersistenceProvider specified in EntityManagerFactory configuration, and chosen PersistenceUnitInfo does not specify a provider class name either

  加上:

    <property name="jpaVendorAdapter"> 
      <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
    </property>

 

9、Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogger

  缺少:jboss-logging-3.1.0.GA.jar

 

10、nested exception is java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence

  缺少:hibernate-entitymanager-4.1.7.Final.jar

 

11、nested exception is java.lang.NoClassDefFoundError: org/hibernate/proxy/EntityNotFoundDelegate

  缺少:hibernate-core-4.1.7.Final.jar

 

12、nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider

  缺少:hibernate-commons-annotations-4.0.1.Final.jar

 

从相关网站转载的(转载地址):http://www.cnblogs.com/xiaota/p/3728821.html

转载于:https://www.cnblogs.com/look-back-upon/p/7589437.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值