Spring JPA 缺少 JAR 引起异常

记录整合中缺少 JAR
文件引起的异常

版本 Spring 3+  Hibernate
4+  JPA  

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

Spring JPA 缺少 JAR 引起异常,布布扣,bubuko.com

时间: 2024-08-24 01:41:11

Spring JPA 缺少 JAR 引起异常的相关文章

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

在使用idea工具开发时,你建文件的时候会根据你的选项下载一些包,但是有时候不全 在我引用jpa的jar包后运行的时候报错: 然后去网上查了一下,是缺少相应的jar包: 以下是相应jar缺失出现的异常(仅供参考): 1.Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to l

SpringBoot JPA懒加载异常 - com.fasterxml.jackson.databind.JsonMappingException: could not initialize proxy

问题与分析 某日忽然发现在用postman测试数据时报错如下: com.fasterxml.jackson.databind.JsonMappingException: could not initialize proxy [com.cbxsoftware.cbx.attachment.entity.RefAttachment#c109ec36e60c4a89a10eabc72416d984] - no Session (through reference chain: com.cbxsoftw

Java axis2.jar包详解及缺少jar包错误分析

Java  axis2.jar包详解及缺少jar包错误分析 一.最小开发jar集 axis2 开发最小jar包集: activation-1.1.jar axiom-api-1.2.13.jar axiom-dom-1.2.13.jar axiom-impl-1.2.13.jar axis2-adb-1.6.2.jar axis2-adb-codegen-1.6.2.jar axis2-codegen-1.6.2.jar axis2-java2wsdl-1.6.2.jar axis2-kerne

Spring Data 系列(三) Spring+JPA(spring-data-commons)

本章是Spring Data系列的第三篇.系列文章,重点不是讲解JPA语法,所以跑开了JPA的很多语法等,重点放在环境搭建,通过对比方式,快速体会Spring 对JPA的强大功能. 准备代码过程中,保持了每个例子的独立性,和简单性,准备的源码包,下载即可使用.如果,对JPA语法想深入研究的话,直接下载在此基础上进行测试. 前言 Spring Data 系列(一) 入门:简单介绍了原生态的SQL使用,以及JdbcTemplate的使用,在这里写SQL的活还需要自己准备. Spring Data 系

spring打包到jar问题

今天把spring打包到一个jar包中,jar运行时抛异常 Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from class path resource [spring.xml] is invalid; nested exception is org.xml.sax.SAXParseExce

spring加载jar包中的多个配置文件[转载]

在使用spring加载jar包中的配置文件时,不支持通配符,需要一个一个引入,如下所示: Java代码 <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:beanconfigs/applicationContext_1.xml, classpath*:beanconfigs/applicationContext_2.xml, ...

springmvc+spring+jpa(hibernate)+redis+maven配置

废话不多少 项目结构 pom.xml配置例如以下 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd

【Java】SVN下载maven项目到eclipse之后,项目红叉,pom.xml出现Missing artifact fakepath:dubbo:jar:2.8.5等缺少jar包情况

刚入公司,从svn上把代码弄下来之后导入eclipse,一般是maven项目,往往项目都会有红叉.如果排除代码本身问题,一般是jar包没有. 鼠标点开pom.xml文件,在约束那里一般有红叉,鼠标放上去一般会提示Missing artifact fakepath:dubbo:jar:2.8.5等提示,表示本地仓库缺少jar包. 如果本地仓库确实没有,一般点击maven-update project,他会自动去私服下载. 如果你本地仓库已经有了,往往是之前没有下完整的.lastUpdated的ja

JAVA框架整合(struct+spring+jpa)之utf8mb4

基于mysql数据库整合框架时出现的数据库字符编码的问题. 解决办法:数据库驱动的版本太高,换成低版本的,主要还是你的架包太不是最新版本,出现的兼容性问题. JAVA框架整合(struct+spring+jpa)之utf8mb4,布布扣,bubuko.com