Skip to content

Instantly share code, notes, and snippets.

@datherra
Created April 5, 2012 21:15
Show Gist options
  • Save datherra/2314208 to your computer and use it in GitHub Desktop.
Save datherra/2314208 to your computer and use it in GitHub Desktop.
NullPointerExcepetion no Batch
// revision 6268
public void exportPAImage(ChartParametersBean bean, String sistema_id, String sistema_value, String hostname, Vector<Item> listMInfra, String tipoMInfra,
String threshold, String dataIni, String dataFim, Projeto proj, Infra infra) {
// criar
JFreeChart chart = getOutputFactory().createPAChart(getDbManager().getListPADatasets(), sistema_value, hostname, listMInfra, tipoMInfra, threshold,
dataIni, dataFim, bean);
// exportar
String fileNameCP = "Panorama-" + proj.getNome() + "-" + infra.getServidor();
getOutputFactory().exportChart(chart, fileNameCP);
}
// revision HEAD
public void exportPAImage(ChartParametersBean bean, String sistema_id, String sistema_value, String hostname, Vector<Item> listMInfra, String tipoMInfra,
String threshold, String dataIni, String dataFim, Projeto proj, Infra infra) {
// criar
if (infra.getServidor().equals("SNESUN115")) { // <== infra.getServidor() retorna null
System.out.println("");
}
JFreeChart chart = getOutputFactory().createPAChart(getDbManager().getListPADatasets(), sistema_value, hostname, listMInfra, tipoMInfra, threshold,
dataIni, dataFim, bean);
// exportar
String fileNameCP = "Panorama-" + proj.getNome() + "-" + hostname;
getOutputFactory().exportChart(chart, fileNameCP);
}
@datherra
Copy link
Author

datherra commented Apr 5, 2012

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.inmetrics.tools.ggtim.controller.tabs.JPProjecaoNegocioController.loadMNegocio(JPProjecaoNegocioController.java:100)
    at com.inmetrics.tools.ggtim.controller.tabs.JPProjecaoNegocioController.access$6(JPProjecaoNegocioController.java:99)
    at com.inmetrics.tools.ggtim.controller.tabs.JPProjecaoNegocioController$3.actionPerformed(JPProjecaoNegocioController.java:200)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment