转自:https://github.com/payara/Payara/issues/300
项目中使用Glassfish热部署出现WELD IllegalStateException 异常,找到如下解决方式,试过可行:
created a weld.properties file under /src/main/resources with the content
org.jboss.weld.serialization.beanIdentifierIndexOptimization = false
This masked the apparent underlying problems and the exception was not thrown. Setting it to true caused the exception to appear again.
The only code that is session scoped is the PrincipalHolder. Giving him a new serialVersionUID for every deployment also helps avoid the exception.