Skip to content

Comments

CAUSEWAY-3968: [v2] prepare for static weaving support#3408

Merged
andi-huber merged 12 commits intomaintenance-branchfrom
3968-v2.weaving
Feb 18, 2026
Merged

CAUSEWAY-3968: [v2] prepare for static weaving support#3408
andi-huber merged 12 commits intomaintenance-branchfrom
3968-v2.weaving

Conversation

@andi-huber
Copy link
Contributor

@andi-huber andi-huber commented Feb 17, 2026

Provide concrete entity sub classes (dummies) for abstract entity super classes:

We are using https://github.com/ethlo/eclipselink-maven-plugin

Artifacts

  • causeway-extensions-audittrail-persistence-jpa (AuditTrailEntry)
  • causeway-extensions-commandlog-persistence-jpa (CommandLogEntry)
  • causeway-extensions-excel-fixtures (ExcelDemoToDoItem) has no abstract super-class
  • causeway-extensions-executionlog-persistence-jpa (ExecutionLogEntry)
  • causeway-extensions-executionoutbox-persistence-jpa (ExecutionOutboxEntry)
  • causeway-extensions-secman-persistence-jpa (see below)
  • causeway-extensions-sessionlog-persistence-jpa (SessionLogEntry)

SecMan

  • ApplicationRole
  • ApplicationUser
  • ApplicationPermission
  • ApplicationTenancy

Build

  • verify build flag enhanceEclipselink works
  • backport reflective weaving verification test
  • add abstract classes to reflective weaving verification tests
  • weaved build not working with JDK 11, 21 or 25 (only JDK 17 works)
  • veto dummies for being added to Causeway meta-model
  • update build instructions + changelog (adoc)

Task-Url: https://issues.apache.org/jira/browse/CAUSEWAY-3968

@andi-huber andi-huber self-assigned this Feb 17, 2026
@andi-huber
Copy link
Contributor Author

andi-huber commented Feb 17, 2026

Build with weaving enabled fails tests in org.apache.causeway.extensions.secman.jpa.permission.dom.ApplicationPermissionRepository_IntegTest:

Exception Description: Deployment of PersistenceUnit [default] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.NoSuchMethodError: 'void org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermission.<init>(org.eclipse.persistence.internal.descriptors.PersistenceObject)'
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:801)

This is perhabs due to tests happening before weaving completed in super module, not sure.
If true, potential workaround could be to move failing tests to regression tests, which run later.

UPDATE: No this is due to org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermission not being weaved.

@andi-huber
Copy link
Contributor Author

andi-huber commented Feb 17, 2026

... but more worrying is, that weaving breaks JDO integration tests:

org.apache.causeway.extensions.secman.jdo.permission.dom.ApplicationPermissionRepository_IntegTest.end_to_end -- Time elapsed: 0.121 s <<< FAILURE!
java.lang.AssertionError: 

Expecting actual:
  []
to contain exactly in any order:
  [null, null]
but could not find the following elements:
  [null, null]

	at org.apache.causeway.extensions.secman.applib.ApplicationPermissionRepositoryIntegTestAbstract.end_to_end(ApplicationPermissionRepositoryIntegTestAbstract.java:99)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

UPDATE: fixed (was the Causeway meta-model verification, that failed)

(meta-model)

fixes JDO integration tests when weaving is enabled
excel-fixture does not weaving
@andi-huber
Copy link
Contributor Author

andi-huber commented Feb 17, 2026

Having trouble to weave org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermission. The rest seems good.

Just does not weave. No errors. Dummies are picked up correctly:
persistence.xml

UPDATE: weaved build does work now with JDK 17, but not 11, 21 or 25 (all struggling with the abstract ApplicationPermission)

@andi-huber
Copy link
Contributor Author

andi-huber commented Feb 17, 2026

In org.apache.causeway.extensions.secman.applib.permission.dom.ApplicationPermission found the offending code, that breaks weaving except when using JDK-17:

    public String getSort() {
//        final Enum<?> e = getFeatureSort() != ApplicationFeatureSort.MEMBER
//                ? getFeatureSort()
//                : getMemberSort().orElse(null);
//        return e != null ? e.name(): null;
    	return null;
    }

UPDATE: worked around by extracting offending code into other class

@andi-huber andi-huber marked this pull request as ready for review February 17, 2026 17:14
@andi-huber andi-huber merged commit 912baab into maintenance-branch Feb 18, 2026
1 check passed
@andi-huber andi-huber deleted the 3968-v2.weaving branch February 18, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant