strange Persistence exception with a List type [message #790178] |
Fri, 03 February 2012 22:53 |
Missing name Mising name Messages: 34 Registered: October 2010 |
Member |
|
|
My code runs into the following exception:
-----------------------------------------------------------------------
Internal Exception: Exception [EclipseLink-7203] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The mapping element [communities] for the class [class edu.northwestern.at.teams.persistence.Person] has an unsupported collection type [class java.util.List]. Only Set, List, Map and Collection are supported.
------------------------------------------------------------------------
when the Persistence unit is being loaded. The class in question has a field as follows:
/** A list of communities a person participates in */
@OneToMany
@JoinTable
(
name="person_community",
joinColumns= @JoinColumn(name="personId", referencedColumnName="id"),
inverseJoinColumns= @JoinColumn(name="communityId", referencedColumnName="id")
)
private List<Community> communities;
Where both Person and Community are Entity types. Why is the exception being thrown, given that I am using a List<Community> type, and List is supposed to be a supported type, as even the error message suggests?
|
|
|
|
|
|
|
Re: strange Persistence exception with a List type [message #792234 is a reply to message #792148] |
Mon, 06 February 2012 19:39 |
Missing name Mising name Messages: 34 Registered: October 2010 |
Member |
|
|
Sorry for the redundancy, but I just submitted another reply and I don't see it posted here, so I am resending it.
The summary is that after upgrading to the latest version of eclipselink, I am still getting the same type of exception when the persistence unit is being loaded.
Exception Stack is as follows:
--------------------------------
Caused by: Exception [EclipseLink-7203] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The mapping element [owners] for the class [class edu.northwestern.at.teams.persistence.Community] has an unsupported collection type [class java.util.List]. Only Set, List, Map and Collection are supported.
at org.eclipse.persistence.exceptions.ValidationException.invalidCollectionTypeForRelationship(ValidationException.java:1138)
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.CollectionAccessor.process(CollectionAccessor.java:569)
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.process(OneToManyAccessor.java:132)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processOwningRelationshipAccessors(MetadataProject.java:1450)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1685)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:535)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1337)
... 142 more
2012-02-06 12:40:52,477 INFO edu.northwestern.at.teams.persistence.PersistenceService - About to load teams persistence unit: TeamsDevelopment
2012-02-06 12:40:53,058 ERROR edu.northwestern.at.teams.persistence.PersistenceService - Exception while creating EntityManagerFactory
Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@33d6f122
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [TeamsDevelopment] failed.
----------------------------------------
Please advise. Thanks!
/** This community's owners */
@OneToMany
@JoinTable
(
name="nwu_community_person",
joinColumns= @JoinColumn(name="communityId", referencedColumnName="id"),
inverseJoinColumns= @JoinColumn(name="ownerId", referencedColumnName="id")
)
public List<Person> owners;
|
|
|
Re: strange Persistence exception with a List type [message #792236 is a reply to message #792148] |
Mon, 06 February 2012 19:39 |
Missing name Mising name Messages: 34 Registered: October 2010 |
Member |
|
|
Sorry for the redundancy, but I just submitted another reply and I don't see it posted here, so I am resending it.
The summary is that after upgrading to the latest version of eclipselink, I am still getting the same type of exception when the persistence unit is being loaded.
Exception Stack is as follows:
--------------------------------
Caused by: Exception [EclipseLink-7203] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The mapping element [owners] for the class [class edu.northwestern.at.teams.persistence.Community] has an unsupported collection type [class java.util.List]. Only Set, List, Map and Collection are supported.
at org.eclipse.persistence.exceptions.ValidationException.invalidCollectionTypeForRelationship(ValidationException.java:1138)
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.CollectionAccessor.process(CollectionAccessor.java:569)
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.process(OneToManyAccessor.java:132)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processOwningRelationshipAccessors(MetadataProject.java:1450)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1685)
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:535)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:526)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1337)
... 142 more
2012-02-06 12:40:52,477 INFO edu.northwestern.at.teams.persistence.PersistenceService - About to load teams persistence unit: TeamsDevelopment
2012-02-06 12:40:53,058 ERROR edu.northwestern.at.teams.persistence.PersistenceService - Exception while creating EntityManagerFactory
Local Exception Stack:
Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
mailto:org.apache.catalina.loader.StandardClassLoader@33d6f122
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [TeamsDevelopment] failed.
----------------------------------------
Please advise. Thanks!
/** This community's owners */
@OneToMany
@JoinTable
(
name="nwu_community_person",
joinColumns= @JoinColumn(name="communityId", referencedColumnName="id"),
inverseJoinColumns= @JoinColumn(name="ownerId", referencedColumnName="id")
)
public List<Person> owners;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04664 seconds