File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Cannot find bean ... in any scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find bean ... in any scope" Watch "Cannot find bean ... in any scope" New topic

Cannot find bean ... in any scope

Albert Mora

Joined: Feb 14, 2007
Posts: 2
Hi, i was read the forum for help about struts and logic:iterator, but i have the next problem: sometimes works corretly, and others appears the error: Cannot find bean seguimiento in any scope. The errors appears always in the weblogic log, but sometimes appears the webpage correctly.
Thanks, and sorry for my bad english

My code:



public class ActuMedioambientalForm extends ActionForm implements Serializable {
private SeguimientoBean[] seguimientos;
public void setSeguimientos(SeguimientoBean[] seguimientos) {
this.seguimientos = seguimientos;
public SeguimientoBean[] getSeguimientos() {
return seguimientos;
public SeguimientoBean getSeguimiento(int index)
return seguimientos[index];

public void setSeguimiento(int index, SeguimientoBean seguimiento) {



<logic:iterate indexId="i" name="actuMedioambientalForm" id="seguimiento" property="seguimientos">
<html:text styleClass="caja1" size="10" maxlength="10" name="seguimiento" property="fechaPrevista" indexed="true" />
<html:text styleClass="caja1" size="10" maxlength="10" name="seguimiento" property="fechaReal" indexed="true" />



<form-bean name="actuMedioambientalForm" type="es.indra.tram.control.form.actuMedioambiental.ActuMedioambientalForm"/>

<action path="/actuMedioambiental" type="es.indra.tram.control.action.actuMedioambiental.ActuMedioambiental" name="actuMedioambientalForm" scope="session" validate="false">
<forward name="cargaAlta" path="........"/>
<forward name="seguimiento"path="......"/>



ActuMedioambientalForm actuMedioambientalFrom = (ActuMedioambientalForm) form;

SeguimientoBean[] seguimientos = ActuAmbientalesDAO.getSeguimientos(actuMedioambientalFrom.getIdentificador());
String observacion =
return mapping.findForward("seguimiento");
Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
I had gone through the same problem.
Using logic:iterate to display values will work properly but using it to store will cause the error you have said.

There are two ways around this:

1. You can read about indexing in struts (its not as simpl as adding a method with the int index parameter - I learnt this the hard way!)

2. You can read about DynaActionForms here -

Use DynaActionForm to store your SeguimentioBean[] class and use the c:forEach tag shown there to iterate.

Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
You can also read about indexed properties at the following link if you would like to code using just ActionForms

It is sorta covered in the JavaRanch Style Guide.
subject: Cannot find bean ... in any scope
It's not a secret anymore!