OODT-912 remove stackout put with log calls
Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/f286ded4 Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/f286ded4 Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/f286ded4 Branch: refs/heads/master Commit: f286ded403d0fbb795f369ead73ec5b5f899ead9 Parents: 35d3b22 Author: Tom Barber <[email protected]> Authored: Mon Nov 2 00:51:00 2015 +0000 Committer: Tom Barber <[email protected]> Committed: Mon Nov 2 00:51:00 2015 +0000 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../browser/controller/TableListener.java | 6 +- .../oodt/cas/filemgr/browser/model/CasDB.java | 8 ++- .../cas/filemgr/browser/model/QueryBuilder.java | 8 ++- .../oodt/cas/workflow/gui/WorkflowGUI.java | 31 +++++---- .../model/repo/XmlWorkflowModelRepository.java | 4 +- .../gui/perspective/build/BuildPerspective.java | 18 +++--- .../mapping/DataSourceIngestMapperFactory.java | 9 ++- .../repository/SerializedCatalogRepository.java | 2 +- .../XmlRpcCommunicationChannelServer.java | 2 +- .../struct/impl/index/InMemoryIndex.java | 2 +- .../apache/oodt/cas/catalog/system/Catalog.java | 25 ++++--- .../system/impl/CatalogServiceLocal.java | 2 +- .../util/CasPropertyPlaceholderConfigurer.java | 10 ++- .../system/impl/TestCatalogServiceLocal.java | 26 ++++---- .../org/apache/oodt/cas/cli/CmdLineUtility.java | 8 +-- .../cli/action/store/CmdLineActionStore.java | 8 +-- .../store/spring/SpringCmdLineActionStore.java | 18 +++--- .../apache/oodt/commons/database/SqlScript.java | 11 ++-- .../apache/oodt/commons/exec/EnvUtilities.java | 2 +- .../apache/oodt/commons/exec/ExecHelper.java | 6 +- .../org/apache/oodt/commons/exec/ExecUtils.java | 4 +- .../oodt/commons/io/LoggerOutputStream.java | 6 +- .../org/apache/oodt/commons/util/JDBC_DB.java | 9 ++- .../java/org/apache/oodt/commons/util/XML.java | 4 +- .../org/apache/oodt/commons/xml/XMLUtils.java | 5 +- .../MimeExtractorConfigReader.java | 30 +++++---- .../util/CasPropertyPlaceholderConfigurer.java | 11 +++- .../curation/service/CurationServiceConfig.java | 5 +- .../cas/curation/service/DirectoryResource.java | 2 +- .../cas/curation/service/IngestionResource.java | 17 ++--- .../cas/curation/service/MetadataResource.java | 31 +++++---- .../cas/curation/service/PolicyResource.java | 7 +- .../apache/oodt/cas/curation/CurationApp.java | 2 +- .../cas/filemgr/catalog/DataSourceCatalog.java | 49 +++++++------- .../catalog/LenientDataSourceCatalog.java | 18 +++--- .../oodt/cas/filemgr/catalog/LuceneCatalog.java | 6 +- .../cas/filemgr/catalog/ScienceDataCatalog.java | 50 +++++++------- .../catalog/solr/DefaultProductSerializer.java | 8 ++- .../cas/filemgr/catalog/solr/SolrClient.java | 7 +- .../cli/action/IngestProductCliAction.java | 33 +++++----- .../datatransfer/LocalDataTransferer.java | 8 +-- .../datatransfer/RemoteDataTransferer.java | 4 +- .../datatransfer/TransferStatusTracker.java | 2 +- .../oodt/cas/filemgr/ingest/RmiCache.java | 10 ++- .../oodt/cas/filemgr/ingest/RmiCacheServer.java | 9 ++- .../oodt/cas/filemgr/ingest/StdIngester.java | 6 +- .../extractors/AbstractFilemgrMetExtractor.java | 7 +- .../repository/DataSourceRepositoryManager.java | 12 ++-- .../ScienceDataRepositoryManager.java | 12 ++-- .../oodt/cas/filemgr/structs/Reference.java | 12 ++-- .../cas/filemgr/system/XmlRpcFileManager.java | 52 +++++++-------- .../filemgr/system/XmlRpcFileManagerClient.java | 8 +-- .../oodt/cas/filemgr/tools/CatalogSearch.java | 14 ++-- .../oodt/cas/filemgr/tools/ExpImpCatalog.java | 5 +- .../util/GenericFileManagerObjectFactory.java | 68 +++++++++----------- .../apache/oodt/cas/filemgr/util/SqlParser.java | 12 ++-- .../oodt/cas/filemgr/util/XmlStructFactory.java | 2 +- .../validation/DataSourceValidationLayer.java | 24 +++---- .../validation/ScienceDataValidationLayer.java | 25 ++++--- .../cas/filemgr/versioning/VersioningUtils.java | 4 +- .../filemgr/catalog/TestDataSourceCatalog.java | 24 ++++--- .../cas/filemgr/catalog/TestLuceneCatalog.java | 43 ++++++++----- .../catalog/TestMappedDataSourceCatalog.java | 5 +- .../catalog/TestOrderedDataSourceCatalog.java | 8 ++- .../cli/UseMockClientCmdLineActionStore.java | 2 +- .../cas/filemgr/ingest/TestCachedIngester.java | 28 ++++---- .../oodt/cas/filemgr/ingest/TestLocalCache.java | 25 ++++--- .../oodt/cas/filemgr/ingest/TestRmiCache.java | 13 ++-- .../oodt/cas/filemgr/structs/TestProduct.java | 12 +++- .../filemgr/structs/type/TestTypeHandler.java | 27 ++++---- .../filemgr/system/TestXmlRpcFileManager.java | 27 ++++---- .../cas/filemgr/tools/TestExpImpCatalog.java | 25 ++++--- .../cas/filemgr/util/TestXmlStructFactory.java | 17 +++-- .../TestAcquisitionDateVersioner.java | 23 ++++--- .../TestDirectoryBasedProductVersioner.java | 17 +++-- .../apache/oodt/grid/ProductQueryServlet.java | 16 ++--- .../oodt/cas/metadata/SerializableMetadata.java | 9 ++- .../extractors/CopyAndRewriteExtractor.java | 5 +- .../metadata/extractors/ExternMetExtractor.java | 2 +- .../metadata/extractors/MetReaderExtractor.java | 10 +-- .../extractors/TikaCmdLineMetExtractor.java | 14 ++-- .../preconditions/MimeTypeComparator.java | 12 ++-- .../util/GenericMetadataObjectFactory.java | 6 +- .../oodt/cas/metadata/util/MimeTypeUtils.java | 4 +- .../cas/metadata/TestSerializableMetadata.java | 4 +- .../apache/oodt/opendapps/DatasetExtractor.java | 4 +- .../OpendapProfileElementExtractor.java | 4 +- .../oodt/opendapps/util/ProfileUtils.java | 42 ++++++------ .../apache/oodt/pcs/tools/PCSHealthMonitor.java | 24 +++++-- .../apache/oodt/pcs/util/FileManagerUtils.java | 2 +- .../oodt/pcs/util/WorkflowManagerUtils.java | 9 +-- .../oodt/pcs/input/PGEConfigFileReader.java | 6 +- .../oodt/pcs/input/PGEConfigFileWriter.java | 3 +- .../oodt/pcs/input/PGEConfigFileReaderTest.java | 2 +- .../oodt/pcs/input/PGEConfigFileWriterTest.java | 2 +- .../oodt/pcs/input/PGEDataHandlerTest.java | 2 +- .../org/apache/oodt/pcs/opsui/OpsuiApp.java | 2 +- .../cas/pge/staging/FileManagerFileStager.java | 2 +- .../apache/oodt/cas/pge/staging/FileStager.java | 8 +-- .../pge/writers/DynamicConfigFileWriter.java | 7 +- .../pge/writers/ExternExtractorMetWriter.java | 3 +- .../oodt/cas/pge/writers/PcsMetFileWriter.java | 29 ++++----- .../pge/writers/xslt/XslTransformWriter.java | 23 ++++--- ...etadataKeyReplacementTemplateWriterTest.java | 13 ++-- .../writers/VelocityConfigFileWriterTest.java | 11 ++-- .../product/handlers/ofsn/MD5GetHandler.java | 19 +++--- .../handlers/ofsn/StdOFSNGetHandler.java | 10 ++- .../handlers/ofsn/util/OFSNObjectFactory.java | 12 ++-- .../product/handlers/ofsn/util/OFSNUtils.java | 21 +++--- .../xmlquery/ChunkedProductInputStream.java | 8 +-- .../oodt/profile/gui/ProfileBuilderGUI.java | 22 ++++--- .../handlers/DatabaseProfileManager.java | 2 +- .../oodt/profile/handlers/ProfileManager.java | 2 +- .../profile/handlers/cas/CASProfileHandler.java | 14 ++-- .../oodt/cas/protocol/imaps/ImapsProtocol.java | 31 +++++---- .../cas/protocol/sftp/TestJschSftpProtocol.java | 43 ++++++++----- .../apache/oodt/cas/pushpull/config/Config.java | 4 +- .../oodt/cas/pushpull/config/RemoteSpecs.java | 6 +- .../apache/oodt/cas/pushpull/daemon/Daemon.java | 12 ++-- .../cas/pushpull/daemon/DaemonController.java | 7 +- .../oodt/cas/pushpull/expressions/Method.java | 9 ++- .../parsers/ClassNoaaEmailParser.java | 13 ++-- .../parsers/DirStructXmlParser.java | 2 +- .../cas/pushpull/protocol/ProtocolHandler.java | 6 +- .../pushpull/retrievalmethod/ListRetriever.java | 2 +- .../DownloadThreadEvaluator.java | 12 ++-- .../retrievalsystem/FileRetrievalSystem.java | 8 +-- .../retrievalsystem/RetrievalSetup.java | 6 +- .../cas/pushpull/util/ExpressionValidator.java | 10 ++- .../resource/batchmgr/XmlRpcBatchMgrProxy.java | 4 +- .../oodt/cas/resource/examples/LongJob.java | 8 ++- .../oodt/cas/resource/examples/TestResmgr.java | 10 ++- .../monitor/ganglia/GangliaResourceMonitor.java | 16 +++-- .../resource/noderepo/XmlNodeRepository.java | 2 +- .../resource/queuerepo/XmlQueueRepository.java | 4 +- .../resource/system/XmlRpcResourceManager.java | 10 +-- .../resource/system/extern/XmlRpcBatchStub.java | 7 +- .../oodt/cas/resource/tools/JobSubmitter.java | 2 +- .../GenericResourceManagerObjectFactory.java | 66 +++++++++---------- .../oodt/cas/resource/util/JobBuilder.java | 16 +++-- .../apache/oodt/cas/resource/util/Ulimit.java | 29 +++++---- .../cas/resource/util/XmlStructFactory.java | 24 ++++--- .../cli/UseMockClientCmdLineActionStore.java | 2 +- .../monitor/TestGangliaResourceMonitor.java | 21 +++--- .../apache/oodt/security/sso/OpenSSOImpl.java | 5 +- .../oodt/security/sso/SingleSignOnFactory.java | 6 +- .../oodt/security/sso/opensso/SSOProxy.java | 10 +-- .../cas/resource/batchmgr/ResourceExecutor.java | 4 +- .../ResourceMesosSchedulerFactory.java | 2 +- .../oodt/filemgrcheck/FilemgrCheckStep.java | 4 +- .../oodt/filemgrdelete/FilemgrDeleteStep.java | 2 +- .../oodt/filemgringest/FilemgrIngestStep.java | 2 +- .../filemgringest/FilemgrIngestStepDialog.java | 2 +- .../webcomponents/filemgr/FileManagerConn.java | 14 ++-- .../filemgr/browser/types/Types.java | 24 +++---- .../instance/WorkflowInstancesViewer.java | 7 +- .../oodt/cas/product/CASProductHandler.java | 12 +++- .../cas/product/data/DataDeliveryServlet.java | 2 +- .../product/data/DatasetDeliveryServlet.java | 4 +- .../oodt/cas/product/rdf/RDFDatasetServlet.java | 4 +- .../oodt/cas/product/rdf/RDFProductServlet.java | 63 +++++++++--------- .../oodt/cas/product/rss/RSSProductServlet.java | 9 ++- .../product/rss/RSSProductTransferServlet.java | 2 +- .../IterativeWorkflowProcessorThread.java | 4 +- .../PrioritizedQueueBasedWorkflowEngine.java | 13 ++-- ...oritizedQueueBasedWorkflowEngineFactory.java | 8 ++- .../oodt/cas/workflow/engine/TaskQuerier.java | 2 +- .../oodt/cas/workflow/engine/TaskRunner.java | 11 ++-- .../engine/ThreadPoolWorkflowEngine.java | 6 +- .../processor/WorkflowProcessorQueue.java | 12 ++-- .../engine/runner/AbstractEngineRunnerBase.java | 2 +- .../runner/AsynchronousLocalEngineRunner.java | 2 +- .../examples/RandomStatusUpdateTask.java | 12 ++-- .../AbstractPaginatibleInstanceRepository.java | 2 +- .../DataSourceWorkflowInstanceRepository.java | 24 +++---- .../LuceneWorkflowInstanceRepository.java | 2 +- .../DataSourceWorkflowRepository.java | 38 +++++------ .../repository/PackagedWorkflowRepository.java | 4 +- .../PackagedWorkflowRepositoryFactory.java | 2 +- .../structs/HighestFIFOPrioritySorter.java | 5 +- .../cas/workflow/structs/WorkflowInstance.java | 20 +++--- .../workflow/system/XmlRpcWorkflowManager.java | 36 +++++------ .../system/XmlRpcWorkflowManagerClient.java | 4 +- .../cas/workflow/util/CygwinScriptFile.java | 6 +- .../util/GenericWorkflowObjectFactory.java | 40 ++++++------ .../oodt/cas/workflow/util/ScriptFile.java | 6 +- .../cli/UseMockClientCmdLineActionStore.java | 10 +-- .../cas/workflow/engine/MockProcessorQueue.java | 11 +++- .../TestAsynchronousLocalEngineRunner.java | 29 +++++---- .../examples/TestExternScriptTaskInstance.java | 13 ++-- .../cas/workflow/examples/TestFilterTask.java | 18 ++++-- .../TestPackagedWorkflowRepository.java | 8 ++- .../repository/TestWorkflowRepository.java | 32 ++++----- .../system/TestXmlRpcWorkflowManager.java | 13 ++-- .../apache/oodt/xmlps/product/DBMSExecutor.java | 7 +- .../oodt/xmlps/product/XMLPSProductHandler.java | 6 +- .../apache/oodt/xmlps/profile/DBMSExecutor.java | 4 +- .../oodt/xmlps/profile/XMLPSProfileHandler.java | 8 +-- .../xmlps/util/GenericCDEObjectFactory.java | 9 +-- .../oodt/xmlps/mapping/TestMappingReader.java | 7 +- .../java/org/apache/oodt/product/Retriever.java | 2 +- 202 files changed, 1410 insertions(+), 1091 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 9d62a4b..33992c6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -57,6 +57,7 @@ Release 0.11 - Current Development * OODT-894 tidy up inefficient constructors - code quality from sonar (magicaltrout) +* OODT-912 replace print stacttraces with log output - code quality from sonar (magicaltrout) Release 0.10 - 08/30/2015 * OODT-871 Issues with OODT 0.10 RC#1 (lewismc, mattmann) http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/controller/TableListener.java ---------------------------------------------------------------------- diff --git a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/controller/TableListener.java b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/controller/TableListener.java index 81ac61f..48544c9 100644 --- a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/controller/TableListener.java +++ b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/controller/TableListener.java @@ -32,11 +32,15 @@ import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.FileOutputStream; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JFileChooser; public class TableListener implements MouseListener, ActionListener { + private static Logger LOG = Logger.getLogger(TableListener.class.getName()); + private Component caller; private TablePane table; private int mousePos; @@ -157,7 +161,7 @@ public class TableListener implements MouseListener, ActionListener { fileOut.close(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java ---------------------------------------------------------------------- diff --git a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java index badd8c8..4d58948 100644 --- a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java +++ b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/CasDB.java @@ -27,13 +27,15 @@ import org.apache.oodt.cas.metadata.Metadata; import java.net.URL; import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; public class CasDB { URL filemgrUrl; XmlRpcFileManagerClient client; public Results results; - + private static Logger LOG = Logger.getLogger(CasDB.class.getName()); private static String freeTextBlock = "__FREE__"; public CasDB() { @@ -68,7 +70,7 @@ public class CasDB { types = new String[v.size()]; } catch (RepositoryManagerException e) { - // e.printStackTrace(); + // LOG.log(Level.SEVERE, e.getMessage()); } } else { @@ -89,7 +91,7 @@ public class CasDB { elements = new String[v.size()]; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } else { elements = new String[1]; http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java ---------------------------------------------------------------------- diff --git a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java index 79097d4..10f2273 100644 --- a/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java +++ b/app/fmbrowser/src/main/java/org/apache/oodt/cas/filemgr/browser/model/QueryBuilder.java @@ -24,16 +24,18 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.PhraseQuery; import org.apache.lucene.search.RangeQuery; import org.apache.lucene.search.TermQuery; - import org.apache.oodt.cas.filemgr.structs.Query; import org.apache.oodt.cas.filemgr.structs.RangeQueryCriteria; import org.apache.oodt.cas.filemgr.structs.TermQueryCriteria; import org.apache.oodt.cas.filemgr.tools.CASAnalyzer; +import java.util.logging.Level; +import java.util.logging.Logger; + public class QueryBuilder { private CasDB database; - + private static Logger LOG = Logger.getLogger(QueryBuilder.class.getName()); public QueryBuilder(CasDB db) { database = db; } @@ -49,7 +51,7 @@ public class QueryBuilder { luceneQ = parser.parse(query); } catch (org.apache.lucene.queryParser.ParseException e) { // TODO Auto-generated catch block - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } System.out.println(luceneQ != null ? luceneQ.toString() : null); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/WorkflowGUI.java ---------------------------------------------------------------------- diff --git a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/WorkflowGUI.java b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/WorkflowGUI.java index 85ed681..1676a26 100644 --- a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/WorkflowGUI.java +++ b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/WorkflowGUI.java @@ -18,9 +18,8 @@ package org.apache.oodt.cas.workflow.gui; //Commons import -import org.apache.commons.lang.StringUtils; -//OODT imports +import org.apache.commons.lang.StringUtils; import org.apache.oodt.cas.workflow.gui.menu.EditMenu; import org.apache.oodt.cas.workflow.gui.menu.FileMenu; import org.apache.oodt.cas.workflow.gui.model.ModelGraph; @@ -34,8 +33,9 @@ import org.apache.oodt.cas.workflow.gui.toolbox.Tool; import org.apache.oodt.cas.workflow.gui.toolbox.ToolBox; import org.apache.oodt.cas.workflow.gui.util.IconLoader; -//JDK imports -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; @@ -47,8 +47,17 @@ import java.util.HashSet; import java.util.List; import java.util.Vector; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Level; +import java.util.logging.Logger; -import javax.swing.*; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JMenuBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; + +//OODT imports +//JDK imports /** * @@ -60,7 +69,7 @@ import javax.swing.*; * */ public class WorkflowGUI extends JFrame { - + private static Logger LOG = Logger.getLogger(WorkflowGUI.class.getName()); private static final long serialVersionUID = -8217540440195126377L; private ToolBox toolbox; @@ -187,7 +196,7 @@ public class WorkflowGUI extends JFrame { .getGlobalConfigGroups())); } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -244,7 +253,7 @@ public class WorkflowGUI extends JFrame { } } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -278,7 +287,7 @@ public class WorkflowGUI extends JFrame { try { repo.save(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } }); @@ -289,7 +298,7 @@ public class WorkflowGUI extends JFrame { try { perspective.undo(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } }); @@ -307,7 +316,7 @@ public class WorkflowGUI extends JFrame { gui.pack(); gui.setVisible(true); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } }); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/model/repo/XmlWorkflowModelRepository.java ---------------------------------------------------------------------- diff --git a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/model/repo/XmlWorkflowModelRepository.java b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/model/repo/XmlWorkflowModelRepository.java index 1976369..e975556 100644 --- a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/model/repo/XmlWorkflowModelRepository.java +++ b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/model/repo/XmlWorkflowModelRepository.java @@ -26,6 +26,7 @@ import org.apache.oodt.cas.workflow.gui.model.ModelGraph; import org.apache.oodt.cas.workflow.gui.model.ModelNode; import org.apache.oodt.cas.workflow.gui.util.exceptions.WorkflowException; import org.apache.oodt.commons.xml.XMLUtils; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; @@ -34,7 +35,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -150,7 +150,7 @@ public class XmlWorkflowModelRepository { this.files.clear(); } - private void saveGraphs() throws FileNotFoundException, + private void saveGraphs() throws ParserConfigurationException { Map<File, Document> documents = new HashMap<File, Document>(); for (ModelGraph graph : this.graphs) { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java ---------------------------------------------------------------------- diff --git a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java index b73fe3b..e6efd4e 100644 --- a/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java +++ b/app/weditor/src/main/java/org/apache/oodt/cas/workflow/gui/perspective/build/BuildPerspective.java @@ -18,6 +18,7 @@ package org.apache.oodt.cas.workflow.gui.perspective.build; //JDK imports + import org.apache.oodt.cas.workflow.gui.model.ModelGraph; import org.apache.oodt.cas.workflow.gui.perspective.MultiStatePerspective; import org.apache.oodt.cas.workflow.gui.perspective.view.MultiStateView; @@ -42,6 +43,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.JMenuItem; import javax.swing.JPanel; @@ -77,7 +80,7 @@ public class BuildPerspective extends MultiStatePerspective { private ViewState activeState; public static final int MAIN_VIEW = 1; - + private static Logger LOG = Logger.getLogger(BuildPerspective.class.getName()); private static final int WIDTH = 1000; private static final int HEIGHT = 700; @@ -85,8 +88,7 @@ public class BuildPerspective extends MultiStatePerspective { private boolean findSelectedInTab = false; - public BuildPerspective() throws InstantiationException, - IllegalAccessException { + public BuildPerspective() { this(TreeProjectView.class, GraphView.class, DefaultTreeView.class, DefaultPropView.class, GlobalConfigView.class); } @@ -221,7 +223,7 @@ public class BuildPerspective extends MultiStatePerspective { try { return this.mainViewClass.getConstructor(String.class).newInstance(name); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -231,7 +233,7 @@ public class BuildPerspective extends MultiStatePerspective { return this.treeViewClass.getConstructor(String.class).newInstance( this.treeViewClass.getSimpleName()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -241,7 +243,7 @@ public class BuildPerspective extends MultiStatePerspective { return this.globalViewClass.getConstructor(String.class).newInstance( this.globalViewClass.getSimpleName()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -253,7 +255,7 @@ public class BuildPerspective extends MultiStatePerspective { view.registerListener(this); return view; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -263,7 +265,7 @@ public class BuildPerspective extends MultiStatePerspective { return this.propViewClass.getConstructor(String.class).newInstance( this.propViewClass.getSimpleName()); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/mapping/DataSourceIngestMapperFactory.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/mapping/DataSourceIngestMapperFactory.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/mapping/DataSourceIngestMapperFactory.java index 8203c93..2a7981f 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/mapping/DataSourceIngestMapperFactory.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/mapping/DataSourceIngestMapperFactory.java @@ -19,6 +19,9 @@ package org.apache.oodt.cas.catalog.mapping; //Spring imports import org.springframework.beans.factory.annotation.Required; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * @author bfoster * @version $Revision$ @@ -29,7 +32,9 @@ import org.springframework.beans.factory.annotation.Required; */ public class DataSourceIngestMapperFactory implements IngestMapperFactory { - protected String jdbcUrl; + private static Logger LOG = Logger.getLogger(DataSourceIngestMapperFactory.class.getName()); + + protected String jdbcUrl; protected String user; protected String pass; protected String driver; @@ -77,7 +82,7 @@ public class DataSourceIngestMapperFactory implements IngestMapperFactory { return new DataSourceIngestMapper(user, pass, driver, jdbcUrl); }catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/repository/SerializedCatalogRepository.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/repository/SerializedCatalogRepository.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/repository/SerializedCatalogRepository.java index 2220f4e..18a58dd 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/repository/SerializedCatalogRepository.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/repository/SerializedCatalogRepository.java @@ -53,7 +53,7 @@ public class SerializedCatalogRepository implements CatalogRepository { new File(this.storageDir + "/catalogs").mkdirs(); new File(this.storageDir + "/classloaders").mkdirs(); }catch(Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.SEVERE, e.getMessage()); throw new InstantiationException("Failed to instantiate SerializedCatalogRepository : " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java index d4b92a7..2121a81 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/server/channel/xmlrpc/XmlRpcCommunicationChannelServer.java @@ -138,7 +138,7 @@ public class XmlRpcCommunicationChannelServer extends } public boolean xmlrpc_transferFile(String filePath, byte[] fileData, int offset, int numBytes) - throws CatalogServiceException, IOException { + throws IOException { FileOutputStream fOut = null; try { File outFile = new File(filePath); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/struct/impl/index/InMemoryIndex.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/struct/impl/index/InMemoryIndex.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/struct/impl/index/InMemoryIndex.java index 087b1b2..20f7b61 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/struct/impl/index/InMemoryIndex.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/struct/impl/index/InMemoryIndex.java @@ -35,7 +35,7 @@ import org.apache.oodt.commons.database.SqlScript; public class InMemoryIndex extends DataSourceIndex { public InMemoryIndex(String user, String pass, String driver, - String jdbcUrl, boolean useUTF8, String tablesFile) throws SQLException, IOException { + String jdbcUrl, boolean useUTF8, String tablesFile) throws IOException { super(user, pass, driver, jdbcUrl, useUTF8); SqlScript coreSchemaScript = new SqlScript(new File(tablesFile).getAbsolutePath(), this.dataSource); coreSchemaScript.loadScript(); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/system/Catalog.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/Catalog.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/Catalog.java index 46253c5..265364e 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/Catalog.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/Catalog.java @@ -17,7 +17,6 @@ package org.apache.oodt.cas.catalog.system; //OODT imports -import org.apache.oodt.cas.catalog.exception.CatalogDictionaryException; import org.apache.oodt.cas.catalog.exception.CatalogException; import org.apache.oodt.cas.catalog.exception.CatalogIndexException; import org.apache.oodt.cas.catalog.page.CatalogReceipt; @@ -25,16 +24,26 @@ import org.apache.oodt.cas.catalog.page.IndexPager; import org.apache.oodt.cas.catalog.page.IngestReceipt; import org.apache.oodt.cas.catalog.query.QueryExpression; import org.apache.oodt.cas.catalog.struct.Dictionary; -import org.apache.oodt.cas.catalog.struct.*; +import org.apache.oodt.cas.catalog.struct.Index; +import org.apache.oodt.cas.catalog.struct.IngestService; +import org.apache.oodt.cas.catalog.struct.QueryService; +import org.apache.oodt.cas.catalog.struct.TransactionId; +import org.apache.oodt.cas.catalog.struct.TransactionIdFactory; import org.apache.oodt.cas.catalog.term.Term; import org.apache.oodt.cas.catalog.term.TermBucket; import org.apache.oodt.cas.metadata.Metadata; -//JDK imports -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; +//JDK imports + /** * @author bfoster @@ -69,7 +78,7 @@ public class Catalog { return this.id; } - public TransactionIdFactory getTransactionIdFactory() throws CatalogIndexException { + public TransactionIdFactory getTransactionIdFactory() { return this.index.getTransactionIdFactory(); } @@ -108,7 +117,7 @@ public class Catalog { return this.index instanceof IngestService && !this.restrictIngestPermissions; } - public List<TransactionId<?>> getPage(IndexPager indexPage) throws CatalogIndexException { + public List<TransactionId<?>> getPage(IndexPager indexPage) { return this.index.getPage(indexPage); } @@ -324,7 +333,7 @@ public class Catalog { } } - protected Metadata getMetadataFromBuckets(List<TermBucket> termBuckets) throws CatalogDictionaryException { + protected Metadata getMetadataFromBuckets(List<TermBucket> termBuckets) { Metadata metadata = new Metadata(); for (TermBucket termBucket : termBuckets) { if (this.dictionaries != null) { @@ -348,7 +357,7 @@ public class Catalog { return m; } - protected List<TermBucket> getTermBuckets(Metadata metadata) throws CatalogDictionaryException { + protected List<TermBucket> getTermBuckets(Metadata metadata) { List<TermBucket> termBuckets = new Vector<TermBucket>(); if (this.dictionaries != null) { for (Dictionary dictionary : this.dictionaries) { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java index 53b619b..3621a7e 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/system/impl/CatalogServiceLocal.java @@ -823,7 +823,7 @@ public class CatalogServiceLocal implements CatalogService { LOG.log(Level.INFO, "Query returned " + transactionReceipts.size() + " results"); return transactionReceipts; }catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogServiceException("Failed to get TransactionId to Metadata map for query '" + queryExpression + "' : " + e.getMessage(), e); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/main/java/org/apache/oodt/cas/catalog/util/CasPropertyPlaceholderConfigurer.java ---------------------------------------------------------------------- diff --git a/catalog/src/main/java/org/apache/oodt/cas/catalog/util/CasPropertyPlaceholderConfigurer.java b/catalog/src/main/java/org/apache/oodt/cas/catalog/util/CasPropertyPlaceholderConfigurer.java index 4686318..6ad2beb 100644 --- a/catalog/src/main/java/org/apache/oodt/cas/catalog/util/CasPropertyPlaceholderConfigurer.java +++ b/catalog/src/main/java/org/apache/oodt/cas/catalog/util/CasPropertyPlaceholderConfigurer.java @@ -17,11 +17,16 @@ package org.apache.oodt.cas.catalog.util; //OODT imports + import org.apache.oodt.cas.metadata.util.PathUtils; -//Spring imports import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import java.util.logging.Level; +import java.util.logging.Logger; + +//Spring imports + /** * * @author bfoster @@ -32,6 +37,7 @@ import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; public class CasPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { + private static Logger LOG = Logger.getLogger(CasPropertyPlaceholderConfigurer.class.getName()); @Override protected String convertPropertyValue(String value) { try { @@ -48,7 +54,7 @@ public class CasPropertyPlaceholderConfigurer extends return result; } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return value; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/catalog/src/test/java/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java ---------------------------------------------------------------------- diff --git a/catalog/src/test/java/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java b/catalog/src/test/java/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java index e710264..3c6d283 100644 --- a/catalog/src/test/java/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java +++ b/catalog/src/test/java/org/apache/oodt/cas/catalog/system/impl/TestCatalogServiceLocal.java @@ -17,15 +17,7 @@ package org.apache.oodt.cas.catalog.system.impl; //JDK imports -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Vector; -import junit.framework.TestCase; - -//OODT imports import org.apache.commons.io.FileUtils; import org.apache.oodt.cas.catalog.exception.CatalogServiceException; import org.apache.oodt.cas.catalog.mapping.InMemoryIngestMapperFactory; @@ -45,6 +37,18 @@ import org.apache.oodt.cas.catalog.struct.impl.transaction.UuidTransactionIdFact import org.apache.oodt.cas.catalog.system.CatalogFactory; import org.apache.oodt.cas.metadata.Metadata; +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; + +import junit.framework.TestCase; + +//OODT imports + /** * * @author bfoster @@ -55,7 +59,7 @@ public class TestCatalogServiceLocal extends TestCase { private CatalogServiceLocal cs; private File testDir; - + private static Logger LOG = Logger.getLogger(TestCatalogServiceLocal.class.getName()); public void setUp() { try { File tempFile = File.createTempFile("foo", "bar"); @@ -89,7 +93,7 @@ public class TestCatalogServiceLocal extends TestCase { .setIndexFactory(getInMemoryDSFactory(testDir.getAbsolutePath() + "/index/2/")); cs.addCatalog(catalogFactory.createCatalog()); }catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); TestCase.fail(e.getMessage()); } } @@ -98,7 +102,7 @@ public class TestCatalogServiceLocal extends TestCase { try { FileUtils.forceDelete(this.testDir); } catch (IOException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); TestCase.fail(e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/cli/src/main/java/org/apache/oodt/cas/cli/CmdLineUtility.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/oodt/cas/cli/CmdLineUtility.java b/cli/src/main/java/org/apache/oodt/cas/cli/CmdLineUtility.java index 3ae4e9d..9fbb6d8 100644 --- a/cli/src/main/java/org/apache/oodt/cas/cli/CmdLineUtility.java +++ b/cli/src/main/java/org/apache/oodt/cas/cli/CmdLineUtility.java @@ -31,6 +31,7 @@ import static org.apache.oodt.cas.cli.util.CmdLineUtils.isAdvancedOption; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.logging.Logger; //Apache imports import org.apache.commons.lang.Validate; @@ -79,7 +80,7 @@ import com.google.common.collect.Lists; * @author bfoster (Brian Foster) */ public class CmdLineUtility { - + private static Logger LOG = Logger.getLogger(CmdLineUtility.class.getName()); private boolean debugMode; private CmdLineParser parser; private CmdLineConstructor constructor; @@ -207,9 +208,8 @@ public class CmdLineUtility { * On error constructing command line arguments. * @throws CmdLineOptionStoreException */ - public CmdLineArgs parse(String[] args) throws CmdLineParserException, - CmdLineActionStoreException, CmdLineConstructionException, - CmdLineOptionStoreException { + public CmdLineArgs parse(String[] args) throws + CmdLineActionStoreException, CmdLineConstructionException { Validate.notNull(parser); Validate.notNull(optionStore); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/cli/src/main/java/org/apache/oodt/cas/cli/action/store/CmdLineActionStore.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/oodt/cas/cli/action/store/CmdLineActionStore.java b/cli/src/main/java/org/apache/oodt/cas/cli/action/store/CmdLineActionStore.java index 1d12f7f..28ece25 100644 --- a/cli/src/main/java/org/apache/oodt/cas/cli/action/store/CmdLineActionStore.java +++ b/cli/src/main/java/org/apache/oodt/cas/cli/action/store/CmdLineActionStore.java @@ -16,12 +16,10 @@ */ package org.apache.oodt.cas.cli.action.store; -//JDK imports +import org.apache.oodt.cas.cli.action.CmdLineAction; + import java.util.Set; -//OODT imports -import org.apache.oodt.cas.cli.action.CmdLineAction; -import org.apache.oodt.cas.cli.exception.CmdLineActionStoreException; /** * Storage for loading supported {@link CmdLineAction}s. @@ -31,5 +29,5 @@ import org.apache.oodt.cas.cli.exception.CmdLineActionStoreException; public interface CmdLineActionStore { Set<CmdLineAction> loadSupportedActions() - throws CmdLineActionStoreException; + ; } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/cli/src/main/java/org/apache/oodt/cas/cli/action/store/spring/SpringCmdLineActionStore.java ---------------------------------------------------------------------- diff --git a/cli/src/main/java/org/apache/oodt/cas/cli/action/store/spring/SpringCmdLineActionStore.java b/cli/src/main/java/org/apache/oodt/cas/cli/action/store/spring/SpringCmdLineActionStore.java index 2467105..3dda8ef 100644 --- a/cli/src/main/java/org/apache/oodt/cas/cli/action/store/spring/SpringCmdLineActionStore.java +++ b/cli/src/main/java/org/apache/oodt/cas/cli/action/store/spring/SpringCmdLineActionStore.java @@ -16,19 +16,18 @@ */ package org.apache.oodt.cas.cli.action.store.spring; -//JDK imports -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; - -//OODT imports import org.apache.oodt.cas.cli.action.CmdLineAction; import org.apache.oodt.cas.cli.action.store.CmdLineActionStore; -import org.apache.oodt.cas.cli.exception.CmdLineActionStoreException; + import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + + /** * A Spring Framework based {@link CmdLineActionStore}. * @@ -45,8 +44,7 @@ public class SpringCmdLineActionStore implements CmdLineActionStore { } @Override - public Set<CmdLineAction> loadSupportedActions() - throws CmdLineActionStoreException { + public Set<CmdLineAction> loadSupportedActions() { @SuppressWarnings("unchecked") Map<String, CmdLineAction> actionsMap = appContext .getBeansOfType(CmdLineAction.class); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/database/SqlScript.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/database/SqlScript.java b/commons/src/main/java/org/apache/oodt/commons/database/SqlScript.java index 8a5ea8e..93116af 100644 --- a/commons/src/main/java/org/apache/oodt/commons/database/SqlScript.java +++ b/commons/src/main/java/org/apache/oodt/commons/database/SqlScript.java @@ -19,6 +19,7 @@ package org.apache.oodt.commons.database; //JDK imports + import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @@ -28,6 +29,8 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.List; import java.util.Vector; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.sql.DataSource; @@ -41,7 +44,7 @@ import javax.sql.DataSource; * </p>. */ public class SqlScript { - + private static Logger LOG = Logger.getLogger(SqlScript.class.getName()); public final static char QUERY_ENDS = ';'; private File script; @@ -100,7 +103,7 @@ public class SqlScript { } catch (IOException e) { // TODO Auto-generated catch block - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -183,7 +186,7 @@ public class SqlScript { statement.execute(sql); } catch (SQLException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); System.out.println("Exception executing SQL: [" + sql + "]: message: " + e.getMessage()); @@ -224,7 +227,7 @@ public class SqlScript { } } catch (SQLException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); System.out .println("Exception executing SQL batch statement: message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/exec/EnvUtilities.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/exec/EnvUtilities.java b/commons/src/main/java/org/apache/oodt/commons/exec/EnvUtilities.java index a8a6d35..aefadd2 100644 --- a/commons/src/main/java/org/apache/oodt/commons/exec/EnvUtilities.java +++ b/commons/src/main/java/org/apache/oodt/commons/exec/EnvUtilities.java @@ -99,7 +99,7 @@ public final class EnvUtilities { envProps = new Properties(); envProps.load(preProcessInputStream(p.getInputStream())); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error executing env command: Message: " + e.getMessage()); } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/exec/ExecHelper.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/exec/ExecHelper.java b/commons/src/main/java/org/apache/oodt/commons/exec/ExecHelper.java index 5da1f94..b5df16e 100644 --- a/commons/src/main/java/org/apache/oodt/commons/exec/ExecHelper.java +++ b/commons/src/main/java/org/apache/oodt/commons/exec/ExecHelper.java @@ -19,10 +19,13 @@ package org.apache.oodt.commons.exec; //JDK imports + import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; +import java.util.logging.Level; +import java.util.logging.Logger; /** * <p> @@ -39,6 +42,7 @@ import java.io.Reader; * */ public final class ExecHelper { + private static Logger LOG = Logger.getLogger(ExecHelper.class.getName()); /** * Executes the specified command and arguments in a separate process, and @@ -398,7 +402,7 @@ public final class ExecHelper { this.output = output.toString(); this.error = error.toString(); }catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new IOException("Process exec failed : " + e.getMessage()); }finally { try { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/exec/ExecUtils.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/exec/ExecUtils.java b/commons/src/main/java/org/apache/oodt/commons/exec/ExecUtils.java index 04adef1..1e3cf13 100644 --- a/commons/src/main/java/org/apache/oodt/commons/exec/ExecUtils.java +++ b/commons/src/main/java/org/apache/oodt/commons/exec/ExecUtils.java @@ -33,7 +33,7 @@ import java.util.logging.Logger; * @author bfoster (Brian Foster) */ public final class ExecUtils { - + private static Logger LOG = Logger.getLogger(ExecUtils.class.getName()); private ExecUtils() throws InstantiationException { throw new InstantiationException("Don't construct utility classes!"); } @@ -105,7 +105,7 @@ public final class ExecUtils { returnVal = progProcess.waitFor(); return returnVal; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new IOException("Failed to run '" + commandLine + "' -- return val = " + returnVal + " : " + e.getMessage()); } finally { http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/io/LoggerOutputStream.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/io/LoggerOutputStream.java b/commons/src/main/java/org/apache/oodt/commons/io/LoggerOutputStream.java index 074e55c..d89689c 100644 --- a/commons/src/main/java/org/apache/oodt/commons/io/LoggerOutputStream.java +++ b/commons/src/main/java/org/apache/oodt/commons/io/LoggerOutputStream.java @@ -43,13 +43,11 @@ public class LoggerOutputStream extends OutputStream { this(logger, Level.INFO); } - public LoggerOutputStream(Logger logger, Level logLevel) - throws InstantiationException { + public LoggerOutputStream(Logger logger, Level logLevel) { this(logger, NUM_BYTES_PER_WRITE, logLevel); } - public LoggerOutputStream(Logger logger, int numOfBytesPerWrite) - throws InstantiationException { + public LoggerOutputStream(Logger logger, int numOfBytesPerWrite) { this(logger, numOfBytesPerWrite, Level.INFO); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/util/JDBC_DB.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/util/JDBC_DB.java b/commons/src/main/java/org/apache/oodt/commons/util/JDBC_DB.java index 4e69691..cf0ee04 100644 --- a/commons/src/main/java/org/apache/oodt/commons/util/JDBC_DB.java +++ b/commons/src/main/java/org/apache/oodt/commons/util/JDBC_DB.java @@ -23,6 +23,8 @@ import java.sql.SQLException; import java.sql.Statement; import java.text.SimpleDateFormat; import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; /** This class is a wrapper for JDBC. @@ -32,6 +34,7 @@ import java.util.Properties; */ public class JDBC_DB { + private static Logger LOG = Logger.getLogger(JDBC_DB.class.getName()); Properties serverProps; Connection connect; String sql_command; @@ -133,7 +136,7 @@ public class JDBC_DB System.err.println("Loaded " + classname); } catch (ClassNotFoundException e) { System.err.println("Can't load JDBC driver \"" + classname + "\": " + e.getMessage()); - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } url = serverProps.getProperty("org.apache.oodt.commons.util.JDBC_DB.url", "jdbc:oracle:@"); try { @@ -146,7 +149,7 @@ public class JDBC_DB } } catch (SQLException e) { System.err.println("SQL Exception during connection creation: " + e.getMessage()); - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); while (e != null) { System.err.println(e.getMessage()); e = e.getNextException(); @@ -186,7 +189,7 @@ public class JDBC_DB } catch (SQLException e) { System.err.println("Ignoring database close connection exception"); //System.err.println("Ignoring exception " + e.getClass().getName() + ": " + e.getMessage()); - //e.printStackTrace(); + //LOG.log(Level.SEVERE, e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/util/XML.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/util/XML.java b/commons/src/main/java/org/apache/oodt/commons/util/XML.java index 2212c5e..2a6916b 100644 --- a/commons/src/main/java/org/apache/oodt/commons/util/XML.java +++ b/commons/src/main/java/org/apache/oodt/commons/util/XML.java @@ -83,6 +83,7 @@ import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.logging.Logger; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -104,6 +105,7 @@ import javax.xml.transform.stream.StreamResult; * @author Kelly */ public class XML { + private static Logger LOG = Logger.getLogger(XML.class.getName()); private static DocumentBuilder getStandardDocumentBuilder() { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -273,7 +275,7 @@ public class XML { * @param writer Where to write it. * @throws IOException If an I/O error occurs. */ - public static void serialize(Document doc, Writer writer) throws IOException { + public static void serialize(Document doc, Writer writer) { serialize(doc, writer, /*omitXMLDeclaration*/false); } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/commons/src/main/java/org/apache/oodt/commons/xml/XMLUtils.java ---------------------------------------------------------------------- diff --git a/commons/src/main/java/org/apache/oodt/commons/xml/XMLUtils.java b/commons/src/main/java/org/apache/oodt/commons/xml/XMLUtils.java index ba6b791..9688b13 100644 --- a/commons/src/main/java/org/apache/oodt/commons/xml/XMLUtils.java +++ b/commons/src/main/java/org/apache/oodt/commons/xml/XMLUtils.java @@ -49,7 +49,6 @@ import javax.xml.transform.stream.StreamResult; */ public class XMLUtils { - /* our log stream */ private final static Logger LOG = Logger .getLogger(XMLUtils.class.getName()); @@ -86,7 +85,7 @@ public class XMLUtils { xformer.setOutputProperty(OutputKeys.INDENT, "yes"); xformer.transform(source, result); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } } @@ -108,7 +107,7 @@ public class XMLUtils { DOMUtil.getSimpleElementText(valElem), encoding); values.add(value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error decoding tag: [" + elt + "]: val: [" + DOMUtil.getSimpleElementText(valElem) + "] from metadata. Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MimeExtractorConfigReader.java ---------------------------------------------------------------------- diff --git a/crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MimeExtractorConfigReader.java b/crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MimeExtractorConfigReader.java index d4140a1..041d6f6 100644 --- a/crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MimeExtractorConfigReader.java +++ b/crawler/src/main/java/org/apache/oodt/cas/crawl/typedetection/MimeExtractorConfigReader.java @@ -16,25 +16,27 @@ */ package org.apache.oodt.cas.crawl.typedetection; -//OODT imports import org.apache.oodt.cas.crawl.structs.exceptions.CrawlerActionException; import org.apache.oodt.cas.metadata.exceptions.MetExtractionException; import org.apache.oodt.cas.metadata.util.PathUtils; import org.apache.oodt.commons.xml.XMLUtils; -//JDK imports +import com.google.common.base.Strings; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.LinkedList; +import java.util.logging.Level; +import java.util.logging.Logger; +//JDK imports //W3C imports -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - //Google imports -import com.google.common.base.Strings; /** * Static reader class for {@link MimeExtractor}s. @@ -44,7 +46,7 @@ import com.google.common.base.Strings; */ public final class MimeExtractorConfigReader implements MimeExtractorConfigMetKeys { - + private static Logger LOG = Logger.getLogger(MimeExtractorConfigReader.class.getName()); private MimeExtractorConfigReader() throws InstantiationException { throw new InstantiationException("Don't construct reader classes!"); } @@ -166,22 +168,22 @@ public final class MimeExtractorConfigReader implements } return extractorRepo; } catch (IllegalAccessException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } catch (InstantiationException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } catch (MetExtractionException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } catch (FileNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } catch (CrawlerActionException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw e; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/crawler/src/main/java/org/apache/oodt/cas/crawl/util/CasPropertyPlaceholderConfigurer.java ---------------------------------------------------------------------- diff --git a/crawler/src/main/java/org/apache/oodt/cas/crawl/util/CasPropertyPlaceholderConfigurer.java b/crawler/src/main/java/org/apache/oodt/cas/crawl/util/CasPropertyPlaceholderConfigurer.java index 5e78e4a..e4abd38 100644 --- a/crawler/src/main/java/org/apache/oodt/cas/crawl/util/CasPropertyPlaceholderConfigurer.java +++ b/crawler/src/main/java/org/apache/oodt/cas/crawl/util/CasPropertyPlaceholderConfigurer.java @@ -19,11 +19,16 @@ package org.apache.oodt.cas.crawl.util; //OODT imports + import org.apache.oodt.cas.metadata.util.PathUtils; -//Spring imports import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import java.util.logging.Level; +import java.util.logging.Logger; + +//Spring imports + /** * * @author bfoster @@ -33,13 +38,13 @@ import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; */ public class CasPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { - + private static Logger LOG = Logger.getLogger(CasPropertyPlaceholderConfigurer.class.getName()); @Override protected String convertPropertyValue(String value) { try { return PathUtils.doDynamicReplacement(value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return value; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/services/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java index d67af9d..b291aa2 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java @@ -58,7 +58,6 @@ import javax.servlet.ServletContext; */ public class CurationServiceConfig implements CuratorConfMetKeys { private static CurationServiceConfig instance; - private final Map<String, String> parameters = new HashMap<String, String>(); private XmlRpcFileManagerClient fmClient = null; @@ -129,7 +128,7 @@ public class CurationServiceConfig implements CuratorConfMetKeys { try { return new XmlRpcFileManagerClient(new URL(this.getFileMgrURL())); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -193,7 +192,7 @@ public class CurationServiceConfig implements CuratorConfMetKeys { try { fmClient = new XmlRpcFileManagerClient(new URL(this.getFileMgrURL())); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to build CurationServiceConfig: Message: " + e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/services/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java index e46cd93..df718aa 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java @@ -92,7 +92,7 @@ public class DirectoryResource extends CurationService { try { relativePath = this.cleansePath(path); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Error decoding path: [" + path + "]: Message: " + e.getMessage()); return html.toString(); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/services/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java index 3c43174..2a63b54 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java @@ -27,7 +27,8 @@ import org.apache.oodt.cas.filemgr.ingest.StdIngester; import org.apache.oodt.cas.filemgr.structs.exceptions.IngestException; import org.apache.oodt.cas.metadata.Metadata; -//JDK imports +import net.sf.json.JSONObject; + import java.io.File; import java.net.URL; import java.util.Arrays; @@ -42,7 +43,6 @@ import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; -//JAX-RS imports import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -51,8 +51,9 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; +//JDK imports +//JAX-RS imports //JSON imports -import net.sf.json.JSONObject; /** * @@ -104,7 +105,7 @@ public class IngestionResource extends CurationService { CurationService.config.getMetExtrConfUploadPath()), metExtractorConfigId)); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); String errorMsg = "Unable to load extractor config from metExtCfgId: [" + metExtractorConfigId + "]"; LOG.log(Level.WARNING, errorMsg); @@ -163,7 +164,7 @@ public class IngestionResource extends CurationService { fileMet = metService.getStagingMetadata(vFilePath, task.getExtConf() .getIdentifier(), false); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return this.encodeIngestResponseAsHTML(false, e.getMessage()); } @@ -171,7 +172,7 @@ public class IngestionResource extends CurationService { ingest.ingest(safeGetUrl(CurationService.config.getFileMgrURL()), new File(file), fileMet); } catch (IngestException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return this.encodeIngestResponseAsHTML(false, e.getMessage()); } @@ -272,7 +273,7 @@ public class IngestionResource extends CurationService { try { return new URL(urlStr); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } @@ -297,7 +298,7 @@ public class IngestionResource extends CurationService { try { return fullFilePath.substring(startIdx); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return null; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java index 4492850..9d93b0d 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java @@ -19,6 +19,7 @@ package org.apache.oodt.cas.curation.service; //JDK imports + import org.apache.oodt.cas.curation.structs.ExtractorConfig; import org.apache.oodt.cas.curation.util.CurationXmlStructFactory; import org.apache.oodt.cas.curation.util.ExtractorConfigReader; @@ -62,6 +63,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -114,7 +117,7 @@ public class MetadataResource extends CurationService { public static final String UPDATE = "update"; public static final String DELETE = "delete"; - + private static Logger LOG = Logger.getLogger(MetadataResource.class.getName()); // single instance of CAS catalog shared among all requests private Catalog catalog = null; @@ -294,7 +297,7 @@ public class MetadataResource extends CurationService { productId); this.updateCatalogMetadata(prod, metadata); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return "<div class=\"error\">" + e.getMessage() + "</div>"; } @@ -574,7 +577,7 @@ public class MetadataResource extends CurationService { } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // return error message throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR); @@ -657,7 +660,7 @@ public class MetadataResource extends CurationService { } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); // return error message throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR); @@ -753,7 +756,7 @@ public class MetadataResource extends CurationService { xmlRepo.removeProductType(type); return true; } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return false; } } @@ -781,7 +784,7 @@ public class MetadataResource extends CurationService { vLayer.addParentForProductType(type, parentId); return true; } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return false; } @@ -800,7 +803,7 @@ public class MetadataResource extends CurationService { vLayer.removeParentForProductType(type); return true; } catch (RepositoryManagerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return false; } @@ -826,7 +829,7 @@ public class MetadataResource extends CurationService { } return true; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return false; } @@ -848,7 +851,7 @@ public class MetadataResource extends CurationService { } return JSONSerializer.toJSON(elementIds).toString(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return null; } @@ -870,7 +873,7 @@ public class MetadataResource extends CurationService { this.removeUnusedElements(elementList, xmlRepo, vLayer); return true; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return false; } @@ -897,7 +900,7 @@ public class MetadataResource extends CurationService { this.removeUnusedElements(elements, xmlRepo, vLayer); return true; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return false; } @@ -920,7 +923,7 @@ public class MetadataResource extends CurationService { } } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return JSONSerializer.toJSON(typeids).toString(); } @@ -956,7 +959,7 @@ public class MetadataResource extends CurationService { try { xmlRepo = new XMLRepositoryManager(Collections.singletonList(url)); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return xmlRepo; @@ -969,7 +972,7 @@ public class MetadataResource extends CurationService { try { vLayer = new XMLValidationLayer(Collections.singletonList(url)); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); } return vLayer; } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/services/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java ---------------------------------------------------------------------- diff --git a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java index 596e612..37d5d0d 100644 --- a/curator/services/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java +++ b/curator/services/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java @@ -52,9 +52,6 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; -//JDK imports -//JAX-RS imports -//JSON imports @Path("policy") public class PolicyResource extends CurationService { @@ -125,7 +122,7 @@ public class PolicyResource extends CurationService { page = config.getFileManagerClient().pagedQuery(new Query(), productType, pageNum); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to obtain products for product type: [" + productTypeName + "]: Message: " + e.getMessage()); return ""; @@ -188,7 +185,7 @@ public class PolicyResource extends CurationService { try { typeNames = this.getProductTypeNamesForPolicy(policy); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Unable to obtain product type names for policy: [" + policy + "]: Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/curator/webapp/src/main/java/org/apache/oodt/cas/curation/CurationApp.java ---------------------------------------------------------------------- diff --git a/curator/webapp/src/main/java/org/apache/oodt/cas/curation/CurationApp.java b/curator/webapp/src/main/java/org/apache/oodt/cas/curation/CurationApp.java index 00140a7..83d648d 100644 --- a/curator/webapp/src/main/java/org/apache/oodt/cas/curation/CurationApp.java +++ b/curator/webapp/src/main/java/org/apache/oodt/cas/curation/CurationApp.java @@ -68,7 +68,7 @@ public class CurationApp extends WebApplication { try { return (Class<? extends Page>) Class.forName(getHomePageClass()); } catch (ClassNotFoundException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); return HomePage.class; } } http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/DataSourceCatalog.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/DataSourceCatalog.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/DataSourceCatalog.java index 8d99122..4d0e145 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/DataSourceCatalog.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/DataSourceCatalog.java @@ -17,7 +17,6 @@ package org.apache.oodt.cas.filemgr.catalog; -//OODT imports import org.apache.oodt.cas.filemgr.structs.BooleanQueryCriteria; import org.apache.oodt.cas.filemgr.structs.Element; import org.apache.oodt.cas.filemgr.structs.Product; @@ -147,7 +146,7 @@ public class DataSourceCatalog implements Catalog { metadataTypes = validationLayer.getElements(product .getProductType()); } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -169,7 +168,7 @@ public class DataSourceCatalog implements Catalog { try { addMetadataValue(element, product, value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log( Level.WARNING, @@ -202,7 +201,7 @@ public class DataSourceCatalog implements Catalog { metadataTypes = validationLayer.getElements(product .getProductType()); } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -217,7 +216,7 @@ public class DataSourceCatalog implements Catalog { try { removeMetadataValue(element, product, value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log( Level.WARNING, @@ -321,7 +320,7 @@ public class DataSourceCatalog implements Catalog { } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding product. Message: " + e.getMessage()); try { @@ -467,7 +466,7 @@ public class DataSourceCatalog implements Catalog { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception removing product. Message: " + e.getMessage()); try { @@ -526,7 +525,7 @@ public class DataSourceCatalog implements Catalog { statement.execute(modifyProductSql); conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception setting transfer status for product. Message: " + e.getMessage()); @@ -605,7 +604,7 @@ public class DataSourceCatalog implements Catalog { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding product references. Message: " + e.getMessage()); @@ -668,7 +667,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting product. Message: " + e.getMessage()); try { @@ -741,7 +740,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting product. Message: " + e.getMessage()); try { @@ -820,7 +819,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting product type. Message: " + e.getMessage()); try { @@ -897,7 +896,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting products. Message: " + e.getMessage()); try { @@ -981,7 +980,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting products. Message: " + e.getMessage()); try { @@ -1052,7 +1051,7 @@ public class DataSourceCatalog implements Catalog { try { elements = validationLayer.getElements(product.getProductType()); } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -1073,7 +1072,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting metadata. Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); @@ -1145,7 +1144,7 @@ public class DataSourceCatalog implements Catalog { try { elements = validationLayer.getElements(product.getProductType()); } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -1166,7 +1165,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting metadata. Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); @@ -1270,7 +1269,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting top N products. Message: " + e.getMessage()); @@ -1361,7 +1360,7 @@ public class DataSourceCatalog implements Catalog { statement.execute(metaIngestSql); conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding metadata value. Message: " + e.getMessage()); try { @@ -1424,7 +1423,7 @@ public class DataSourceCatalog implements Catalog { statement.execute(metRemoveSql.toString()); conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception removing metadata value. Message: " + e.getMessage()); @@ -1493,7 +1492,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting num products. Message: " + e.getMessage()); try { @@ -1813,7 +1812,7 @@ public class DataSourceCatalog implements Catalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception performing get num results. Message: " + e.getMessage()); @@ -2034,7 +2033,7 @@ public class DataSourceCatalog implements Catalog { return productIds; } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception performing query. Message: " + e.getMessage()); try { @@ -2184,7 +2183,7 @@ public class DataSourceCatalog implements Catalog { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception updating product references. Message: " + e.getMessage()); http://git-wip-us.apache.org/repos/asf/oodt/blob/f286ded4/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/LenientDataSourceCatalog.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/LenientDataSourceCatalog.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/LenientDataSourceCatalog.java index c09e767..8f3132d 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/LenientDataSourceCatalog.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/catalog/LenientDataSourceCatalog.java @@ -113,7 +113,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { try { addMetadataValue(metadataId, product, value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log( Level.WARNING, @@ -146,7 +146,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { } } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -190,7 +190,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { try { removeMetadataValue(metadataId, product, value); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG .log( Level.WARNING, @@ -233,7 +233,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { m = populateProductMetadata(rs, product); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting metadata. Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); @@ -281,7 +281,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { try { elements = getValidationLayer().getElements(product.getProductType()); } catch (ValidationLayerException e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); throw new CatalogException( "ValidationLayerException when trying to obtain element list for product type: " + product.getProductType().getName() @@ -368,7 +368,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception getting metadata. Message: " + e.getMessage()); throw new CatalogException(e.getMessage(), e); @@ -450,7 +450,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception adding metadata value. Message: " + e.getMessage()); try { @@ -517,7 +517,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { statement.execute(metRemoveSql); conn.commit(); } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception removing metadata value. Message: " + e.getMessage()); @@ -713,7 +713,7 @@ public class LenientDataSourceCatalog extends DataSourceCatalog { } } catch (Exception e) { - e.printStackTrace(); + LOG.log(Level.SEVERE, e.getMessage()); LOG.log(Level.WARNING, "Exception performing get num results. Message: " + e.getMessage());
