Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 65976 Details for
Bug 185625
MAX: Show error log automatically when exceptions are thrown in MAX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Original patch submitted by Saurabh for 167280
185625_originally_from_167280.patch (text/plain), 7.97 KB, created by
Balan Subramanian
on 2007-05-04 18:38:11 EDT
(
hide
)
Description:
Original patch submitted by Saurabh for 167280
Filename:
MIME Type:
Creator:
Balan Subramanian
Created:
2007-05-04 18:38:11 EDT
Size:
7.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.monitoring.managedagent >Index: src/org/eclipse/tptp/monitoring/managedagent/provisional/ManagedResourceAgent.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.monitoring.managedagent/src/org/eclipse/tptp/monitoring/managedagent/provisional/ManagedResourceAgent.java,v >retrieving revision 1.3 >diff -u -r1.3 ManagedResourceAgent.java >--- src/org/eclipse/tptp/monitoring/managedagent/provisional/ManagedResourceAgent.java 22 Mar 2007 06:04:59 -0000 1.3 >+++ src/org/eclipse/tptp/monitoring/managedagent/provisional/ManagedResourceAgent.java 27 Apr 2007 14:28:00 -0000 >@@ -17,7 +17,11 @@ > import java.util.ArrayList; > import java.util.Hashtable; > >+import org.eclipse.core.filesystem.EFS; >+import org.eclipse.core.filesystem.IFileStore; >+import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.hyades.internal.execution.local.common.CustomCommand; > import org.eclipse.hyades.internal.execution.local.common.DataProcessor; > import org.eclipse.hyades.internal.execution.local.control.Agent; >@@ -26,10 +30,16 @@ > import org.eclipse.hyades.internal.execution.local.control.InactiveAgentException; > import org.eclipse.hyades.internal.execution.local.control.InactiveProcessException; > import org.eclipse.hyades.internal.execution.local.control.Process; >+import org.eclipse.swt.widgets.Display; > import org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin; > import org.eclipse.tptp.monitoring.managedagent.internal.Constants; > import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandSerializer; > import org.eclipse.tptp.monitoring.managedagent.provisional.commands.CommandWrapper; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.ide.IDE; > > /** > * An abstract class that implements the TPTP Agent interface and allows follows the custom command API defined for managed agents. >@@ -445,10 +455,43 @@ > sendResponse(_command); > }catch(Exception ex){ > throwException(ex); >+ openErrorLog(ex); > } > }catch(Exception e){ >- ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$ >+ ManagedAgentPlugin.getDefault().log(Messages.getString("ManagedResourceAgent.CANT_SERICE_CUSTOM_COMMAND.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$ > setActive(false); > } > } >+ >+ private void openErrorLog(Exception ex) >+ { >+ // Ignore the warning message "IWAT0753I Found and instantiated Apache Muse Runtime WSDM runtime" >+ boolean museFoundMessage = ex.getMessage().indexOf("IWAT0753I")!=-1; >+ // Ignore the warning message "IWAT0761I This resource is not a service group" >+ boolean sgMessage = ex.getMessage().indexOf("IWAT0761I")!=-1 || ex.getMessage().indexOf("IWAT0762E")!=-1; >+ if(museFoundMessage || sgMessage) >+ return; >+ >+ IPath logPath = Platform.getLogFileLocation(); >+ final IFileStore fileStore = EFS.getLocalFileSystem().getStore(logPath); >+ if(!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) >+ { >+ Display display = PlatformUI.getWorkbench().getDisplay(); >+ display.asyncExec(new Runnable(){ >+ >+ public void run() { >+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); >+ IWorkbenchPage page = window.getActivePage(); >+ try >+ { >+ IDE.openEditorOnFileStore(page, fileStore); >+ } >+ catch(PartInitException _ex) >+ { >+ _ex.printStackTrace(); >+ } >+ }}); >+ } >+ } >+ > } >\ No newline at end of file >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.monitoring.managedagent/META-INF/MANIFEST.MF,v >retrieving revision 1.4 >diff -u -r1.4 MANIFEST.MF >--- META-INF/MANIFEST.MF 23 Mar 2007 17:51:19 -0000 1.4 >+++ META-INF/MANIFEST.MF 27 Apr 2007 14:28:00 -0000 >@@ -13,7 +13,9 @@ > Require-Bundle: org.eclipse.tptp.platform.models;visibility:=reexport, > org.eclipse.hyades.execution;visibility:=reexport, > org.eclipse.hyades.trace.ui;visibility:=reexport, >- org.eclipse.ui;visibility:=reexport >+ org.eclipse.ui;visibility:=reexport, >+ org.eclipse.core.filesystem, >+ org.eclipse.ui.ide > Eclipse-LazyStart: true > Bundle-Vendor: %plugin.provider > Bundle-Activator: org.eclipse.tptp.monitoring.managedagent.ManagedAgentPlugin >#P org.eclipse.tptp.monitoring.managedagent.wsdm >Index: src/org/eclipse/tptp/monitoring/managedagent/wsdm/provisional/agents/WSDMAgent.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.monitoring.managedagent.wsdm/src/org/eclipse/tptp/monitoring/managedagent/wsdm/provisional/agents/WSDMAgent.java,v >retrieving revision 1.11 >diff -u -r1.11 WSDMAgent.java >--- src/org/eclipse/tptp/monitoring/managedagent/wsdm/provisional/agents/WSDMAgent.java 26 Apr 2007 22:49:26 -0000 1.11 >+++ src/org/eclipse/tptp/monitoring/managedagent/wsdm/provisional/agents/WSDMAgent.java 27 Apr 2007 14:28:02 -0000 >@@ -116,7 +116,8 @@ > }catch(Exception e){ > Activator.getDefault().log(Messages.getString("WSDMAgent.CANT_INIT_AGENT.ERROR."), e, IStatus.ERROR); //$NON-NLS-1$ > setActive(false); >- return false; >+ throw e; >+ //return false; > } > } > >#P org.eclipse.tptp.monitoring.managedagent.wsdm.muse >Index: src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.monitoring.managedagent.wsdm.muse/src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java,v >retrieving revision 1.4 >diff -u -r1.4 MuseRuntime.java >--- src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java 27 Apr 2007 00:47:30 -0000 1.4 >+++ src/org/eclipse/tptp/monitoring/managedagent/wsdm/internal/muse/MuseRuntime.java 27 Apr 2007 14:28:05 -0000 >@@ -15,12 +15,15 @@ > import java.util.ArrayList; > import java.util.Hashtable; > >+import javax.xml.namespace.QName; >+ > import org.apache.muse.tools.inspector.ResourceInspector; > import org.apache.muse.util.xml.XmlUtils; > import org.apache.muse.ws.addressing.EndpointReference; > import org.apache.muse.ws.dm.muws.MuwsConstants; > import org.apache.muse.ws.metadata.remote.MetadataExchangeClient; > import org.apache.muse.ws.notification.WsnConstants; >+import org.apache.muse.ws.resource.properties.WsrpConstants; > import org.apache.muse.ws.resource.remote.WsResourceClient; > import org.apache.muse.ws.resource.sg.WssgConstants; > import org.eclipse.core.runtime.IStatus; >@@ -87,7 +90,8 @@ > }else{ > MuseRuntimePlugin.getDefault().log(Messages.getString("MuseRuntime.CANT_CONN.ERROR."), t, IStatus.ERROR); //$NON-NLS-1$ > } >- return false; >+ throw new Exception(t); >+ //return false; > } > return true; > } >@@ -137,9 +141,12 @@ > return result; > } > >- public Object[] getResourceProperty(String propQName) throws Exception { >+ public Object[] getResourceProperty(String qnameStr) throws Exception { > // smashing of values into one string happens in UI controller >- Element[] results = _resource.getResourceProperty(CommonUtils.deserializeFromString(propQName)); >+ QName propQName = CommonUtils.deserializeFromString(qnameStr); >+ if(propQName.getNamespaceURI().equals(WsrpConstants.NAMESPACE_URI)) >+ propQName = new QName(propQName.getNamespaceURI(), propQName.getLocalPart(), WsrpConstants.PREFIX); >+ Element[] results = _resource.getResourceProperty(propQName); > String[] ret = new String[results.length]; > for (int i = 0; i < results.length; i++) { > ret[i] = XmlUtils.extractText(results[i]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185625
: 65976 |
70108