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