Execution failed for task ':app-global:enhance'.

Hi, looks like I modified something I shouldn’t have but can’t nail what…
Here is the error I get on trying to assemble.

If it is hard to figure out what is happening, could you point out a way to import existing entities/screens to a clean new project?

Thanks,

[18:32:40.517] Building the project
:compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar UP-TO-DATE :assemble UP-TO-DATE :app-core:assembleDbScripts UP-TO-DATE :app-core:dbScriptsArchive UP-TO-DATE :app-global:compileJava UP-TO-DATE :app-global:enhanceException in thread “main” Local Exception Stack: Exception [EclipseLink-40007] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.StaticWeaveException Exception Description: An exception was thrown while weaving: [Ljava.lang.String;@57f23557 Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [cuba] failed. Internal Exception: Exception [EclipseLink-7217] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.ValidationException Exception Description: The order by value [approval.approver.position], specified on the element [approval] from entity [class com.company.kyuka.entity.LeaveRequest], is invalid. No property or field with that name exists on the target entity [class com.company.kyuka.entity.Approval]. at org.eclipse.persistence.exceptions.StaticWeaveException.exceptionPerformWeaving(StaticWeaveException.java:138) at org.eclipse.persistence.tools.weaving.jpa.CubaStaticWeave.main(CubaStaticWeave.java:37) Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [cuba] failed. Internal Exception: Exception [EclipseLink-7217] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.ValidationException Exception Description: The order by value [approval.approver.position], specified on the element [approval] from entity [class com.company.kyuka.entity.LeaveRequest], is invalid. No property or field with that name exists on the target entity [class com.company.kyuka.entity.Approval]. at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2035) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2026) at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTransformer.buildClassTransformers(StaticWeaveClassTransformer.java:126) at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveClassTransformer.(StaticWeaveClassTransformer.java:76) at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor.process(StaticWeaveProcessor.java:247) at org.eclipse.persistence.tools.weaving.jpa.StaticWeaveProcessor.performWeaving(StaticWeaveProcessor.java:173) at org.eclipse.persistence.tools.weaving.jpa.StaticWeave.start(StaticWeave.java:115) at org.eclipse.persistence.tools.weaving.jpa.CubaStaticWeave.main(CubaStaticWeave.java:35) Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.EntityManagerSetupException Exception Description: Predeployment of PersistenceUnit [cuba] failed. Internal Exception: Exception [EclipseLink-7217] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.ValidationException Exception Description: The order by value [approval.approver.position], specified on the element [approval] from entity [class com.company.kyuka.entity.LeaveRequest], is invalid. No property or field with that name exists on the target entity [class com.company.kyuka.entity.Approval]. at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:231) … 8 more Caused by: Exception [EclipseLink-7217] (Eclipse Persistence Services - 2.6.2.cuba6): org.eclipse.persistence.exceptions.ValidationException Exception Description: The order by value [approval.approver.position], specified on the element [approval] from entity [class com.company.kyuka.entity.LeaveRequest], is invalid. No property or field with that name exists on the target entity [class com.company.kyuka.entity.Approval]. at org.eclipse.persistence.exceptions.ValidationException.invalidOrderByValue(ValidationException.java:976) at org.eclipse.persistence.internal.jpa.metadata.mappings.OrderByMetadata.process(OrderByMetadata.java:143) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.CollectionAccessor.process(CollectionAccessor.java:682) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.processOneToManyMapping(OneToManyAccessor.java:228) at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor.process(OneToManyAccessor.java:143) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processNonOwningRelationshipAccessors(MetadataProject.java:1581) at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1870) at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:577) at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:604) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:1948) … 6 more FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:app-global:enhance’. > Process ‘command ‘C:\Program Files\Java\jdk1.8.0_77\bin\java.exe’’ finished with non-zero exit value 1 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 1.797 secs [18:32:42.361] Task ‘assemble’ failed
org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.8.0_77\bin\java.exe’’ finished with non-zero exit value 1

Ok this was caused by the order query as explained in the error…
Solved - sorry for bothering you :slight_smile:


The order by value [approval.approver.position], specified on the element [approval] from entity [class com.company.kyuka.entity.LeaveRequest], is invalid. No property or field with that name exists on the target entity