Skip to content

Conversation

@lprimak
Copy link
Contributor

@lprimak lprimak commented Feb 24, 2025

Description

While working on EAR enhancements, I ran into a few bugs. These are fixed by this PR:

  • EAR CDI deployment module is too sensitive when there are missing components,
    leading to deployment failures on artifacts that should succeed.
  • BDA Context not being initialized in EAR under certain circumstances
  • null key discovered in bundleToBeanDeploymentArchive.put() method
  • Converted currentDeploymentContext from ThreadLocal<Deque> to ThreadLocal as Deque was unnecessary and causing bugs
  • Properly destroying deployment class loader
  • Fixed Json-B to bind to the correct BeanManager in EAR files
  • Added fish.payara.ear-combined-cdi-deployment Application and System property to force "old" EAR behavior

Commit message:

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (https://github.com/payara/Payara/pull/7097)

bugfix: EAR deployment bugs found (https://github.com/payara/Payara/pull/7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired```

Fixes #7201
Fixes #7214
Fixes #7215
Fixes #7233

@Pandrex247 Pandrex247 changed the title Fix deployment bugs discovered while implementing EAR enhancements FISH-10615 Fix deployment bugs discovered while implementing EAR enhancements Feb 24, 2025
@lprimak lprimak marked this pull request as draft February 24, 2025 23:52
@lprimak
Copy link
Contributor Author

lprimak commented Feb 26, 2025

MP-TCK CDIPropertyNameMatchingTest is failing

@lprimak lprimak force-pushed the fix-deployment-bugs branch from 8701480 to 39f8f2e Compare February 28, 2025 19:58
@lprimak lprimak marked this pull request as ready for review February 28, 2025 19:59
@lprimak
Copy link
Contributor Author

lprimak commented Feb 28, 2025

Ready to go.

@lprimak lprimak force-pushed the fix-deployment-bugs branch from fba4f2e to ca72244 Compare February 28, 2025 21:49
- fixed current deployment context - made it a regular thread local, not queue
- only add CDI bundles that are not UNKNOWN
- disable injection on EAR-root context (wrong context mode)
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
@lprimak lprimak force-pushed the fix-deployment-bugs branch from a374a3e to 4f4383c Compare March 7, 2025 06:59
@mkarg
Copy link
Contributor

mkarg commented Mar 8, 2025

Kindly asking to include this in 6.2025.3! 👍 🙏

@Pandrex247
Copy link
Member

Pandrex247 commented Mar 10, 2025

It looks like the previous PRs (#7032 and #7097) actually break the CDI TCK.
Our Jenkins runner was misconfigured and reporting successes of the CDI TCK when it shouldn't have been.

They are being reverted for now to allow Jakarta certification to proceed.

This PR reduces the number of TCK failures from ~30 to 9, but doesn't give us a clean bill of health.
We will investigate what has caused the issue on our end to try and fix it to reapply the reversions, but for now this PR is essentially on hold and can't be accepted until that is done.

@Pandrex247 Pandrex247 added the PR: DO NOT MERGE Don't merge PR until further notice label Mar 10, 2025
@lprimak
Copy link
Contributor Author

lprimak commented Mar 10, 2025

@Pandrex247 you're so quick to revert everything :(

This PR would have probably fixed all the CDK issues... plus it introduces feature flag fish.payara.ear-combined-cdi-deployment system property to revert to the old behaviour..

@mkarg
Copy link
Contributor

mkarg commented Mar 11, 2025

We will investigate what has caused the issue on our end to try and fix it to reapply the reversions, but for now this PR is essentially on hold and can't be accepted until that is done.

Note that this comes with a cost: It effectively prevents people from upgrading 6.2025.1 to 6.2025.2 due to the severe injection faults reported recently! So unless this PR is merged there should not be another broken 6.2025.3 released, to not confuse users even more with existing-but-not-contained bug fixes. Thanks!

BTW, as you are working on that currently, I am about to file another bug report against 6.2025.2: @Inject UriInfo within a JAX-RS component is failing with CDI not finding the injectable, while @Context UriInfo works well still (which is an acceptable workaround). Maybe fixing that will help with the TCK a bit?

Edit: Documented the new bug in #7233 (comment).

@Pandrex247 Pandrex247 changed the base branch from main to FISH-10752-Reapply-EAR-Deployment-Changes-and-Shared-War-Libs March 11, 2025 10:10
@Pandrex247
Copy link
Member

I've created a feature branch to aid collaboration and changed the target of this PR to it.

CDI TCK results with everything removed (current state of main - 7eab25d):

[INFO]  [mvn.test] [INFO] Results:
[INFO]  [mvn.test] [INFO] 
[INFO]  [mvn.test] [INFO] Tests run: 1833, Failures: 0, Errors: 0, Skipped: 0

CDI TCK results of the feature branch without this PR (755db21):

[INFO]  [mvn.test] [INFO] Results:
[INFO]  [mvn.test] [INFO] 
[INFO]  [mvn.test] [ERROR] Failures: 
[INFO]  [mvn.test] [ERROR]   InterceptorEnvironmentJNDITest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy a6f75052-a239-4b1b-9976-dccb3de81ed8.ear
[INFO]  [mvn.test] [ERROR]   InterceptorEnvironmentJNDISessionBeanTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy 448f7626-cbc7-4715-bf81-b4b0a1e7520e.ear
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative02Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnterpriseSelectedAlternative02Test6bccc5f735c7ba514e93742245a4a0ec2def937.ear
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative03Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnterpriseSelectedAlternative03Test55235f7e53868a8211b745f8d2d2a9bbe379e668.ear
[INFO]  [mvn.test] [ERROR]   ApplicationContextSharedTest>Arquillian.run:138->testApplicationScopeActiveDuringRemoteCallToEjb:127 » EJB class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean cannot be cast to class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean (org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @3ba6ae34; org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @153be717)
[INFO]  [mvn.test] [ERROR]   ApplicationScopeEventMultiWarTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy 2b59bbcc-2621-40a9-8604-5341ddb62d87.ear
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest.testRequestScopeActiveDuringAsyncCallToEjb » Execution jakarta.ejb.EJBException: WELD-001303: No active contexts for scope type jakarta.enterprise.context.RequestScoped
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest>Arquillian.run:138->testRequestScopeDestroyedAfterCallToEjbTimeoutMethod:121 expected [true] but found [false]
[INFO]  [mvn.test] [ERROR]   EnterpriseDecoratorOrderingTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnterpriseDecoratorOrderingTest3016bf16d13ec712d9e2804eee189c683ae382f9.ear
[INFO]  [mvn.test] [ERROR]   LibraryInEarTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy LibraryInEarTesta4d0b71bd4b22d27e9862c739c1e02dccf3950.ear
[INFO]  [mvn.test] [ERROR]   MultiWebModuleWithExtensionTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy MultiWebModuleWithExtensionTestc5fdac431ed438cf296a24bd99c4f447cf6259.ear
[INFO]  [mvn.test] [ERROR]   EnterpriseArchiveModulesTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnterpriseArchiveModulesTestb3b0a05066d9bec3659b91c3a2413dfa351982c.ear
[INFO]  [mvn.test] [ERROR]   InstalledLibraryEarTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy InstalledLibraryEarTest22b6d7bbce2828982c91cb252e627d32b1fd58d.ear
[INFO]  [mvn.test] [ERROR]   ResourceAdapterArchiveTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy ResourceAdapterArchiveTestb7b39aaad6160fd179292e9d4b5b8a37819a9a.ear
[INFO]  [mvn.test] [ERROR]   EnterpriseInterceptorOrderingTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnterpriseInterceptorOrderingTest8638fa8328733a82b1cf3db94e50b11c1b7af5.ear
[INFO]  [mvn.test] [ERROR]   EnabledManagedBeanInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnabledManagedBeanInjectionAvailabilityTest6183e0d715fbe1f2653daee0d0a61590548743c.ear
[INFO]  [mvn.test] [ERROR]   EnabledProducerFieldInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnabledProducerFieldInjectionAvailabilityTestd46cd62a1a668591dd754e36467d2e493dcb598.ear
[INFO]  [mvn.test] [ERROR]   EnabledProducerMethodInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnabledProducerMethodInjectionAvailabilityTestc15c39c7aaed37816664942fb81372146d8ec9f.ear
[INFO]  [mvn.test] [ERROR]   EnabledSessionBeanInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy EnabledSessionBeanInjectionAvailabilityTest4985f9b283dbcadc8cb4b4babb1917a8b1a1166.ear
[INFO]  [mvn.test] [ERROR]   InterModuleELResolutionTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy InterModuleELResolutionTest6d07e98f31ae12e5b75aeebd814dee1de4a68.ear
[INFO]  [mvn.test] [ERROR]   InterModuleLookupTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy InterModuleLookupTest3634ccfcc09080a8f91c91cb10e895ebd765a420.ear
[INFO]  [mvn.test] [ERROR]   SelectedAlternativeManagedBeanInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SelectedAlternativeManagedBeanInjectionAvailabilityTesta33bdd2f2c3edcd7292fcb4810273c6f73397d4.ear
[INFO]  [mvn.test] [ERROR]   SelectedAlternativeSessionBeanInjectionAvailabilityTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SelectedAlternativeSessionBeanInjectionAvailabilityTestb19bba92bfde67ea9a7357107583e074403988e.ear
[INFO]  [mvn.test] [ERROR]   SpecializedBeanInjectionNotAvailableTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SpecializedBeanInjectionNotAvailableTest95e9877b16b34ba4f070edc4c04681e1e81aff1e.ear
[INFO]  [mvn.test] [ERROR]   SpecializedProducerMethodInjectionNotAvailableTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SpecializedProducerMethodInjectionNotAvailableTest714b2c123d3899ea251c1c5d29fdf27168da8.ear
[INFO]  [mvn.test] [ERROR]   SpecializationModularity02Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SpecializationModularity02Test50d2fbff9b6daa711bab4fe8d0687de7552f1b63.ear
[INFO]  [mvn.test] [ERROR]   SpecializationModularity04Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy SpecializationModularity04Test4299de18dc775d35939fd68bad211ede351e1ac.ear
[INFO]  [mvn.test] [ERROR]   Specialization05Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy Specialization05Test47c278019cda2a28591c2da2cd43879a89134e1.ear
[INFO]  [mvn.test] [ERROR]   Specialization06Test>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy Specialization06Testd32637292e29145cbdf2ad9c3a4b9ec95c6c9d9.ear
[INFO]  [mvn.test] [INFO] 
[INFO]  [mvn.test] [ERROR] Tests run: 1885, Failures: 29, Errors: 0, Skipped: 64

CDI TCK results of this PR (4f4383c):

[INFO]  [mvn.test] [INFO] Results:
[INFO]  [mvn.test] [INFO]
[INFO]  [mvn.test] [ERROR] Failures:
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative02Test>Arquillian.run:138->testAlternativeSessionBeanSelected:91 expected [org.jboss.cdi.tck.tests.alternative.selection.enterprise.PojoService] but found [org.jboss.cdi.tck.tests.alternative.selection.enterprise.EnterpriseService]
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative03Test>Arquillian.run:138->testDependencyResolvable:117 expected [org.jboss.cdi.tck.tests.alternative.selection.Foo] but found [org.jboss.cdi.tck.tests.alternative.selection.Bar]
[INFO]  [mvn.test] [ERROR]   ApplicationContextSharedTest>Arquillian.run:138->testApplicationScopeActiveDuringRemoteCallToEjb:127 » EJB class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean cannot be cast to class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean (org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @6483acd8; org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @429c6626)
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest.testRequestScopeActiveDuringAsyncCallToEjb » Execution jakarta.ejb.EJBException: WELD-001303: No active contexts for scope type jakarta.enterprise.context.RequestScoped
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest>Arquillian.run:138->testRequestScopeDestroyedAfterCallToEjbTimeoutMethod:121 expected [true] but found [false]
[INFO]  [mvn.test] [ERROR]   ResourceAdapterArchiveTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy ResourceAdapterArchiveTestb7b39aaad6160fd179292e9d4b5b8a37819a9a.ear
[INFO]  [mvn.test] [ERROR]   SpecializationModularity03Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity05Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity06Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [INFO]
[INFO]  [mvn.test] [ERROR] Tests run: 1841, Failures: 9, Errors: 0, Skipped: 9

@lprimak
Copy link
Contributor Author

lprimak commented Mar 11, 2025

Have you reapplied all 3 PRs? Can you try the feature flag? to see if that helps?

@mkarg
Copy link
Contributor

mkarg commented Mar 11, 2025

FYI: I assume this new bug (the one in exactly the linked comment, not just the general issue) is related? 🤔 If not, please tell me. Thanks.

@Pandrex247
Copy link
Member

With all three applied, and with fish.payara.ear-combined-cdi-deployment set to false under server-config:

[INFO]  [mvn.test] [INFO] Results:
[INFO]  [mvn.test] [INFO]
[INFO]  [mvn.test] [ERROR] Failures:
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative02Test>Arquillian.run:138->testAlternativeSessionBeanSelected:91 expected [org.jboss.cdi.tck.tests.alternative.selection.enterprise.PojoService] but found [org.jboss.cdi.tck.tests.alternative.selection.enterprise.EnterpriseService]
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative03Test>Arquillian.run:138->testDependencyResolvable:117 expected [org.jboss.cdi.tck.tests.alternative.selection.Foo] but found [org.jboss.cdi.tck.tests.alternative.selection.Bar]
[INFO]  [mvn.test] [ERROR]   ApplicationContextSharedTest>Arquillian.run:138->testApplicationScopeActiveDuringRemoteCallToEjb:127 » EJB class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean cannot be cast to class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean (org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @1f76a1e8; org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @7126af4a)
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest.testRequestScopeActiveDuringAsyncCallToEjb » Execution jakarta.ejb.EJBException: WELD-001303: No active contexts for scope type jakarta.enterprise.context.RequestScoped
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest>Arquillian.run:138->testRequestScopeDestroyedAfterCallToEjbTimeoutMethod:121 expected [true] but found [false]
[INFO]  [mvn.test] [ERROR]   ResourceAdapterArchiveTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy ResourceAdapterArchiveTestb7b39aaad6160fd179292e9d4b5b8a37819a9a.ear
[INFO]  [mvn.test] [ERROR]   SpecializationModularity03Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity05Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity06Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [INFO]
[INFO]  [mvn.test] [ERROR] Tests run: 1841, Failures: 9, Errors: 0, Skipped: 9

So no difference, unless I'm applying the system property incorrectly

@lprimak
Copy link
Contributor Author

lprimak commented Mar 11, 2025

Sorry yes. Set the property to true

@Pandrex247
Copy link
Member

No difference with the property set to true

[INFO]  [mvn.test] [ERROR] Failures:
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative02Test>Arquillian.run:138->testAlternativeSessionBeanSelected:91 expected [org.jboss.cdi.tck.tests.alternative.selection.enterprise.PojoService] but found [org.jboss.cdi.tck.tests.alternative.selection.enterprise.EnterpriseService]
[INFO]  [mvn.test] [ERROR]   EnterpriseSelectedAlternative03Test>Arquillian.run:138->testDependencyResolvable:117 expected [org.jboss.cdi.tck.tests.alternative.selection.Foo] but found [org.jboss.cdi.tck.tests.alternative.selection.Bar]
[INFO]  [mvn.test] [ERROR]   ApplicationContextSharedTest>Arquillian.run:138->testApplicationScopeActiveDuringRemoteCallToEjb:127 » EJB class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean cannot be cast to class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean (org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @4d08c0ae; org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @29c82d8d)
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest.testRequestScopeActiveDuringAsyncCallToEjb » Execution jakarta.ejb.EJBException: WELD-001303: No active contexts for scope type jakarta.enterprise.context.RequestScoped
[INFO]  [mvn.test] [ERROR]   EJBRequestContextTest>Arquillian.run:138->testRequestScopeDestroyedAfterCallToEjbTimeoutMethod:121 expected [true] but found [false]
[INFO]  [mvn.test] [ERROR]   ResourceAdapterArchiveTest>Arquillian.arquillianBeforeClass:99 » Deployment Could not deploy ResourceAdapterArchiveTestb7b39aaad6160fd179292e9d4b5b8a37819a9a.ear
[INFO]  [mvn.test] [ERROR]   SpecializationModularity03Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity05Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [ERROR]   SpecializationModularity06Test>Arquillian.arquillianBeforeClass:99 » Runtime Expected exception of type jakarta.enterprise.inject.spi.DeploymentException during deployment of _DEFAULT_, but no exception was thrown.
[INFO]  [mvn.test] [INFO]
[INFO]  [mvn.test] [ERROR] Tests run: 1841, Failures: 9, Errors: 0, Skipped: 9

@mkarg
Copy link
Contributor

mkarg commented Mar 13, 2025

Any news? 🤔

@Pandrex247
Copy link
Member

I've had limited time to look at this.

The descriptions from the two EnterpriseSelectedAlternative TCK tests seem to indicate things are bleeding across when they shouldn't, regardless of fish.payara.ear-combined-cdi-deployment configuration.

  • EnterpriseSelectedAlternative02Test
    • EAR deployment with 1 library and 1 war:
      • ear lib - contains Service and a simple service implementation PojoService
      • war - contains EnterpriseService alternative with priority 1000, should be visible for the war only
    • Expected output: EnterpriseService is available for injection in beans in war only
    • Actual output (regardless of fish.payara.ear-combined-cdi-deployment configuration): EnterpriseService available outside of war
  • EnterpriseSelectedAlternative03Test
    • EAR deployment with 2 libraries and 1 war:
      • ear lib - contains Foo TestBean alternative with priority 1000
      • war - contains Bar TestBean alternative with priority 2000, BarProducer Bar alternative producer method, and Bar alternative producer field with priority 1100 with 2 different annotations .
  • Expected output:
    • Foo is available for injection in all beans
    • Bar is available for injection in beans in war only
    • When injecting TestBean, Bar is preferred if visible
    • BarProducer alternative producer method and alternative producer field are both selected and visible in war only
  • Actual output (regardless of fish.payara.ear-combined-cdi-deployment configuration): Bar is available outside of war

Meanwhile the ResourceAdapterArchiveTest fails to deploy with a class cast / class loader exception:

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:class com.sun.enterprise.deployment.ConnectorDescriptor cannot be cast to class com.sun.enterprise.deployment.JndiNameEnvironment (com.sun.enterprise.deployment.ConnectorDescriptor and com.sun.enterprise.deployment.JndiNameEnvironment are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @48cd2ad3) -- class com.sun.enterprise.deployment.ConnectorDescriptor cannot be cast to class com.sun.enterprise.deployment.JndiNameEnvironment (com.sun.enterprise.deployment.ConnectorDescriptor and com.sun.enterprise.deployment.JndiNameEnvironment are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @48cd2ad3)
        at org.glassfish.weld.services.InjectionServicesImpl.registerInjectionTarget(InjectionServicesImpl.java:247)
        at org.jboss.weld.manager.InjectionTargetFactoryImpl.postProcess(InjectionTargetFactoryImpl.java:159)
        at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:94)
        at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:102)
        at org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:82)
        at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:275)
        at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:278)
        at org.jboss.weld.bootstrap.BeanDeployer.createClassBeans(BeanDeployer.java:256)
        at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:256)
        at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:435)
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:87)
        at org.glassfish.weld.WeldDeployer.startWeldBootstrap(WeldDeployer.java:595)
        at org.glassfish.weld.WeldDeployer.processApplicationLoaded(WeldDeployer.java:542)
        at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:427)
        at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:135)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:344)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:573)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:570)

Another test seems to fail with a similar error, though not at deployment time: ApplicationContextSharedTest

Caused by: java.lang.ClassCastException: class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean cannot be cast to class org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean (org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @5187897c; org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean is in unnamed module of loader org.glassfish.javaee.full.deployment.EarClassLoader @4e5e6521)
        at org.jboss.cdi.tck.tests.context.application.ejb.SimpleApplicationBean$Proxy$_$$_WeldClientProxy.getId(Unknown Source)
        at org.jboss.cdi.tck.tests.context.application.ejb.FooBean.ping(FooBean.java:49)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:588)
        at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:408)
        at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4835)
        at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:654)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:834)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:604)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
        at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
        at jdk.internal.reflect.GeneratedMethodAccessor502.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:888)
        at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:833)
        at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:604)
        at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
        at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)

@lprimak if you want to have a crack at it yourself, running the CDI TCK is possible locally though it takes a bit of set up:

  1. Clone https://github.com/payara/jakartaee-10-tck-runners
  2. Initialise the cdi-tck/cditck-porting and cdi-tck/glassfish-cdi-porting-tck submodules.
  3. Update payara.version property in the top level pom to align with your current cached version of Payara (for this PR/branch: 6.2025.3-SNAPSHOT)
  4. Download the CDI TCK and install into your local maven repo: mvn clean install -pl . -pl tck-download/ -pl tck-download/jakarta-cdi-tck/
  5. Install glassfish-cdi-porting-tck: mvn install -f cdi-tck/glassfish-cdi-porting-tck/. If Maven won't resolve the artifacts, try checking out my branch of the submodule which adds the extra repositories rather than relying on settings.xml config.
  6. Run the TCK (managed profile): mvn verify -Ppayara-server-managed -pl . -pl cdi-tck/

