Describe the bug
When CDI is scanning a large application with lots of archives (or with visibility of lots of shared archives), it starts with one archive and recursively scans all of its "dependencies". When all the archives have visibility of each other, (e.g. many archives in one location) they're all "dependencies" of each other which means the recursive walk will take as many stack frames as there are archives.
When there are many archives, this can lead to a StackOverflowException.
Stack trace from the error shows many lines like
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
at com.ibm.ws.cdi.impl.weld.BeanDeploymentArchiveImpl.scan(BeanDeploymentArchiveImpl.java:269)
...
Steps to Reproduce
Deploy an app with 1500 archives.
Expected behavior
The app should start.
Diagnostic information:
OpenLiberty Version: Seen on 24.0.0.4, likely affects all versions
Affected feature(s) : Seen on cdi-2.0, likely affects cdi-1.2 +
Java Version: IBM Semeru Runtime Certified Edition (11.0.22+7)
Describe the bug
When CDI is scanning a large application with lots of archives (or with visibility of lots of shared archives), it starts with one archive and recursively scans all of its "dependencies". When all the archives have visibility of each other, (e.g. many archives in one location) they're all "dependencies" of each other which means the recursive walk will take as many stack frames as there are archives.
When there are many archives, this can lead to a
StackOverflowException
.Stack trace from the error shows many lines like
Steps to Reproduce
Deploy an app with 1500 archives.
Expected behavior
The app should start.
Diagnostic information: