0

I am trying to assign values to my dropdown during page load. I followed the way which is given in this link.

Invoke JSF managed bean action on page load

As per the link, i have tried using both the annotation and constructor type.

but its an exception for me,

 SEVERE: An exception occurred
 javax.faces.FacesException: java.lang.reflect.InvocationTargetException

 Caused by: java.lang.reflect.InvocationTargetException
 Caused by: javax.el.ELException: Detected cyclic reference to managedBean loginBean
 Caused by: javax.faces.el.EvaluationException: Detected cyclic reference to managedBean loginBean

I have just tried to call a function, in that annotated method or constructor, that is,

     @PostConstruct
public void init()
{
receiveclass r=new receiveclass();
r.retrieve();

} 

i cant able to figure out the problem.

Community
  • 1
  • 1
Karthikeyan
  • 757
  • 3
  • 11
  • 25

1 Answers1

2

Detected cyclic reference to managedBean loginBean

You're injecting two different managed beans in each other as @ManagedProperty. This isn't allowed. It should be an one-way injection. Remove the @ManagedProperty referencing the one bean from the other bean.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • ya i have used another bean class, but i dint use any managed property for it, "receiveclass" is my next bean class, wer i have used the retrieve() method to return the list of elements. And also i have another method in the same class for insertion of values while submit method is fired. Even i have tried after removing that managed bean, still it hits me the same error. "Detected cyclic reference to managedBean loginBean". – Karthikeyan Nov 04 '11 at 12:01
  • Perhaps you have still some `` noise left in `faces-config.xml` – BalusC Nov 04 '11 at 12:06