Running against remote profile is also possible, but requires moving into cdi-tck/cditck-porting and configuring the glassfish.home property everywhere manually before running from cdi-tck/cditck-porting/glassfish-tck-runner using mvn verify -Pplatform,payara-remote.

@lprimak
Copy link
Contributor Author

lprimak commented Mar 13, 2025

@mkarg Since this is reverted, it's no longer on a critical path.
I am currently in the middle of working on #7165 and don't want to switch contexts.
I think I can look at this again next week.

Andrew, thanks for looking at this, I will get to it as soon as I can.

@lprimak
Copy link
Contributor Author

lprimak commented Mar 13, 2025

Andrew, can I roll all 3 PRs into one? That would make things a lot easier...

@Pandrex247
Copy link
Member

Which three are you referring to?
#7032, #7097, and this? Yeah that's fine
My intent was that once this PR passes the CDI TCK it will get merged into the feature branch, which we will then merge into main.

If you're talking about also pulling in #7165 to this PR (or vice versa) - are they related?
Replacing HK2 Types seems like a different thing (though will touch the same code as this).

I just worry you'll end up with a monster PR that'll be hard to review.

@lprimak
Copy link
Contributor Author

lprimak commented Mar 13, 2025

Which three are you referring to?
#7032, #7097, and this? Yeah that's fine

