org.jboss.weld.exceptions.IllegalStateException: WELD-000227 after every change in code
Asked Answered
S

1

14

I'm developing a webapp with NetBeans and Glassfish 4.1.1. and I'm using JSF and CDI to manage the backing beans for the facelets. Since shortly after changing anything in the code I always get an Internal Server Error with this IllegalStateException after 'successful' deploying and running the app via the browser:

org.jboss.weld.exceptions.IllegalStateException: WELD-000227: Bean 

identifier index inconsistency detected - the distributed container 

probably does not work with identical applications

I can get rid of it by doing a clean & build and redeploying. But NetBeans is redeploying automatically after every save anyway. So I then still have to click on clean and build and then on redeploy myself ALWAYS after any little change, it makes me crazy!

So is there any setting I can change on glassfish server to avoid this, or can I tell NetBeans to clean & build before autodeploy?

It was not always like this, recently I updated glassfish it may be that it appeared only after that, I don't remember exactly anymore.

Thanks in advance! It costs me so much time..

SOLVED

I googled again for hours and found the solution: I set a new system property in glassfish

org.jboss.weld.serialization.beanIdentifierIndexOptimization = false

to avoid the appearing inconsistencies as explained in the WELD reference here:

https://docs.jboss.org/weld/reference/latest/en-US/html/configure.html#_bean_identifier_index_optimization

Stomatology answered 19/3, 2016 at 17:29 Comment(4)
Related: https://mcmap.net/q/830343/-weld-000227-bean-identifier-index-inconsistency-detected-the-distributed-container-probably-doesn-39-t-work-with-identical-applicationsHalfpint
How did you set this property? I'm struggling with the same issue.Burst
in the admin console of glassfish (localhost:4848) go to "server (Admin server)" --> "Properties" --> "System Properties" and add a new property "org.jboss.weld.serialization.beanIdentifierIndexOptimization" with value "false"Stomatology
It worked for Websphere application server 9 also. Thanks.Seineetmarne
A
17

Disable beanIdentifierIndexOptimization in GlassFish as follows:

  1. Visit the admin console at http://localhost:4848 (or https://127.0.0.1:4848/).
  2. Click Configurations.
  3. Click server-config.
  4. Click System Properties.
  5. Click Add Property.
  6. Set Instance Variable Name to: org.jboss.weld.serialization.beanIdentifierIndexOptimization
  7. Set Default Value to: false
  8. Click Save.

This should help with passivation and resolve the following WELD bug:

WELD-000227: Bean identifier index inconsistency detected.

Arellano answered 26/5, 2016 at 8:19 Comment(1)
pull request for double up voting :)Hoang

© 2022 - 2024 — McMap. All rights reserved.