[jboss-svn-commits] JBL Code SVN: r8160 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Dec 8 17:07:30 EST 2006


Author: estebanschifman
Date: 2006-12-08 17:07:29 -0500 (Fri, 08 Dec 2006)
New Revision: 8160

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
Log:
Add logging to make Object stream problem in Windows more evident

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2006-12-08 21:59:54 UTC (rev 8159)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2006-12-08 22:07:29 UTC (rev 8160)
@@ -38,6 +38,7 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.apache.log4j.Logger;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
 import org.jboss.soa.esb.helpers.KeyValuePair;
@@ -125,11 +126,20 @@
 
 	public static Message messageFromLocalFile(File from)
 		throws FileNotFoundException,IOException,ClassNotFoundException, ClassCastException
-			,ParserConfigurationException, SAXException 
+			,ParserConfigurationException, SAXException , CourierException 
 	{
-		ObjectInputStream reader = new ObjectInputStream(new FileInputStream(from));
+		ObjectInputStream reader = null;
 		Serializable serial = null;
-		try { serial = (Serializable)reader.readObject(); }
+		try
+		{ 
+			reader = new ObjectInputStream(new FileInputStream(from));
+			serial = (Serializable)reader.readObject(); 
+		}
+		catch (Exception e)
+		{
+			_logger.error("THIS IS BAD - Only seems to happen in Windows",e);
+			throw new CourierException(e);
+		}
 		finally {	reader.close(); }
 		return Util.deserialize(serial);
 	}
@@ -170,4 +180,6 @@
 		out.write(bytes);
 		out.close();
 	}
+	
+	protected static Logger _logger = Logger.getLogger(CourierUtil.class);
 }




More information about the jboss-svn-commits mailing list