When I called a service in a panel method
public void mostrarSorteo(){
Servicios.getInstance().getAppService().consultar(new
AsyncCallback<ObjetoTo>() {
...
});
}
Generates the following errors:
ERROR: Errors in 'file:/C:/Prototipo/KioskoVista/trunk/src/main/
java/ve/com/kiosko/vista/client/componente/AppTimer.java'.
ERROR: Line 50: No source code is available for type
ve.com.kiosko.vista.server.servicios.AppService; did you forget to
inherit a required module?.
ERROR: Unable to load module entry point class
ve.com.kiosko.vista.client.entrypoint.AppEntryPoint (see associated
exception for details). java.lang.NullPointerException: null
AppService.java In class methods are loading a
list and randomly select one member of the
list
public List<ObjetoTo> cargarListado() {
ObjetoTo persona = new ObjetoTo();
List<ObjetoTo> personas = new ArrayList<ObjetoTo>();
try{
persona.setId(100);
persona.setNombre("Claudia Sanchez");
personas.add(0,persona);
persona.setId(200);
persona.setNombre("Pedro Sanchez");
personas.add(1,persona);
persona.setId(300);
persona.setNombre("Luis Sanchez");
personas.add(2,persona);
persona.setId(400);
persona.setNombre("Maria Sanchez");
personas.add(3,persona);
persona.setId(500);
persona.setNombre("Fernanda Sanchez");
personas.add(4,persona);
persona.setId(600);
persona.setNombre("Juan Sanchez");
personas.add(5,persona);
/*for (int i=0; i<personas.size(); i++){
System.out.println(personas.get(i));
} */
} catch (Throwable e) {
e.printStackTrace();
if (logger.isEnabledFor(Level.ERROR))
logger.error(e.getMessage(), e);
}
return personas;
}
public ObjetoTo consultar() {
List<ObjetoTo> listado = null;
int gnd = 0;
ObjetoTo obj = null;
try {
listado = new ArrayList<ObjetoTo>();
listado = cargarListado();
Random rdn = new Random(System.currentTimeMillis());
if (listado!= null && listado.size() > 0){
gnd = rdn.nextInt(listado.size());
obj= listado.get(gnd);
}
} catch (Throwable e) {
if (logger.isEnabledFor(Level.ERROR))
logger.error(e.getMessage(), e);
}
return obj;
}
En el AppTimer.java se encuentra el llamado del metodo
consultar para
mostrar en un Label listaParticipantes del Panel el Id y Nombre del
Participante seleccionado aleatoriamente
public void run() {
Servicios.getInstance().getAppService().consultar(new
AsyncCallback<ObjetoTo>() {
public void onFailure(Throwable throwable) {
Window.alert("Error Recuperando la Información");
if (throwable instanceof InvocationException) {
Window.alert(Mensajes.mensajes.sinConexion());
} else if (throwable instanceof
IncompatibleRemoteServiceException) {
Window.Location.reload();
}
}
public void onSuccess(ObjetoTo objetoTo) {
AppService appService = new AppService();
objetoTo = appService.consultar();
if (objetoTo != null){
AppPanel.listaParticipantes.setText(String.valueOf(objetoTo.getId()) +
objetoTo.getNombre()); }
}
});
}
I do not know if the problem is the call of the
methods, any parameters are missing or am I wrong methods
instantiating
because when I'm debbuger stops the GWT plugin, stops
the browser, generating an exception falls
java.lang.NullPointerException and
ve.com.kiosko.vista.client.panel.AppPanel_PanelUiBinderImpl @ 149cc16
(null handle)
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.