Connection could not be allocated because: User id length (0) is outside the range of 1 to 255

java, jpa, netbeans

Solution

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

Problem

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?

Original source