Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sreeraman A
SessionScoped Managed Beans not getting injected into ManagedProperty
May 8, 2013 9:35 AM
Answer

Sreeraman A

Rank: New Member

Posts: 3

Join Date: April 28, 2013

Recent Posts

Good Day,

I am facing an issue injecting a SessionScoped model bean into a backing bean(also SessionScoped) using a @ManagedProperty in a JSF 2/Primfaces 3.5 portlet. The injection doesn't seem to happen and I get a NullPointerException when using the model bean. The same works fine if the application is run as a plain JSF web application.

I am able to replicate the same issue in the Liferay demo portlet (Primefaces 3 Portlet). Is this an expected behaviour? Is there any configuration that I am missing?

Thanks in advance...
Sreeraman A
RE: SessionScoped Managed Beans not getting injected into ManagedProperty
May 11, 2013 11:00 AM
Answer

Sreeraman A

Rank: New Member

Posts: 3

Join Date: April 28, 2013

Recent Posts

After some research, it turns out that this problem happens when the managed beans implement the serializable interface. After removing serializable, it seems to work fine. We are using JSF 2.1 (Mojarra) and Primefaces 3.5 with Liferay faces Bridge (3.1). This fixes the problem temporarily. However, this can be a problem if the application is deployed in a clustered environment with session replication enabled. Is this a known issue?