无法分配连接,因为:用户ID长度(0)超出1到255的范围

clo*_*oud 5 java netbeans jpa

我正在使用带有JSF,EJB和JPA的Netbeans创建一个登录界面.当我尝试部署项目时,它抛出以下异常:

Internal Exception: java.sql.SQLException: 
Error in allocating a connection. Cause: Connection could not be allocated because: User id length (0) is outside the range of 1 to 255.
Error Code: 0. Please see server.log for more details.
C:\Users\Dell\Desktop\assignmenttask2\nbproject\build-impl.xml:1033: The module has not been deployed.
See the server log for details.
Run Code Online (Sandbox Code Playgroud)

这是怎么造成的,我该如何解决?

PSR*_*PSR 6

你需要在persistence.xml中配置.

<properties>
  <property name="javax.persistence.jdbc.user" value="APP"/>
  <property name="javax.persistence.jdbc.password" value="APP"/>
 </properties>
Run Code Online (Sandbox Code Playgroud)

看这里