diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 2bc1b0e..fb31f3f 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -1135,7 +1135,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements Table table = service.getLastTable(new TabularResourceId(Long .valueOf(trId.getId()))); logger.debug("Table retrieved: " + table); - + if(table==null){ + logger.error("Last Table is Null: "+ Long + .valueOf(trId.getId())); + new TDGWTServiceException("Last Table is Null"); + } + Table viewTable = null; if (table.contains(DatasetViewTableMetadata.class)) { diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/monitor/OperationMonitorCreator.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/monitor/OperationMonitorCreator.java index efba032..251e049 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/monitor/OperationMonitorCreator.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/monitor/OperationMonitorCreator.java @@ -113,7 +113,14 @@ public class OperationMonitorCreator { SessionUtil.removeStartedTask(session, taskWrapper); postOperation(operationMonitor); } else { - TaskStatus status = taskWrapper.getTask().getStatus(); + + TaskStatus status=null; + try { + status=taskWrapper.getTask().getStatus(); + } catch(Throwable e){ + logger.debug("Error retrieving task status: "+taskWrapper.getTask()+" "+e.getLocalizedMessage()); + e.printStackTrace(); + } if (status == null) { logger.debug("Services TaskStatus : null"); throw new TDGWTServiceException( @@ -278,8 +285,18 @@ public class OperationMonitorCreator { new Long(trId.getId())); TabularResource tr = service.getTabularResource(tabularResourceId); + if(tr==null){ + logger.error("Tabular Resource Null [id="+trId.getId()+"]"); + throw new TDGWTServiceException("Tabular Resource Null "+trId); + } + Table table = service.getLastTable(tabularResourceId); - + if(table==null){ + logger.error("Last Table Null"); + throw new TDGWTServiceException("Last Table Null for "+tr); + } + + Table viewTable = null; if (table.contains(DatasetViewTableMetadata.class)) { @@ -319,7 +336,7 @@ public class OperationMonitorCreator { "Security exception, you haven't rights!"); } catch (Throwable e) { e.printStackTrace(); - throw new TDGWTServiceException("Error in Client Library Request: " + throw new TDGWTServiceException("Error Retrieving Basic Data: " + e.getLocalizedMessage()); } }