Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » org.eclipse.persistence.exceptions.ValidationException
org.eclipse.persistence.exceptions.ValidationException [message #791997] Mon, 06 February 2012 13:48 Go to next message
Slawomir Korbas is currently offline Slawomir KorbasFriend
Messages: 8
Registered: February 2012
Junior Member
Hello All,

I am new to Eclipse. I stuck since 3 days on strange problem. What I have done:

1. Downloaded and installed Eclipse (eclipse-jee-indigo-SR1-win32-x86_64.zip)
2. Installed GlassFish (glassfish-3.1.1-windows.exe)
3. Installed plugin for Glassfish (for Eclipse Indigio IDE)
4. Created EJB project with facets: Java,EJB,JPA 2.0
5. GlassFish target platform: "GlassFish Server Open Source(Java EE6)"
6. JPA settings - selected as Platform "EclipseLink 2.3"
7. Generated "JPA Entities form Tables"

When I am trying to deploy this application to server I receive following exception:

Exception Description: Predeployment of PersistenceUnit [MegajanServerApp] failed.
Internal Exception: Exception [EclipseLink-7333] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The reference column name [name] mapped on the element [field products] does not correspond to a valid field on the mapping reference.. Please see server.log for more details.

Here is the mapping definition generated in one of my classe:

//bi-directional many-to-many association to Product
@ManyToMany
@JoinTable(
name="job_products"
, joinColumns={
@JoinColumn(name="job_id", nullable=false)
}
, inverseJoinColumns={
@JoinColumn(name="product_name", referencedColumnName="name", nullable=false)
}
)
private List<Product> products;

In my opinion there is no problem with mapping definition but there is a bug in EclipseLink in this validation. I found no solution for this problem on the Web. What I tried:

1. Some people calimed this is case-sensitivity issue in mapping definition but this is not my case. (included in persistence.xml following line <property name="eclipselink.jpa.uppercase-column-names" value="false"/> and problem still exists)
2. Updated everything what I supposed to cause this error. Even EclipseLink 2.4.0 night build.
3. Reinstalled many times GlassFish server 3.1, Eclipse Indigio IDE
4. The strangest thing is that about 2 month ago I did the same things but on other PC machine and it worked fine. ???

I am so disappointed... How can I design reliable, distributed applications with EJB 3.1 if mentioned bugs occur? Maybe I will try NetBeans IDE.
Please, give me any solution to this problem.

Best regards,
Slawek
Re: org.eclipse.persistence.exceptions.ValidationException [message #792042 is a reply to message #791997] Mon, 06 February 2012 14:43 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
You have shown the mapping, but not the mapping for the name field that is referenced by this mapping. Try defining the column name in Product for the field ot be "name" to be sure that case sensitivity isn't causing the issue.

Setting the eclipselink.jpa.uppercase-column-names" value="false" means you are making EclipseLink case sensitive, which is counter to what you want in this case. Use a value of true to workaround case sensitivity, as this will allow the field names to be the same when used in hashcode lookups as well as equality searches.

Best Regards,
Chris
Re: org.eclipse.persistence.exceptions.ValidationException [message #792045 is a reply to message #791997] Mon, 06 February 2012 14:43 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
You have shown the mapping, but not the mapping for the name field that is referenced by this mapping. Try defining the column name in Product for the field ot be "name" to be sure that case sensitivity isn't causing the issue.

Setting the eclipselink.jpa.uppercase-column-names" value="false" means you are making EclipseLink case sensitive, which is counter to what you want in this case. Use a value of true to workaround case sensitivity, as this will allow the field names to be the same when used in hashcode lookups as well as equality searches.

Best Regards,
Chris
Previous Topic:strange Persistence exception with a List type
Next Topic:Bidirectional relationship with orphan removal: NULL-Update to a NOT NULL Column
Goto Forum:
  


Current Time: Mon Dec 22 12:13:29 GMT 2014

Powered by FUDForum. Page generated in 0.03784 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software