You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the context of a WAR, we have a simple ServletContextListener to initialize/shutdown our application when it is deployed. We only have one single servlet, so we expect the methods contextInitialized and contextDestroyed to be invoked only once when the application is deployed and undeployed.
Thanks for reporting this. It happens also in Embedded 7.0.5
The reason is that in WebArchivist.postAnnotationProcess(), while GlassFish server processes JARs inside the WAR with a separate scanner, Embedded processes them always with the same scanner. Therefore it will discover each annotation in the WAR file multiple times, each time for each JAR file in the WAR.
It looks like this got broken with #24082, which simplified handling of ScatteredArchive for GlassFish Embedded too much. The new ScatteredWebArchivist.EmbeddedWebScanner is called for the whole WAR and also for each JAR, as before, but after #24082 it reports the classes in the classes directory even when called for nested JARs.
#24570 should fix this, but I raised is as draft for now because there are still some things to do (e.g. tests).
Hello,
In the context of a WAR, we have a simple
ServletContextListener
to initialize/shutdown our application when it is deployed. We only have one single servlet, so we expect the methodscontextInitialized
andcontextDestroyed
to be invoked only once when the application is deployed and undeployed.Here is some piece of code:
Here the log output after the deployment:
In Payara 6.2023.4, the log does only appear once, which is (in my sense) the expected behavior.
Environment:
The text was updated successfully, but these errors were encountered: