无法分配连接,因为:用户ID长度(0)超出1到255的范围 [英] Connection could not be allocated because: User id length (0) is outside the range of 1 to 255

查看:209
本文介绍了无法分配连接,因为:用户ID长度(0)超出1到255的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Netbeans和JSF,EJB和JPA创建登录界面.当我尝试部署项目时,它引发以下异常:

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.

这是怎么引起的,我该如何解决?

解决方案

您需要在persistence.xml中进行配置.

<properties>
  <property name="javax.persistence.jdbc.user" value="APP"/>
  <property name="javax.persistence.jdbc.password" value="APP"/>
 </properties>

请参见此处

I'm creating a login interface using Netbeans with JSF, EJB and JPA. When I try to deploy the project, it throws the below exception:

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.

How is this caused and how can I solve it?

解决方案

you need to configure in persistence.xml .

<properties>
  <property name="javax.persistence.jdbc.user" value="APP"/>
  <property name="javax.persistence.jdbc.password" value="APP"/>
 </properties>

see here

这篇关于无法分配连接,因为:用户ID长度(0)超出1到255的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