PushEndpoint @Inject doesnt work

UI Components for JSF
Post Reply
dincofaces
Posts: 10
Joined: 06 Jan 2016, 14:36

07 Sep 2016, 08:52

Hello,

I want my push endpoint to be my bean, but when onMessage triggers, transactionService is not injected and stays null.
How can i get this variable to be in the same context?

Code: Select all

@Named
@Scope("session")
@PushEndpoint("/notify")
public class NotifyBean implements Serializable {

	@Inject
	@Qualifier("transactionService")
	private TransactionService transactionService;

    @OnMessage(encoders = {JSONEncoder.class})
    public NotificationTemplate onMessage(NotificationTemplate notificationTemplate) {
		return notificationTemplate;
    }
}

Thanks.
JSF 2.2.10
PrimeFaces 5.3 (Spark Layout 2.1)

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

07 Sep 2016, 09:17

Do you use Spring? Check if there is a atmosphere spring addon.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests