0

I have 2 beans, one request scoped and 1 session scoped. I'm trying to access the session scoped bean in the request bean by creating a managed-property, but i keep receiving the error:

com.sun.faces.mgbean.ManagedBeanCreationException: Unable to create managed bean tableBacking.  The following problems were found:
     - Property resultsBacking for managed bean tableBacking does not exist.

Here's my request scoped bean:

public class TableLookupBacking {

    private ResultsBacking resultsBacking;

    public void setResultsBacking(ResultsBacking resultsBacking) {
            this.resultsBacking = resultsBacking;
    }
}

Here's my session scoped bean:

public class ResultsBacking {
    // mainly strings and ints stored in here with getters/setters
}

Here's my faces-config.xml

<managed-bean>
    <managed-bean-name>tableBacking</managed-bean-name>
    <managed-bean-class>backing.TableLookupBacking</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
        <property-name>resultsBacking</property-name>
        <value>#{resultsBacking}</value>
    </managed-property>
</managed-bean>

<managed-bean>
    <managed-bean-name>resultsBacking</managed-bean-name>
    <managed-bean-class>backing.ResultsBacking</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
Catfish
  • 18,876
  • 54
  • 209
  • 353
  • Maybe you need a getter for resultsBacking in the class TableLookupBacking? – Magnilex Jan 14 '13 at 20:45
  • 2
    I'm using jsf 1.2. The question is tagged with this. – Catfish Jan 14 '13 at 20:47
  • Sound strange.. I suposse you have deployed and cleaned your server thousand times.. You can try changing property name, something JSF 1.2 doesn't recognize properties and after renaming they work. However you should also try using a getter for that. – Aritz Jan 14 '13 at 20:53
  • @XtremeBiker I renamed the class from TableLookupBacking to TableBacking and cleaned my project and server and it works now. Can you post your comment as an answer so i can give you credit? – Catfish Jan 14 '13 at 21:04
  • Good. Glad to know about that! – Aritz Jan 14 '13 at 21:31

1 Answers1

0

Sometimes JSF gives up recognizing some properties in our backing beans or bean names theirselves, that's related to IDE/server/tooling specific problems. When that happens and you have already tried redeploying and cleaning the project many times it can be a trick to rename classes/properties names. After that everything should work again.

Aritz
  • 30,971
  • 16
  • 136
  • 217
  • 3
    This problem is not JSF specific. This problem is IDE/server/tooling specific. Your answer is basically incorrect and suggestive. – BalusC Jan 15 '13 at 02:21
  • I don't know what the problem is related with, it's an answer based in my own experience.. Do you know another way to go around it? – Aritz Jan 15 '13 at 07:25