Correct.

#7165 is definitely a separate thing, and it'll take a while. I still am not sure about the that one as well,
will see how it really performs when done.

@mkarg
Copy link
Contributor

mkarg commented Mar 13, 2025

@mkarg Since this is reverted, it's no longer on a critical path. I am currently in the middle of working on #7165 and don't want to switch contexts. I think I can look at this again next week.

Fine for me! I really appreciate your dedication! Also, this gives me some time for the missing @Inject vs @Context reproducer which I definitively want to run locally against your final patch before it gets merged (so I do hope I may download your patched Payara before it gets released - I will perform a full check with our real-life application to be really sure that 6.2025.3 will work fine before it is published). 😅 Having said that, I just noticed that in fact this PR "somehow" stays on the critical path still, as I just noticed that 6.2024.12 already contains a CDI isolation problem: Once I startup the Payara Monitoring Console app, I cannot @Inject deploymentPlan anymore within my EAR - I assume it is caused by exactly that CDI isolation problem that you originally wanted to fix in 6.2025.2...! 🥴 Anyways, looking forward for next week's "big bang fix"! 😃

@mkarg
Copy link
Contributor

mkarg commented Apr 29, 2025

Don't cry! 🤗

Looks like this really will be the very last bug (at least if we don't break existing fixes, at least for our real-world EAR 😅):

  • Reproducer: reproducer-13.zip
  • 👉 Configure: In contrast to all previous reproducers, you might need to configure this one. The producer MUST successfully execute an external binary (really an arbitrary one). For sake of simplicity, the code uses hostname, as it is found on the PATH on both, Linux and Windows. If this assumption is wrong for your particular environment, then please modify the file WAIMEA/quipsy-waimea-server/quipsy-waimea-server-core/src/main/java/de/quipsy/waimea/server/core/WAIMEAResource.java. If the reproducer fails to execute that binary, you will simply see an exception recorded in the log, but you will not see the actual stack trace we're looking for! So be sure that the binary is found on the PATH, as the stack trace only pops up in the log if the external binary succeeds to run! 👈
  • Build: mvn package
  • Deploy: asadmin deploy --upload .\quipsy-ng\quipsy-ng-ear\target\quipsy-ng-ear.ear
  • Run: curl -k https://<hostname>:8080/api/waimea/jobs/ I'm running Payara on HTTPS/2

Good luck! 🎯

@lprimak
Copy link
Contributor Author

lprimak commented Apr 29, 2025

Got the reproducer.
The following exception is what I get:

[#|2025-04-29T13:05:05.933-0500|WARNING|Payara 6.2025.3|org.glassfish.jersey.server.ServerRuntime$Responder|_ThreadID=123;_ThreadName=http-thread-pool::http-listener-1(2);_TimeMillis=1745949905933;_LevelValue=900;|
  An exception mapping did not successfully produce and processed a response. Logging the exception propagated to the default exception mapper.
java.io.UncheckedIOException: java.io.IOException: Reproducer
	at de.quipsy.waimea.server.core.WAIMEAResource.lambda$renderPDF$0(WAIMEAResource.java:28)
	at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:728)
	at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:706)
	at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2244)
	at de.quipsy.waimea.server.core.WAIMEAResource.renderPDF(WAIMEAResource.java:24)
	at de.quipsy.waimea.server.core.WAIMEAResource$Proxy$_$$_WeldClientProxy.renderPDF(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:274)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:253)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:696)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1554)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:259)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:166)
	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:757)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:577)
	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:158)
	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:372)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:239)
	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:520)
	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:217)
	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:174)
	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:153)
	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:196)
	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:88)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:246)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:178)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:118)
	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:96)
	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:51)
	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:510)
	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:82)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:83)
	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:101)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535)
	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515)
	at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: java.io.IOException: Reproducer
	at de.quipsy.waimea.server.core.WAIMEAResource.lambda$renderPDF$0(WAIMEAResource.java:26)
	... 56 more
