I have an application, in which I can save the load perspective layout.
Everything works until I add Binding Context to any Part. If I set Binding Context to part, then save layout, then close application and try to load layout in opened application again I get exception:
!ENTRY org.eclipse.e4.ui.workbench.swt 4 2 2016-10-16 20:54:37.922
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench.swt".
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException: A handle object may not have a null identifier
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:90)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:343)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:358)
at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:663)
at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:669)
at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$1.run(ShellActivationListener.java:95)
here is my steps:
test handler class:
public class Test {
#Execute
public void execute(EPartService partService) {
System.out.println("Test handler");
}
}
Create handler:
Then create Binding Contect, Binding table with KeyBinding
finally add BindingContext to part:
Loading and saving layout code is same as in this tutorial Model persistence article 3
Maybe someone knows what problem can be and is there are any solution?
Related
I have an aspect (attribute) that I want to be sure is being added to the correct classes/events during compile time (technically, after compile time when PostSharp is instrumenting the code), so I have tried to add a WriteLine statement in the CompileTimeInitialize() method, but nothing is ever emitted to the "build" window:
[PSerializable]
public class LogEventAttribute : EventInterceptionAspect
{
public override void CompileTimeInitialize(EventInfo targetEvent, AspectInfo aspectInfo)
{
Console.Out.WriteLine($">>>> EVENT: {targetEvent.Name} CLASS: {targetEvent.DeclaringType?.FullName}");
base.CompileTimeInitialize(targetEvent, aspectInfo);
}
}
I have also tried Console.Error.WriteLine(), Debug.WriteLine(), and Trace.WriteLine() all to no avail. Any suggestions as there appears to be no documentation (that I can find anyway) regarding this on the PostSharp site.
Using Message.Write.
Console.WriteLine does not work because compilation happens in a background process.
I've run into the dreaded Reflection.emit issue in my webplayer build and am unable to locate what is triggering it. I'm currently commenting out code method by method and rebuilding to locate the cause and have narrowed it down to the below.
I'm not using JSON so the various JSON libraries aren't the cause, nor any of the other result suggestions returned by google.
How can i more easily go about locating the cause of this error. I have full stack trace on and well as full debugging, but all i get is the following console output.
NotSupportedException: C:\Program Files\Unity 2018.2.0b2\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
Rethrow as TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception.
//NOTE: appM.procM is a C# .Net 4.x dynamic variable EG:
//public dynamic procM = GetProcClass(strProcName)
public void ShowProcList() {
/* Rest of method commented out*/
if(appM.procM == null){
procList.Initialize(appM.procM.lstNames, this);
}
/* Rest of method commented out*/
}
public void Initialize(List<string> lstNames, UIM um, string currProc=null) {
uiM = um;
//cleanup of the list before populating
foreach(Transform fld in Panel.transform) {
Destroy(fld.gameObject);
}
/* Rest of method commented out*/
}
Update: I narrowed down the problem line of code, but haven't closed the question as there's got to be an easier way than commenting out line by line and rebuilding.
For future searchers, the issue is the if(appM.procM == null) check. As procM is a dynamic variable reflection is used which kills AOT in webGL builds. No compiler warnings were generated to save myself from myself.
Nevermind, i am an idiot, The option Enable Exceptions under Player Settings was set to Full Without Stacktrace and not Full with Stacktrace.
The value Full With Stacktrace contains the pertinent data. Easily locatable in the browsers console. Warning that full debugging does increase build times and slow down the application.
I know there are lots of such questions here and most of them are answered. But the answers just won't solve my case.
I'm working on an eclipse plugin project, have a customized project type which can be either run or debugged. I have implemented the run and debug function and everything I expected are displayed on the screen, except the console shows an exception:
!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-04-28 23:31:17.410
!MESSAGE Internal error during tool item enablement updating, this is only logged once per tool item.
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4441)
at org.eclipse.swt.SWT.error(SWT.java:4356)
at org.eclipse.swt.SWT.error(SWT.java:4327)
at org.eclipse.swt.widgets.Widget.error(Widget.java:783)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:574)
at org.eclipse.swt.widgets.Widget.getData(Widget.java:874)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateIcons(HandledContributionItem.java:546)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:440)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.update(HandledContributionItem.java:430)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$3.run(HandledContributionItem.java:168)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateItemEnablement(HandledContributionItem.java:196)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolItemUpdater.updateContributionItems(ToolItemUpdater.java:39)
at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$8.changed(ToolBarManagerRenderer.java:367)
at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:110)
at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:338)
at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:352)
at org.eclipse.ui.internal.services.EvaluationService.contextEvaluate(EvaluationService.java:139)
at org.eclipse.ui.internal.services.EvaluationService.addSourceProvider(EvaluationService.java:180)
at org.eclipse.debug.internal.ui.contexts.DebugContextSourceProvider.<init>(DebugContextSourceProvider.java:51)
at org.eclipse.debug.internal.ui.contexts.DebugWindowContextService.<init>(DebugWindowContextService.java:62)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.createService(DebugContextManager.java:163)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getContextService(DebugContextManager.java:221)
at org.eclipse.debug.internal.ui.views.ViewContextService.<init>(ViewContextService.java:620)
at org.eclipse.debug.internal.ui.views.ViewContextManager.windowOpened(ViewContextManager.java:93)
at org.eclipse.debug.internal.ui.views.ViewContextManager.<init>(ViewContextManager.java:55)
at org.eclipse.debug.internal.ui.views.ViewContextManager.getDefault(ViewContextManager.java:44)
at org.eclipse.debug.internal.ui.contexts.DebugContextManager.getDefault(DebugContextManager.java:150)
at org.eclipse.debug.ui.DebugUITools.getDebugContextManager(DebugUITools.java:1068)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupService.<init>(SourceLookupService.java:40)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.windowOpened(SourceLookupManager.java:91)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.<init>(SourceLookupManager.java:41)
at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager.getDefault(SourceLookupManager.java:53)
at org.eclipse.debug.internal.ui.DebugUIPlugin.initializeLaunchListeners(DebugUIPlugin.java:935)
at org.eclipse.debug.internal.ui.DebugUIPlugin.launchAdded(DebugUIPlugin.java:920)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.run(LaunchManager.java:451)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.debug.internal.core.LaunchManager$LaunchNotifier.notify(LaunchManager.java:438)
at org.eclipse.debug.internal.core.LaunchManager.fireUpdate(LaunchManager.java:1044)
at org.eclipse.debug.internal.core.LaunchManager.addLaunch(LaunchManager.java:708)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:834)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
My codes are as following: In LaunchShortCut.java I have
Display.getDefault().syncExec(new Runnable() {
#Override
public void run() {
Shell activeShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if(DebugUITools.openLaunchConfigurationDialog(activeShell, config, group, null) == Window.CANCEL){
return;
}
}
});
This trigger the LaunchConfigurationWindow, and does not show any exception in console. When I hit the "run" in this window, the process stops at the first line in the following code where I have a breakpoint, and shows the exception in the console.
Display.getDefault().syncExec(new Runnable() {
#Override
public void run() {
//clear old output
HTMLOutput htmloutput = (HTMLOutput) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("my.view.id");
}
}
From the stack trace of the exception I don't see anything related to my code. If I let the program go on running, everything is fine, I don't see any trouble this exception causes, but I just can't figure what's it about and can't even stop it from showing up. Please help me on this issue.
It seems that you've hit a bug in Eclipse. The same stacktrace is described in Bug 445560. Chances are that the workaround described in this bug report (see comment 4) also helps in your case:
As current local workaround for this issue I've added in our rcp code an early call to DebugUITools.getDebugContextManager() from the UI thread.
Ugly, and should not be needed, but it avoids the failures seen when launching for the first time.
I have an EMF Datamodel and represent it with the framework "Graphiti".
In case of changes in the datamodel the method "updateNeeded()" in my UpdateFeature is randomly called or not. Therefor I have a listener. This listener calls the method "update()" in case of changes.
In the method update I can define the differences between datamodel and diagram. But if I want to add or change anything to the diagram an exception is thrown.
Has anyone an idea how I could autoupdate the diagram?
Here is my examplecode in the listener:
UpdateContext updateContext = new UpdateContext(getDiagram().getChildren().get(0).getGraphicsAlgorithm().getPictogramElement());
IUpdateFeature updateFeature = getFeatureProvider().getUpdateFeature(updateContext);
updateFeature.update(updateContext);
and the exception:
!ENTRY org.eclipse.ui 4 0 2013-07-11 13:36:43.886
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Cannot modify resource set without a write transaction)
Caused by: java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting
Regards, Juliane
In Graphiti you need to execute changes to diagram within an EMF transaction.
You can do that by executing your code as follows:
TransactionalEditingDomain domain = TransactionUtils.getEditingDomain(diagram);
domain.getCommandStack().execute(new RecordingCommand(domain) {
public void doExecute() {
UpdateContext updateContext = new UpdateContext(getDiagram().getChildren().get(0).getGraphicsAlgorithm().getPictogramElement());
IUpdateFeature updateFeature = getFeatureProvider().getUpdateFeature(updateContext);
updateFeature.update(updateContext);
}
});
Hope this helps
I'm learning Zend and trying to set a custom view but I'm having trouble.
class AccountController extends Zend_Controller_Action
{
public function init() {}
public function indexAction()
{
$this->view->setScriptPath(APPLICATION_PATH . '/views/scripts/mobile/');
$this->view->render('iphone.phtml');
}
}
The path is correct for the iphone.phtml view. I keep getting this error:
Fatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'error/error.phtml' not found in path (/Users/frankie/Websites/learn/zend/project1/application/views/scripts/mobile/)' in /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/View/Abstract.php:988 Stack trace: #0 /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/View/Abstract.php(884): Zend_View_Abstract->_script('error/error.pht...') #1 /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/Controller/Action/Helper/ViewRenderer.php(900): Zend_View_Abstract->render('error/error.pht...') #2 /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/Controller/Action/Helper/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('error/error.pht...', NULL) #3 /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/Controller/Action/Helper/ViewRenderer.php(960): Zend_Controller_Action_Helper_ViewRenderer->render() #4 /Users/frankie/Websites/Libraries/ZendFr in /Users/frankie/Websites/Libraries/ZendFramework-1.11.10/library/Zend/Controller/Plugin/Broker.php on line 336
I changed 'setScriptPath' to 'addScriptPath' and it no longer gives the error but totally ignores the $this->view->rendder
It's $this->render() And not $this->view->render()
In addition to yokoloko's answer, your error handling is not configured properly. It's catching your exceptions and trying to display a friendly error, but you don't have the friendly templates set up.
You should really create the views/scripts/error/error.pthml template, or turn on exceptions for your application again. (for the development environment).
resources.frontController.throwExceptions = true
(or similar)