0

I'm using spring mvc and dwr, I already made some tests and my configuration works, but now that I'm trying to access the database from the script I get a NullPointerException on this line:

List<Citas> citas = citasManager.select();

Obviously that means that the instance of "citasManager" is not being sent to the script but the property is defined on the bean, so I don't know the correct way I should define my bean so that the class "People" gets the instance.

My bean is defined as follows:

<bean id="dwr" class="dwr.People" scope="session">
    <dwr:remote javascript="People">
        <dwr:include method="createCrowd" />
        <dwr:include method="getMatchingFromLargeCrowd" />
    </dwr:remote>
    <property name="citasManager" ref="citasManager" />
</bean>
Artemio Ramirez
  • 1,116
  • 1
  • 10
  • 23

1 Answers1

0

I didn't know I was supossed to declare the setter method too. Even to everywhere else spring manages them on it's own.

<bean id="dwr" class="dwr.People" scope="session">
    <dwr:remote javascript="People">
        <dwr:include method="createCrowd" />
        <dwr:include method="getMatchingFromLargeCrowd" />
        <dwr:include method="setCitasManager" />
    </dwr:remote>
    <property name="citasManager" ref="citasManager" />
</bean>
Artemio Ramirez
  • 1,116
  • 1
  • 10
  • 23