Repository: incubator-reef
Updated Branches:
  refs/heads/master e6e7b3b65 -> 8878d5884


[REEF-234]: Get better error messages from java client when invoked from .net 
client

This addressed the issue byc apturing stderr and stdout and outputting
them.

JIRA:
  [REEF-234](https://issues.apache.org/jira/browse/REEF-234)

This closes #131


Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/8878d588
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/8878d588
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/8878d588

Branch: refs/heads/master
Commit: 8878d5884714271a8acfe9055f4121898663c919
Parents: e6e7b3b
Author: Beysim Sezgin <[email protected]>
Authored: Tue Mar 31 14:50:55 2015 -0700
Committer: Markus Weimer <[email protected]>
Committed: Tue Mar 31 15:00:52 2015 -0700

----------------------------------------------------------------------
 .../Bridge/ClrClientHelper.cs                   |  24 ++++++++++++++++++-
 lang/cs/Org.Apache.REEF.sln                     | Bin 40506 -> 40196 bytes
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/8878d588/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs 
b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
index d032241..56c77ce 100644
--- a/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
+++ b/lang/cs/Org.Apache.REEF.Driver/Bridge/ClrClientHelper.cs
@@ -41,7 +41,6 @@ namespace Org.Apache.REEF.Driver.Bridge
                     ClrHandlerHelper.CopyDllsToAppDirectory(appDlls);
                     UpdateJarFileWithAssemblies(reefJar);
                 }
-
                 using (LOGGER.LogScope("ClrHandlerHelper::serialize 
driverBridgeConfig to clrRuntimeConfigFile"))
                 {
                     string clrRuntimeConfigFile = Path.Combine(clrFolder, 
Constants.DriverBridgeConfiguration);
@@ -72,11 +71,34 @@ namespace Org.Apache.REEF.Driver.Bridge
                                           " " + clrFolder + " " + 
driverSubmissionSettings.ToComamndLineArguments();
                 }
                 startInfo.RedirectStandardOutput = true;
+                startInfo.RedirectStandardError = true;
                 startInfo.UseShellExecute = false;
                 startInfo.CreateNoWindow = false;
                 LOGGER.Log(Level.Info, "Executing\r\n" + startInfo.FileName + 
"\r\n" + startInfo.Arguments);
+                LOGGER.Log(Level.Info, "Current Directroy " + 
Directory.GetCurrentDirectory());
                 using (Process process = Process.Start(startInfo))
                 {
+                    process.ErrorDataReceived += (sender, errorLine) =>
+                    {
+                        if (errorLine.Data != null)
+                        {
+                            Trace.WriteLine(errorLine.Data);
+                            Console.WriteLine(errorLine.Data);
+                        }
+                        ;
+                    };
+                    process.OutputDataReceived += (sender, outputLine) =>
+                    {
+                        if (outputLine.Data != null)
+                        {
+                            Trace.WriteLine(outputLine.Data);
+                            Console.WriteLine(outputLine.Data);
+                        }
+                        
+                    };
+                    process.BeginErrorReadLine();
+                    process.BeginOutputReadLine();
+
                     process.WaitForExit();
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/8878d588/lang/cs/Org.Apache.REEF.sln
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.sln b/lang/cs/Org.Apache.REEF.sln
index 136b0a9..cfaace9 100644
Binary files a/lang/cs/Org.Apache.REEF.sln and b/lang/cs/Org.Apache.REEF.sln 
differ

Reply via email to