jpa报错 Unable to acquire a connection from driver [null], user [null] and URL [null]

为啥报错

因为你在persistence.xml中没配置你数据库的相应信息

咋解决

persistence.xml在哪里?

咋编辑这东西?

咋配置

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="Project1_Group5_ClientTierApp"
transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>org.client.jpa.User</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/webdevelopmentpracticuum_database?characterEncoding=UTF-8" />
<property name="javax.persistence.jdbc.user" value="你账号一般是root看你改没改过" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.password" value="你密码,我不能告诉你我自己的 />
<property name="eclipelink.ddl-generation" value="create-tables" />
<property name="eclipelink.jdbc.connections.min" value="1" />
<property name="eclipelink.jdbc.connections.max" value="2" />
<property name="eclipelink.logging.level" value="FINEST" /> </properties>
</persistence-unit> </persistence>

jpa报错 Unable to acquire a connection from driver [null], user [null] and URL [null]的更多相关文章

  1. centos6.5环境wget报错Unable to establish SSL connection

    centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...

  2. JPA报错问题修改小结

    项目中在使用线程跑定时任务时,遇到报错,"Could not open JPA EntityManager for transaction Caused by: org.hibernate. ...

  3. delphi调试需要管理员权限程序报错“Unable to create process:请求的操作需要提升”

    delphi调试启动需要UAC权限的程序的时候会报错“Unable to create process:请求的操作需要提升”.这是因为delphi没有以管理员身份启动,这样delphi createp ...

  4. nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】

    转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...

  5. AS添加依赖报错Unable to merge dex

    AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...

  6. linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”

    linux 下通过xhost进入图形界面,经常会出现报错“unable to  open display” linux下的操作步骤如下: [root@localhost ~]# vncserver N ...

  7. git clone 报错Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1

    在执行git clone命令报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange metho ...

  8. Git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc

    git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx. port 12345: no matching cipher found. Their o ...

  9. C# 解决SharpSvn启动窗口报错 Unable to connect to a repository at URL 'svn://....'

    在远程机打开sharpsvn客户端测试,结果报错 Svn启动窗口报错 Unable to connect to a repository at URL 'svn://...' 咋整,我在win10我的 ...

随机推荐

  1. 输出变量的界值(int、float、long.....)

    //整型.浮点型变量表示的关键字,并给出它们各自的界值 #include<iostream> #include<climits> //包含整型数据范围的头文件 #include ...

  2. Java写入的常用技巧

    一.批量写入 Java写入大量数据到磁盘/数据库等其它第三方介质时,由于IO是比较耗费资源的操作,通常采用攒一批然后批量写入的模式 //通常构造一个缓存池,一个限制指标,可以是内存大小也可以是时间 B ...

  3. mysql 数据库备份 -- (定时任务)

    场景: 我们经常需要对数据库备份 方式一:mysql 数据备份方式 在linux 备份方式  通常采用 mysqldump -uroot -ppassword  --database 数据库名 > ...

  4. (一)C语言的四大数据类型

  5. readerwriterqueue 一个用 C++ 实现的快速无锁队列

    https://www.oschina.net/translate/a-fast-lock-free-queue-for-cpp?cmp&p=2 A single-producer, sing ...

  6. golang 要去学习的文档记录

    xrom开发文档地址: http://gobook.io/read/github.com/go-xorm/manual-zh-CN/chapter-10/ golang基础知识: https://ww ...

  7. oracle查看表空间的大小及使用情况sql语句

    --------------------------tablespace------------------------------------------------ 1.//查看表空间的名称及大小 ...

  8. mysql 更新存在就累加,不存在就插入语法

    INSERT INTO tb_http_tomcat_monitor_1 (id,total_res_time,total_req_count,req_dispose_count,queue_size ...

  9. yum源安装mysql数据库 添加密码

    学习mysql数据库时,安装的问题一直很烦恼,linux的不同版本的安装方式都可能不同,这里是我学习时的一些总结.也是刚刚开始学习,大佬勿喷,谢谢啦!!! 1.查看是否已经安装 2.如果没安装 yum ...

  10. Utf8 与 Utf8-BOM 的差异

    1.先说差异,Utf8-BOM编码的字符串比Utf8编码的字符串,多了前缀\xEF\xBF\xBD,肉眼是看不出来的,解析出来的字符串的长度也正常 比如:"123456",Enco ...