Author: painter
Date: Mon Jan 29 15:31:33 2018
New Revision: 1822519

URL: http://svn.apache.org/viewvc?rev=1822519&view=rev
Log:
Fix for parallel deployment file not found exception

Modified:
    
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java

Modified: 
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
URL: 
http://svn.apache.org/viewvc/turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java?rev=1822519&r1=1822518&r2=1822519&view=diff
==============================================================================
--- 
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
 (original)
+++ 
turbine/fulcrum/trunk/intake/src/java/org/apache/fulcrum/intake/IntakeServiceImpl.java
 Mon Jan 29 15:31:33 2018
@@ -778,11 +778,22 @@ public class IntakeServiceImpl extends A
 
             for (File xmlFile : xmlFiles)
             {
-                getLogger().debug("Now parsing: " + xmlFile);
-                AppData appData = (AppData)um.unmarshal(xmlFile);
-
-                appDataElements.put(appData, xmlFile);
-                getLogger().debug("Saving appData for " + xmlFile);
+               if ( xmlFile.canRead() )
+               {
+                       getLogger().debug("Now parsing: " + xmlFile);
+                       
+                       // fix for parallel deployment, passing file directly 
results in file not found exception
+                       FileInputStream fis = new FileInputStream(xmlFile);
+                       AppData appData = (AppData)um.unmarshal(fis);
+                       fis.close();
+       
+                       if ( appData != null ) {
+                               appDataElements.put(appData, xmlFile);
+                               getLogger().debug("Saving appData for " + 
xmlFile);
+                       }
+               } else {
+                       throw new Exception("Could not read Intake XML File: " 
+ xmlFile.getPath());
+               }
             }
 
             getLogger().debug("Parsing took " + (System.currentTimeMillis() - 
timer));


Reply via email to