Pessoal estou usando essa classe é dá erro de java.lang.ArrayIndexOutOfBoundsException: 0.
Alguém pode me ajudar?
public java.lang.String[][] searchPresentation(
java.lang.String searchPresentationRequest)
throws java.rmi.RemoteException {
ClientDAO cDAO = (ClientDAO) DAOFactory
.getDAOInstance(DAOFactory.CLIENT_DAO);
ClientFilter clientFilter = new ClientFilter();
String[][] presentationURLList = null;
try {
clientFilter.setLink(searchPresentationRequest);
} catch (Exception e) {
}
List clientList = null;
try {
clientList = cDAO.searchObjects(clientFilter);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
long clientId = 0;
for (int i = 0; i < clientList.size(); i++) {
Client c = (Client) clientList.get(i);
clientId = c.getId();
}
DAO daoPresentation = DAOFactory
.getDAOInstance(DAOFactory.PRESENTATION_DAO);
PresentationFilter presentationFilter = new PresentationFilter();
try {
presentationFilter.setClientId(clientId);
} catch (Exception e) {
}
List presentationList;
try {
presentationList = daoPresentation
.searchObjects(presentationFilter);
presentationURLList = new String[presentationList.size()][5];
if (presentationList.size() > 0) {
for (int i = 0; i < presentationList.size(); i++) {
Presentation p = (Presentation) presentationList.get(i);
String path = p.getPath().toString();
String name = p.getTitle();
long presentationID = p.getId();
path = path.replace('\', '/');
path = path.substring(path.indexOf("teste"));
presentationURLList[i][0] = "http://localhost:8082/"
+ path + "/pres.ram";
presentationURLList[i][1] = name;
presentationURLList[i][2] = Long.toString(presentationID);
presentationURLList[i][3] = Integer
.toString(presentationList.size());
presentationURLList[i][4] = "No momento há "+Integer.toString(presentationList
.size())+"cadastradas.";
}
} else {
//presentationURLList[0][0] = Integer.toString(presentationList.size());
//presentationURLList[0][1] = Integer.toString(presentationList.size());
//presentationURLList[0][2] = Integer.toString(presentationList.size());
//presentationURLList[0][3] = Integer.toString(presentationList.size());
//presentationURLList[0][4] = "Não há apresentações cadastradas.";
presentationURLList[0][0] = Integer.toString(presentationList.size());
presentationURLList[0][1] = Integer.toString(presentationList.size());
presentationURLList[0][2] = Integer.toString(presentationList.size());
presentationURLList[0][3] = Integer.toString(presentationList.size());
presentationURLList[0][4] = Integer.toString(presentationList.size());
}
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("oi: "+presentationURLList[0][0]);
System.out.println("oi: "+presentationURLList[0][1]);
System.out.println("oi: "+presentationURLList[0][2]);
System.out.println("oi: "+presentationURLList[0][3]);
System.out.println("oi: "+presentationURLList[0][4]);
return presentationURLList;
}
Obrigado,
Vinicius.