|#]

However, I am not sure I understand what the desired behavior is, as it looks like the reproducer is working properly.
I am sure I am missing some piece of the puzzle...
I even tried running it against other versions of Payara that doesn't include my changes, but I get the same exception

@lprimak
Copy link
Contributor Author

lprimak commented Apr 29, 2025

Oh, I think I got it, I have to execute curl multiple times
Never mind, I still don't have it. The behavior is the same for all payara versions, that don't include my changes

@mkarg
Copy link
Contributor

mkarg commented Apr 30, 2025

I only need to execute cURL once, but I can remember that while I was experimenting with the reproducer, there where times when I had to execute cURL multiple times, and it switch results between 40X and 500.

That exception of yours is what everybody expects to actually get: It is what should happen without the bug! So it proofs that the bug exists only on Windows. I assume that on Windows (and only on Windows) some special thread group is used. I can hide the bug (and get your correct stack trace) as soon as I don't spawn a process, but simply use my own thread group. Also I get your correct stack trace as soon as the binary (here: hostname) is not found on PATH. This is why I needed that very complex construction: Only in that specific construction, and as you have proven only on Windows, this is what happens instead:

[2025-04-29T17:52:58.565+0200] [Payara 6.2025.3] [WARNUNG] [] [org.glassfish.jersey.server.ServerRuntime$Responder] [tid: _ThreadID=83 _ThreadName=ForkJoinPool.commonPool-worker-1] [timeMillis: 1745941978565] [levelValue: 900] [[
  An exception mapping did not successfully produce and processed a response. Logging the exception propagated to the default exception mapper.
MultiException stack 1 of 1
org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Managed Bean [class org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper] with qualifiers [@Any @Default] with class class org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper
        at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:409)
        at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:360)
        at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:352)
        at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:83)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:205)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:195)
        at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:52)
        at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:48)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$new$0(ReentrantMapBackedComputingCache.java:55)
        at org.jboss.weld.util.LazyValueHolder$1.computeValue(LazyValueHolder.java:32)
        at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:46)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:72)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:78)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:229)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:674)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:703)
        at org.glassfish.jersey.ext.cdi1x.internal.CdiUtil.getBeanReference(CdiUtil.java:129)
        at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier$1.getInstance(AbstractCdiBeanSupplier.java:77)
        at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier._provide(AbstractCdiBeanSupplier.java:138)
        at org.glassfish.jersey.ext.cdi1x.internal.GenericCdiBeanSupplier.get(GenericCdiBeanSupplier.java:42)
        at org.glassfish.jersey.inject.hk2.InstanceSupplierFactoryBridge.provide(InstanceSupplierFactoryBridge.java:53)
        at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:129)
        at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:466)
        at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
        at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2103)
        at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
        at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
        at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.lambda$getAllServiceHolders$0(AbstractHk2InjectionManager.java:136)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:140)
        at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:30)
        at org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:314)
        at org.glassfish.jersey.internal.inject.Providers.getAllServiceHolders(Providers.java:298)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.lambda$createLazyExceptionMappers$1(ExceptionMapperFactory.java:178)
        at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:321)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.find(ExceptionMapperFactory.java:118)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.findMapping(ExceptionMapperFactory.java:104)
        at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:569)
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:447)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder$4.run(ServerRuntime.java:941)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:963)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:936)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.lambda$whenComplete$1(ResourceMethodInvoker.java:435)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: org.glassfish.weld.WeldProxyException: Could not define classorg.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper$Proxy$_$$_WeldClientProxy
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:168)
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:145)
        at org.jboss.weld.bean.proxy.ProxyFactory.toClass(ProxyFactory.java:937)
        at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:495)
        at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:401)
        ... 65 more
