*** empty log message ***
diff --git a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml b/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml
index 43b54ff..bdafed2 100644
--- a/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xsl.debug.ui/plugin.xml
@@ -77,7 +77,7 @@
<shortcut
class="org.eclipse.wst.xsl.internal.debug.ui.XSLLaunchShortcut"
id="org.eclipse.wst.xsl.debug.ui.launchshortcut"
- label="XSL Transformation" modes="run, debug">
+ label="XSL Transformation" modes="run, debug, profile">
<contextualLaunch>
<enablement>
<with variable="selection">
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchHelper.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchHelper.java
index 51da14b..2555cd6 100644
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchHelper.java
+++ b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/config/LaunchHelper.java
@@ -373,6 +373,7 @@
}
catch (IOException e)
{
+ LaunchingPlugin.log(e);
}
finally
{
@@ -384,6 +385,7 @@
}
catch (IOException e)
{
+ LaunchingPlugin.log(e);
}
}
}
diff --git a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugTarget.java b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugTarget.java
index 89edcf4..258f3bc 100644
--- a/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugTarget.java
+++ b/bundles/org.eclipse.wst.xsl.launching/src/org/eclipse/wst/xsl/launching/model/XSLDebugTarget.java
@@ -14,6 +14,7 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
+import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URL;
@@ -55,6 +56,9 @@
private final byte[] VALUE_MAP_LOCK = new byte[0];
private final byte[] WRITE_LOCK = new byte[0];
+ private final int CONNECT_ATTEMPTS = 10;
+ private final int CONNECT_WAIT = 1000;
+
private final IProcess process;
private final ILaunch launch;
private final XSLThread thread;
@@ -85,16 +89,12 @@
try
{
- this.requestSocket = new Socket("localhost", launchHelper.getRequestPort());
+ this.requestSocket = attemptConnect(launchHelper.getRequestPort());
this.requestWriter = new PrintWriter(requestSocket.getOutputStream());
this.requestReader = new BufferedReader(new InputStreamReader(requestSocket.getInputStream()));
- this.eventSocket = new Socket("localhost", launchHelper.getEventPort());
+ this.eventSocket = attemptConnect(launchHelper.getEventPort());
this.eventReader = new BufferedReader(new InputStreamReader(eventSocket.getInputStream()));
}
- catch (UnknownHostException e)
- {
- abort("Unable to connect to debugger", e);
- }
catch (IOException e)
{
abort("Unable to connect to debugger", e);
@@ -107,6 +107,33 @@
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
}
+
+ private Socket attemptConnect(int port) throws CoreException
+ {
+ Socket socket = null;
+ for(int i=0;i<CONNECT_ATTEMPTS;i++)
+ {
+ try
+ {
+ socket = new Socket("localhost",port);
+ }
+ catch (ConnectException e)
+ {}
+ catch (IOException e)
+ {}
+ if (socket != null)
+ break;
+ try
+ {
+ Thread.sleep(CONNECT_WAIT);
+ }
+ catch (InterruptedException e)
+ {}
+ }
+ if (socket == null)
+ throw new CoreException(new Status(Status.ERROR, LaunchingPlugin.PLUGIN_ID, "Could not connect to socket "+port+" after "+CONNECT_ATTEMPTS+" attempts"));
+ return socket;
+ }
public IProcess getProcess()
{
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java
index 4f6c8b0..92506b6 100644
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java
+++ b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanTraceListener.java
@@ -15,8 +15,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xalan.templates.Constants;
-import org.apache.xalan.templates.ElemTemplateElement;
-import org.apache.xalan.templates.ElemVariable;
import org.apache.xalan.trace.EndSelectionEvent;
import org.apache.xalan.trace.ExtensionEvent;
import org.apache.xalan.trace.GenerateEvent;
diff --git a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java
index a8ddf23..68f044f 100644
--- a/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java
+++ b/bundles/org.eclipse.wst.xsl.xalan/src-debugger/org/eclipse/wst/xsl/xalan/debugger/XalanVariable.java
@@ -84,7 +84,7 @@
e.printStackTrace();
}
// value = getScope()+"."+getSlotNumber()+")"+getName();
- log.debug(getScope()+"."+getSlotNumber()+")"+getName() + "=" + value);
+// log.debug(getScope()+"."+getSlotNumber()+")"+getName() + "=" + value);
return value;
}