java - Eclipselink ignores entity classes with lambda expressions -


i building java se 8 (oracle 1.8.0-b129) application eclipselink (2.5.1, tried 2.5.2-m1), , have entity class being ignored eclipelink, despite being correctly annotated , referenced in persistence.xml file. logs show no mention of class, no schema gets generated it, etc. using entity gives 'the abstract schema type unknown' error.

i think have tracked down cause, , thought share. apparently, eclipselink not classes lambda expressions. here simple class reproduces problem:

@entity public class lambdaentity {      @id     private integer id;      public void thelambda() {         arrays.aslist(1, 2, 3).stream().filter(m -> m == 2);     } } 

the lambda expression not have use persistent property, simple existence in class enough. know cause this? i'm guessing eclipelink chokes on generated bytecode, find strange silently ignores class.

if try use entity in association other, eclipselink give error saying entity not defined @ persistence.xml file. part of stacktrace:

local exception stack:  exception [eclipselink-30005] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.persistenceunitloadingexception exception description: exception thrown while searching persistence archives classloader: sun.misc.launcher$appclassloader@3b9a45b3 internal exception: javax.persistence.persistenceexception: exception [eclipselink-28018] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.entitymanagersetupexception exception description: predeployment of persistenceunit [hcm-test] failed. internal exception: exception [eclipselink-7250] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.validationexception exception description: [class com.senior.hcm.domain.organization.workstation] uses non-entity [class com.senior.hcm.domain.auth.userrole] target entity in relationship attribute [field roles].     @ org.eclipse.persistence.exceptions.persistenceunitloadingexception.exceptionsearchingforpersistenceresources(persistenceunitloadingexception.java:127)     @ org.eclipse.persistence.jpa.persistenceprovider.createentitymanagerfactoryimpl(persistenceprovider.java:107)     @ org.eclipse.persistence.jpa.persistenceprovider.createentitymanagerfactory(persistenceprovider.java:177)     @ javax.persistence.persistence.createentitymanagerfactory(persistence.java:79)     @ javax.persistence.persistence.createentitymanagerfactory(persistence.java:54) caused by: javax.persistence.persistenceexception: exception [eclipselink-28018] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.entitymanagersetupexception exception description: predeployment of persistenceunit [hcm-test] failed. internal exception: exception [eclipselink-7250] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.validationexception exception description: [class com.senior.hcm.domain.organization.workstation] uses non-entity [class com.senior.hcm.domain.auth.userrole] target entity in relationship attribute [field roles].     @ org.eclipse.persistence.internal.jpa.entitymanagersetupimpl.createpredeployfailedpersistenceexception(entitymanagersetupimpl.java:1954)     @ org.eclipse.persistence.internal.jpa.entitymanagersetupimpl.predeploy(entitymanagersetupimpl.java:1945)     @ org.eclipse.persistence.internal.jpa.deployment.jpainitializer.callpredeploy(jpainitializer.java:98)     @ org.eclipse.persistence.jpa.persistenceprovider.createentitymanagerfactoryimpl(persistenceprovider.java:96)     ... 28 more caused by: exception [eclipselink-28018] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.entitymanagersetupexception exception description: predeployment of persistenceunit [hcm-test] failed. internal exception: exception [eclipselink-7250] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.validationexception exception description: [class com.senior.hcm.domain.organization.workstation] uses non-entity [class com.senior.hcm.domain.auth.userrole] target entity in relationship attribute [field roles].     @ org.eclipse.persistence.exceptions.entitymanagersetupexception.predeployfailed(entitymanagersetupexception.java:230)     ... 32 more caused by: exception [eclipselink-7250] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.validationexception exception description: [class com.senior.hcm.domain.organization.workstation] uses non-entity [class com.senior.hcm.domain.auth.userrole] target entity in relationship attribute [field roles].     @ org.eclipse.persistence.exceptions.validationexception.nonentitytargetinrelationship(validationexception.java:1378)     @ org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.relationshipaccessor.getreferencedescriptor(relationshipaccessor.java:553)     @ org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.relationshipaccessor.getowningmapping(relationshipaccessor.java:469)     @ org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.manytomanyaccessor.process(manytomanyaccessor.java:149)     @ org.eclipse.persistence.internal.jpa.metadata.metadataproject.processnonowningrelationshipaccessors(metadataproject.java:1566)     @ org.eclipse.persistence.internal.jpa.metadata.metadataproject.processstage3(metadataproject.java:1855)     @ org.eclipse.persistence.internal.jpa.metadata.metadataprocessor.processormmetadata(metadataprocessor.java:580)     @ org.eclipse.persistence.internal.jpa.deployment.persistenceunitprocessor.processormetadata(persistenceunitprocessor.java:585)     @ org.eclipse.persistence.internal.jpa.entitymanagersetupimpl.predeploy(entitymanagersetupimpl.java:1869)     ... 30 more 

as suggested michael jess (thank :)), here link bug report problem. unfortunately have not found time test work has been done there yet, looks promising. problem should not around longer, appears.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -