9

I have AuthenticationFilter and it injects UserController which is annotated with @Singleton. When I deploy my application for the first time - everything is all right, but when I redeploy application and then I try to get something from whichever REST service - often I receive:

Can not set app.auth.UserController field
 app.web.rest.auth.AuthenticationFilter.userController to 
app.auth.UserController$Proxy$_$$_Weld$EnterpriseProxy$

The problem still occurs even if I kill server and restart it. But after couple of restarts issue finally disappears.

Someone knows what could cause that error?

Ziemo
  • 941
  • 8
  • 27

1 Answers1

0

I had experienced this problem too. With each deployment I would get random fails of injecting (EJB) @Singleton and even (CDI) ApplicationScoped. The problem in my case was that I did not have beans.xml. Somehow without the beans.xml the project did not initialize properly.

When I added (a completely empty) beans.xml it was resolved. Hope it helps.

Albert Bos
  • 2,012
  • 1
  • 15
  • 26