Friday, February 12, 2010

Solving EclipseLink-JPA Connection Error: User id length (0) is outside the range of 1 to 255.

While trying to connect to a database with NetBeans 6.8, EclipseLink - JPA, and Apache Derby / Java DB, I get the following error:

 User id length (0) is outside the range of 1 to 255.

It's because a non-empty username is needed for connection. However, I've put a username and the problem persists.

The solve this problem, edit META-INF/persistence.xml and add the following:
      <property name="javax.persistence.jdbc.user" value="APP"/>
      <property name="javax.persistence.jdbc.password" value="APP"/>
Change user and password to your configuration.

Note: The above works only for JPA 2.0-compliant ORM. For proprietary EclipseLink would be:
      <property name="eclipselink.jdbc.user" value="APP"/>
       <property name="eclipselink.jdbc.password" value="APP"/>

Related resources:


Matthew Cornell said...

Thanks a ton! I'm very new to Java EE and JPA, and you saved a me headaches.

Anonymous said...

Thank you!

polo outlet said... Burberry Outlet Air Max Shoes Coach Black Friday Coach Black Friday Coach Cyber Monday Coach Factory Coach Outlet Factory Coach Outlet USA Coach Purses Factory Coach Purses USA Coach Store Outlet Coach Purses On Sale Monster Beats Outlet Louis Vuitton Outlet Louis Vuitton Factory Marc Jacobs On Sale MCM Outlet MCM 店铺 cheap oakley sunglasses Michael Kors Outlet Michael Kors Outlet Michael Kors Factory Michael Kors Outlet Michael Kors Factory Online Coach Factory Outlet North Face Outlet Online Polo Outlet Store Ralph Lauren UK Sac Longchamp Pairs Coach Outlet Online Coach Factory Oultet Barbour Jackets Outlet Online Canada Goose Outlet Gucci Outlet Online Michael Kors Outlet Moncler Clearance Moncler Jackets Outlet Online North Clearace Outlet Polo Ralph Lauren Outlet Online Woolrich Clearance Michael Kors Factory Outlet Coach Outlet Online USA Beats by Dre Coach Purses Outlet Online Michael Kors USA

Eric Simmons said...

Great and Useful Article.

Online Java Course

Java Online Training

Java Course Online

J2EE training

online J2EE training

Best Recommended books for Spring framework

Java Interview Questions

Java Training Institutes in Chennai

Java Training in Chennai

J2EE Training in Chennai

java j2ee training institutes in chennai

Java Course in Chennai

Nithyanantham M said...

Thanks for sharing this post
Dailymotion video downloader

Try Dailymotion video
to download videos from dailymotion.

Post a Comment

Copyright 2009 Spring vs Java EE Web Dev. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan