Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2012-04-19 11:12:59 +0000
committerZeb Ford-Reitz2012-04-19 14:33:07 +0000
commitd8acace8d2f34dbef3aaa2c2be241b6d9a424f01 (patch)
treefe53d952f86402a8e6b55fb0eb130dd9a77d8b55
parent920040c32e7d818e2d40749d534c84dc5eefe68b (diff)
downloadorg.eclipse.jubula.core-d8acace8d2f34dbef3aaa2c2be241b6d9a424f01.tar.gz
org.eclipse.jubula.core-d8acace8d2f34dbef3aaa2c2be241b6d9a424f01.tar.xz
org.eclipse.jubula.core-d8acace8d2f34dbef3aaa2c2be241b6d9a424f01.zip
fixes https://bugs.eclipse.org/bugs/show_bug.cgi?id=375655
The log listener registered during activation of the o.e.j.client.ui.rcp bundle seems to have been the cause of the problem. As it uses UI elements to report errors, it should never be registered when running a purely headless application. Unfortunately, it looks as though this bundle may be accidentally activated in some circumstances (which I was unable to reproduce) while running a headless Jubula application (ex. dbtool, testexec). To resolve the issue, I have moved the log listener registration code from the bundle activator to Jubula application startup. A side-effect of this is that general exceptions during job execution will no longer be handled by Jubula's custom exception handler (i.e. no Jubula error dialog) when Jubula is running as a Feature / Plug-in (ex. Jubula installed into IDE, Eclipse for Testers). I think that this actually makes the exception handling a bit more clear, so I don't see it as a drawback.
-rw-r--r--org.eclipse.jubula.app/src/org/eclipse/jubula/app/Launcher.java12
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/Plugin.java9
2 files changed, 12 insertions, 9 deletions
diff --git a/org.eclipse.jubula.app/src/org/eclipse/jubula/app/Launcher.java b/org.eclipse.jubula.app/src/org/eclipse/jubula/app/Launcher.java
index 74469b420..972162466 100644
--- a/org.eclipse.jubula.app/src/org/eclipse/jubula/app/Launcher.java
+++ b/org.eclipse.jubula.app/src/org/eclipse/jubula/app/Launcher.java
@@ -21,6 +21,8 @@ import java.util.Properties;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
@@ -30,6 +32,7 @@ import org.eclipse.jubula.app.core.JubulaWorkbenchAdvisor;
import org.eclipse.jubula.app.core.WorkSpaceData;
import org.eclipse.jubula.app.i18n.Messages;
import org.eclipse.jubula.app.ui.ChooseWorkspaceDialog;
+import org.eclipse.jubula.client.ui.rcp.Plugin;
import org.eclipse.jubula.tools.constants.StringConstants;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
@@ -336,6 +339,15 @@ public class Launcher implements IApplication,
shell.dispose();
}
}
+
+ Platform.addLogListener(new ILogListener() {
+ public void logging(IStatus status, String pluginId) {
+ if (status.getException() instanceof RuntimeException) {
+ Plugin.getDefault().handleError(status.getException());
+ }
+ }
+ });
+
// create the workbench with this advisor and run it until it exits
// N.B. createWorkbench remembers the advisor, and also registers
// the
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/Plugin.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/Plugin.java
index 5e0c63e61..2ac04426e 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/Plugin.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/Plugin.java
@@ -21,8 +21,6 @@ import java.util.Set;
import javax.persistence.PersistenceException;
import org.apache.commons.lang.Validate;
-import org.eclipse.core.runtime.ILogListener;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -993,13 +991,6 @@ public class Plugin extends AbstractUIPlugin implements IProgressConsole {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- Platform.addLogListener(new ILogListener() {
- public void logging(IStatus status, String pluginId) {
- if (status.getException() instanceof RuntimeException) {
- handleError(status.getException());
- }
- }
- });
ErrorMessagePresenter.setPresenter(new IErrorMessagePresenter() {
public void showErrorMessage(JBException ex, Object[] params,
String[] details) {

Back to the top