79197418

Date: 2024-11-17 14:41:31
Score: 0.5
Natty:
Report link

I discovered that using:

@Autowired
private NewGradeHandler newGradeHandler; 

I was creating a new instance without the previous connections. So, if this happens to you. in the method you want to consume your WebSocket do:

  1. declare:

     @Autowired
     private ApplicationContext applicationContext; // Inyecta el ApplicationContext
    
  2. Use this instance, make sure the String in the getBean method has the sam name as your class:

NewGradeHandler newGradeHandler = applicationContext.getBean("NewGradeHandler",NewGradeHandler.class);

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Jesús Mariscal