Caused by: org.glassfish.weld.ClassGenerator$ClassDefinitionException: Could not define class 'org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper$Proxy$_$$_WeldClientProxy' by the class loader: jdk.internal.loader.ClassLoaders$AppClassLoader@76ed5528
        at org.glassfish.weld.ClassGenerator.defineClass(ClassGenerator.java:81)
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:166)
        ... 69 more
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.glassfish.weld.ClassGenerator.defineClass(ClassGenerator.java:79)
        ... 70 more
Caused by: java.lang.NoClassDefFoundError: org/glassfish/jersey/spi/ExtendedExceptionMapper
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
        ... 73 more
Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.spi.ExtendedExceptionMapper
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 75 more
]]

[2025-04-29T17:52:58.612+0200] [Payara 6.2025.3] [WARNUNG] [] [org.glassfish.jersey.internal.Errors] [tid: _ThreadID=83 _ThreadName=ForkJoinPool.commonPool-worker-1] [timeMillis: 1745941978612] [levelValue: 900] [[
  The following warnings have been detected: WARNING: Unknown HK2 failure detected:
MultiException stack 1 of 1
org.jboss.weld.exceptions.WeldException: WELD-001524: Unable to load proxy class for bean Managed Bean [class org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper] with qualifiers [@Any @Default] with class class org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper
        at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:409)
        at org.jboss.weld.bean.proxy.ProxyFactory.run(ProxyFactory.java:360)
        at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:352)
        at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:83)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:205)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:195)
        at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:52)
        at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.apply(ClientProxyProvider.java:48)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$new$0(ReentrantMapBackedComputingCache.java:55)
        at org.jboss.weld.util.LazyValueHolder$1.computeValue(LazyValueHolder.java:32)
        at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:46)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:72)
        at org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:78)
        at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:229)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:674)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:703)
        at org.glassfish.jersey.ext.cdi1x.internal.CdiUtil.getBeanReference(CdiUtil.java:129)
        at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier$1.getInstance(AbstractCdiBeanSupplier.java:77)
        at org.glassfish.jersey.ext.cdi1x.internal.AbstractCdiBeanSupplier._provide(AbstractCdiBeanSupplier.java:138)
        at org.glassfish.jersey.ext.cdi1x.internal.GenericCdiBeanSupplier.get(GenericCdiBeanSupplier.java:42)
        at org.glassfish.jersey.inject.hk2.InstanceSupplierFactoryBridge.provide(InstanceSupplierFactoryBridge.java:53)
        at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:129)
        at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:466)
        at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:46)
        at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2103)
        at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
        at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)
        at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.lambda$getAllServiceHolders$0(AbstractHk2InjectionManager.java:136)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.LinkedList$LLSpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllServiceHolders(AbstractHk2InjectionManager.java:140)
        at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllServiceHolders(ImmediateHk2InjectionManager.java:30)
        at org.glassfish.jersey.internal.inject.Providers.getServiceHolders(Providers.java:314)
        at org.glassfish.jersey.internal.inject.Providers.getAllServiceHolders(Providers.java:298)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.lambda$createLazyExceptionMappers$1(ExceptionMapperFactory.java:178)
        at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:321)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.find(ExceptionMapperFactory.java:118)
        at org.glassfish.jersey.internal.ExceptionMapperFactory.findMapping(ExceptionMapperFactory.java:104)
        at org.glassfish.jersey.server.ServerRuntime$Responder.mapException(ServerRuntime.java:569)
        at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:447)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder$4.run(ServerRuntime.java:941)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:963)
        at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.resume(ServerRuntime.java:936)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.lambda$whenComplete$1(ResourceMethodInvoker.java:435)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture.postFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
        at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: org.glassfish.weld.WeldProxyException: Could not define classorg.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper$Proxy$_$$_WeldClientProxy
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:168)
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:145)
        at org.jboss.weld.bean.proxy.ProxyFactory.toClass(ProxyFactory.java:937)
        at org.jboss.weld.bean.proxy.ProxyFactory.createProxyClass(ProxyFactory.java:495)
        at org.jboss.weld.bean.proxy.ProxyFactory.getProxyClass(ProxyFactory.java:401)
        ... 65 more
