Buenas, a ver si me podéis echar un cable que me estoy volviendo loco xD
Estoy haciendo una aplicación en JavaEE y tengo el siguiente código:
public class AddReserveRoomAction extends Action
{
private ReserveRoomsServiceBO reserveRoomsServiceBO;
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
String AccionError = "";
List<EmpleadoBean> listaEmpleadoBean = reserveRoomsServiceBO.getRequestRooms();
return (!AccionError.equals(""))
? mapping.findForward("fallo")
: mapping.findForward("exito");
}
public ReserveRoomsServiceBO getReserveRoomsServiceBO() {
return reserveRoomsServiceBO;
}
public void setReserveRoomsServiceBO(ReserveRoomsServiceBO reserveRoomsServiceBO) {
this.reserveRoomsServiceBO = reserveRoomsServiceBO;
}
}
Pero al intentar acceder a reserveRoomsServiceBO me da null pointer.
Y el BO lo tengo declarado en los siguientes XML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="es.jj.empleado.actions.AddReserveRoomAction" class="es.jj.empleado.actions.AddReserveRoomAction" abstract="true" >
<property name="reserveRoomsServiceBO"><ref bean="reserveRoomsServiceBO" /></property>
</bean>
</beans>
y
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="reserveRoomsServiceBO" class="es.jj.empleado.business.ReserveRoomsServiceBOImpl">
</bean>
</beans>
¿Se os ocurre porque me puede dar null pointer?
Un saludo y gracias!