spring+jpa

[u]issue:[/u]
2013-12-05 17:20:17.694:INFO::jetty-6.1.26
2013-12-05 17:20:17.850:INFO::No Transaction manager found - if your webapp requires one, please configure one.
2013-12-05 17:20:18.021:INFO:/:Set web app root system property: 'webapp.root' = [D:\projects\fvp\dev\workspace\MFVP\src\main\webapp]
2013-12-05 17:20:18.021:INFO:/:Initializing log4j from [D:\projects\fvp\dev\workspace\MFVP\src\main\webapp\WEB-INF\log4j.properties]
2013-12-05 17:20:18.053:INFO:/:Initializing Spring root WebApplicationContext
2013-12-05 17:20:19 [org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/spring-datasource.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'default' found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)


spring+jpa

[u]solution:[/u]
[b]need define default in persistence.xml[/b]

http://www.cnblogs.com/luxh/archive/2012/05/24/2516282.html
persistence.xml文件必须定义在classpath路径下的META-INF文件夹中。
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: Spring Boot与JPA的结合可以通过添加相应的依赖来实现。在pom.xml文件中,可以添加以下依赖来引入JPA的核心依赖:\[1\] ``` <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> ``` Spring Data JPA是对JPA规范的再次封装抽象,底层使用了Hibernate的JPA技术实现。它是Spring Data家族的一部分,旨在简化基于JPA的存储库的实现。通过使用Spring Data JPA,可以更轻松地构建使用JPA的数据访问层。\[2\]\[3\] #### 引用[.reference_title] - *1* [Spring Boot+JPA](https://blog.csdn.net/qq_52681418/article/details/112716685)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [SpringBoot 一文搞懂Spring JPA](https://blog.csdn.net/matafeiyanll/article/details/124603090)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [SpringBoot环境下JPA的使用](https://blog.csdn.net/m0_49261516/article/details/127212417)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值