From: "John McNally" <[EMAIL PROTECTED]>
> Can you send in your modified patch, so I can apply it to the 2.1
> branch?
> 
> john mcnally

John,

I really want to work out how to do this properly, but I am pushing
against a deadline here.  I hope the following helps.

Thanks again,

Scott

--- src/java/org/apache/turbine/services/intake/TurbineIntakeService.javaThu Jul
 26 10:57:08 2001
+++ webapps/cmes/WEB-INF/src/java/org/apache/turbine/services/intake/TurbineInta
keService.java  Fri Jul 27 10:22:55 2001
@@ -147,6 +147,14 @@
     {
         Properties props = getProperties();
         String xmlPath = props.getProperty(XML_PATH);
+        if ( xmlPath == null )
+        {
+            String pathError =
+                "Path to intake.xml was not specified.  Check that the" +
+                " property exists in TR.props and was loaded.";
+            Log.error(pathError);
+            throw new InitializationException(pathError);
+        }
         String appDataPath = "WEB-INF/appData.ser";
         try
         {
@@ -168,11 +176,22 @@
                 XmlToAppData xmlApp = new XmlToAppData();
                 appData = xmlApp.parseFile(xmlPath);

-                OutputStream out = new FileOutputStream(serialAppData);
-                ObjectOutputStream p = new ObjectOutputStream(out);
-                p.writeObject(appData);
-                p.flush();
-                out.close();
+                try
+                {
+                    OutputStream out = new FileOutputStream(serialAppData);
+                    ObjectOutputStream p = new ObjectOutputStream(out);
+                    p.writeObject(appData);
+                    p.flush();
+                    out.close();
+                }
+                catch (Exception e)
+                {
+                    Log.info(
+                        "Intake initialization could not be serialized " +
+                        "because writing to " + appDataPath + " was not " +
+                        "allowed.  This will require that the xml filebe " +
+                        "parsed when restarting the application.");
+                }
             }

             groupNames = new String[appData.getGroups().size()];


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to