java - 无法分配连接,因为 : User id length (0) is outside the range of 1 to 255

标签 java jpa netbeans

我正在使用带有 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.

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

最佳答案

需要在persistence.xml中配置

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

see here

关于java - 无法分配连接,因为 : User id length (0) is outside the range of 1 to 255,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15426853/

相关文章:

java - 将 EditText 设置为单行使其在按 enter 后失去焦点

java - 我可以在 xpath 上应用 where 条件吗?

java - 如何在 jUnit 中测试意外返回结果

java - 有时java枚举是一个字符串

java - 在 Java Elasticsearch SearchRequestBuilder 中找不到方法execute()

java - 在 NetBeans 上 Play Framework 第一个项目无法正常工作

JAVA - 当新文件到达ftp服务器时如何触发

java - JPA @SequenceGenerator 注释如何工作

java - Spring Data JPA 只有一个组合键是自增问题

java - jar 文件中的源可见