5
votes

I noticed this morning that my JSF application running on GlassFish 4.1 was throwing the following error when my users log out of the web application:

  • WELD-000019: Error destroying an instance null of Managed Bean [...MyAuthenticator] with qualifiers [@Default @Named @Any]

MyAuthenticator is a javax.faces.view.ViewScoped CDI bean with an @PreDestroy annotated method.

As a test, I removed the @PreDestroy annotation and verified that the error disappeared.

I then added the @PreDestroy annotation back to MyAuthenticator along with many debug messages and performed the following tests:

Test 1

  1. Logged into the application.
  2. Logged out of application.

Test 2

  1. Logged into the application.
  2. Allowed session to expire.

The debug messages showed the following behaviour in both tests:

  1. MyAuthenticator is created and the login form is displayed.
  2. MyAuthenticator is destroyed immediately after the user login form is submitted and the user is logged in.
  3. When session is invalidated or expires, Weld throws the reported error.

I believe that error is the result of Weld calling the @PreDestroy method on my already destroyed MyAuthenticator.

Questions

  • Is this a bug in Weld?
  • Can I safely ignore?
1
I have a similar case going on in Tomcat 8.0.21 with Weld and JSF. Did you find out anything and are you still getting the exception? - Panu Haaramo
I am still seeing the issue but have not investigated any further or logged a bug report. - Reed Elliott
Same here on JBoss Wildfly 8.2.0.Final. - vhunsicker
I'm experiencing the same issue running on Tomcat 7+, Weld and JSF. Is there anything you found to solve this? @Reed Elliott - Proverbio
I also get this. No idea what to do. - Thomas Oster

1 Answers

0
votes

This issue is resolved in GlassFish 4.1.2.