Caused by: org.glassfish.weld.ClassGenerator$ClassDefinitionException: Could not define class 'org.glassfish.jersey.ext.cdi1x.transaction.internal.TransactionalExceptionMapper$Proxy$_$$_WeldClientProxy' by the class loader: jdk.internal.loader.ClassLoaders$AppClassLoader@76ed5528
        at org.glassfish.weld.ClassGenerator.defineClass(ClassGenerator.java:81)
        at org.glassfish.weld.services.ProxyServicesImpl.defineClass(ProxyServicesImpl.java:166)
        ... 69 more
Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.glassfish.weld.ClassGenerator.defineClass(ClassGenerator.java:79)
        ... 70 more
Caused by: java.lang.NoClassDefFoundError: org/glassfish/jersey/spi/ExtendedExceptionMapper
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
        ... 73 more
Caused by: java.lang.ClassNotFoundException: org.glassfish.jersey.spi.ExtendedExceptionMapper
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 75 more

]]

So how to proceed? 🤔 I can offer to install remote access software on my dev VM so you can remote debug on Windows (you did that some years back in a related case).

@mkarg
Copy link
Contributor

mkarg commented Apr 30, 2025

Anyways, you are right. I have deploy the reproducer to Payara CE 6.2025.4 and the bug shows up there, too. So the bug is not related to your PR. Hence, the bug does not stand in the way of merging it. 😃 I will report it against 6.2025.4 in a separate issue.

@mkarg
Copy link
Contributor

mkarg commented Apr 30, 2025

Reported against Payara CE 6.2025.4: #7324

@mkarg
Copy link
Contributor

mkarg commented Apr 30, 2025

@Pandrex247 I hereby confirm that this PR has no more open issues with our real-world EAR. Hence I do not see any need to further delay merging it to trunk. Having said that, as code was changed since the last TCK run, it might make sense to first run the TCK and all other CDI-related tests before merging.

@Pandrex247
Copy link
Member

I kicked off a full run last night.
While Payara Server Full seems to be fine, Payara Server Web seems to encounter issues with the CDI, JSF, and WebSockets TCKs

I'm verifying if these are valid or if Jenkins just had a blip.

@mkarg
Copy link
Contributor

mkarg commented Apr 30, 2025

I kicked off a full run last night. While Payara Server Full seems to be fine, Payara Server Web seems to encounter issues with the CDI, JSF, and WebSockets TCKs

This is weird. I cannot see how full server can succeed while web-only fails?! 🤔

@lprimak
Copy link
Contributor Author

lprimak commented Apr 30, 2025

While Payara Server Full seems to be fine, Payara Server Web seems to encounter issues with the CDI, JSF, and WebSockets TCKs

@Pandrex247 Yes, this is weird. Do you have a sample stack trace I could look at? I'd just like to sanity check if this is at all related, or could be related. Thank you

@Pandrex247
Copy link
Member

They seem to be failing consistently.
I will get you the server side stack traces tomorrow - the client side traces are just "didn't get what I expected".

@Pandrex247
Copy link
Member

Pandrex247 commented May 1, 2025

So...

The CDI TCK fails on org.jboss.cdi.tck.tests.full.deployment.exclude.ExcludeFiltersTest.testExcludeSystemPropertyActivator, however there aren't any server side errors - the app just deploys ¯\_(ツ)_/¯

So the only thing I can give you is the source and the line it fails on really: ExcludeFiltersTest

[ERROR] org.jboss.cdi.tck.tests.full.deployment.exclude.ExcludeFiltersTest.testExcludeSystemPropertyActivator  Time elapsed: 0.033 s  <<< FAILURE!
java.lang.AssertionError: expected [true] but found [false]
        at org.testng.Assert.fail(Assert.java:99)
        at org.testng.Assert.failNotEquals(Assert.java:1037)
        at org.testng.Assert.assertTrue(Assert.java:45)
        at org.testng.Assert.assertTrue(Assert.java:55)
        at org.jboss.cdi.tck.tests.full.deployment.exclude.ExcludeFiltersTest.assertTypeIsExcluded(ExcludeFiltersTest.java:112)
        at org.jboss.cdi.tck.tests.full.deployment.exclude.ExcludeFiltersTest.testExcludeSystemPropertyActivator(ExcludeFiltersTest.java:107)
...

For WebSockets, I'm really not sure what goes wrong - the web profile distribution of the server just seems to immediately zombie. The TCK runner starts off by deleting domain1 and recreating it with some different ports (which seems to work fine) before then attempting to start the domain - this start just hangs almost immediately. As far as I can tell from the runner it hasn't copied any extra libraries in or done any other config yet - it just immediately hangs on startup.

I can actually verify this locally too - any attempt to start even a clean payara-web has it immediately hang.
How the CDI TCK gets as far as it does is a bit of a mystery if this is the case - may need to double-check that's actually running against payara-web 🤔

@lprimak
Copy link
Contributor Author

lprimak commented May 1, 2025

Ok, I'm able to reproduce the initial hang. This is the root cause of the web TCK failure. It's really weird. Must be some other bug that was uncovered. This is not related to my changes... stay tuned

@lprimak
Copy link
Contributor Author

lprimak commented May 1, 2025

Well, I take it back. The issue is with the code I touched :)

@lprimak
Copy link
Contributor Author

lprimak commented May 1, 2025

@Pandrex247 Please run the TCK on the other branch (which is up-to-date with main)
Thank you

lprimak added a commit to flowlogix/Payara that referenced this pull request May 1, 2025
…I-enabled library JARs (payara#7212)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
@lprimak lprimak marked this pull request as draft May 1, 2025 19:54
lprimak added a commit to flowlogix/Payara that referenced this pull request May 1, 2025
…I-enabled library JARs (payara#7032)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found (payara#7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
lprimak added a commit to flowlogix/Payara that referenced this pull request May 5, 2025
…I-enabled library JARs (payara#7032)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found (payara#7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
…n-ear-libs` system proeprty that's no longer necessary
lprimak added a commit to flowlogix/Payara that referenced this pull request May 5, 2025
…I-enabled library JARs (payara#7032)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found (payara#7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
lprimak added a commit to flowlogix/Payara that referenced this pull request May 5, 2025
…I-enabled library JARs (payara#7032)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found (payara#7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
@lprimak lprimak closed this May 5, 2025
@lprimak
Copy link
Contributor Author

lprimak commented May 5, 2025

Superseded by #7314

lprimak added a commit to flowlogix/Payara that referenced this pull request May 6, 2025
…I-enabled library JARs (payara#7032)

- correctly copy BDA sets for each war in EAR
- Make WAR's CDI beans available in EAR-libs
- read web-fragment.xml from EAR-libs
- processing ear-lib manifest
- de-duplicate BDAs in CDI processing by using LinkedHashSet intead of ArrayList
- made some structures final (cleanup)
- fixed ear and concurrent classloader leaks, including refactored reflection caching

enh: loading JARs from <domain_dir>/lib/warlibs if --properies warlibs=true is specified (payara#7097)

bugfix: EAR deployment bugs found (payara#7212)
- fixed current deployment context - made it a regular thread local, not queue
- actually destroy deployment ClassLoader shareableTemp correctly
- added fish.payara.ear-combined-cdi-deployment property to force combined EAR CDI deployment
- Jax-JS Json-B injection retrives the correct BeanManager based on the actual type of the injection point desired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants