PDS - error when saving a Form

Posted by DenDuze on 17-Apr-2019 09:31

Hi,

When I create a new form (did not try yet with existing form) and I add a control (doesn't matter what control but now il tried with a Windows Label) and I save the form I get the following error
Serialize Error
An error occurred while serializing the design surface. The Visual Designer has unloaded this design to prevent code corruption.
A block statement that is not a catch block was encountered before end of method.

The file is not saved so i can not look at the generated code to see what is wrong

When I look to the VisualDesigner.log I see the following (only top rows copied)
2019-04-17 11:20:18,555 [ERROR]  - An internal error occurred
com.openedge.pdt.ve.editor.serialize.CodeSerializationException: A block statement that is not a catch block was encountered before end of method.
    at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.validateExistingStatements(ABLCodeDomConverter.java:983)
    at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.getInitiailzeComponentRegion(ABLCodeDomConverter.java:925)
    at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convertStatements(ABLCodeDomConverter.java:896)
    at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convertInitializeMethod(ABLCodeDomConverter.java:293)
    at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convert(ABLCodeDomConverter.java:210)
    at com.openedge.pdt.ve.editor.command.input.IPCSerializeCodeDomMessage.execute(IPCSerializeCodeDomMessage.java:199)
.....

Can someone tell me how I can fix this? (without installing again)

Regards
Didier

All Replies

Posted by Tushar Dhaka on 18-Apr-2019 05:58

Hi Didier,

Which version of PDSOE are you using? In what kind of project did you created the form?

Regards,

Tushar

Posted by DenDuze on 18-Apr-2019 06:15

Hi Tushar,

PDS 4.5.2

It's an OpenEdge Project

I need to say creating a Form with a few controls did work in the past.

I do not work a lot in PDS so it's a few months ago that I creted a new form in PDS.

I have no idea if in the meanwhile somthing is updated of newer version is installed (don't think so but ...)

But now suddenly I create a new form and I always have this problem when saving.

Meanwhile I created that form i a PDS 4.3 and copied the cls to my PDS 4.5.2 project and it works without a problem.

But again when I add a control to that form and I want to save the form I get that error again.

So there must be something wrong with that installed PDS (or some configuration in it)

Regards

Didier

Posted by Tushar Dhaka on 18-Apr-2019 06:37

The version 4.5.2 is the underline eclipse's version, so you must be using 11.7.x. Do you have more than one version of openedge installed on your machine?

Based on what you have shared it's hard to know what is the issue here. Please attach the complete stacktrace of the error.

Posted by DenDuze on 18-Apr-2019 07:51

OpenEdge 11.7.1 - PDS 4.5.2

Yes we have more then 1 version installed: 11.6.0 (PDS 4.3) and 11.7.1 (PDS 4.5.2)

Because I saw some errors in the .metadata/..log file when ¨PDS was started I tried the following:

I closed all open projects in PDS

closed and strarted PDS again

Now I do not have those errors in that .metadata/.log file

Opened 1 project with only a form in it and opened that form in designer

Added a control (label) and save

Again I got the error and below is the error in that .metadata/.log file

!ENTRY com.openedge.pdt.ve 4 20001 2019-04-18 09:46:03.962

!MESSAGE An internal error occurred

!STACK 0

com.openedge.pdt.ve.editor.serialize.CodeSerializationException: A block statement that is not a catch block was encountered before end of method.

at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.validateExistingStatements(ABLCodeDomConverter.java:983)

at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.getInitiailzeComponentRegion(ABLCodeDomConverter.java:925)

at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convertStatements(ABLCodeDomConverter.java:896)

at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convertInitializeMethod(ABLCodeDomConverter.java:293)

at com.openedge.pdt.ve.editor.serialize.ABLCodeDomConverter.convert(ABLCodeDomConverter.java:210)

at com.openedge.pdt.ve.editor.command.input.IPCSerializeCodeDomMessage.execute(IPCSerializeCodeDomMessage.java:199)

at com.openedge.pdt.ve.editor.command.output.FetchCodeDomMessage.mergeChanges(FetchCodeDomMessage.java:127)

at com.openedge.pdt.ve.editor.command.output.FetchCodeDomMessage.processResponse(FetchCodeDomMessage.java:101)

at com.openedge.pdt.ve.editor.command.output.FetchCodeDomMessage.execute(FetchCodeDomMessage.java:50)

at com.openedge.pdt.ve.editor.VisualDesignerClient.execute(VisualDesignerClient.java:357)

at com.openedge.pdt.ve.editor.VisualDesignerClient.execute(VisualDesignerClient.java:363)

at com.openedge.pdt.ve.editor.VisualDesigner.synchronizeDocument(VisualDesigner.java:653)

at com.openedge.pdt.ve.editor.VisualDesigner.saveToDocument(VisualDesigner.java:679)

at com.openedge.pdt.ve.editor.VisualDesigner.doSave(VisualDesigner.java:704)

at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:156)

at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:285)

at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:463)

at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:371)

at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2181)

at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2177)

at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:293)

at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:271)

at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:161)

at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3892)

at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3906)

at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)

at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)

at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)

at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)

at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)

at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)

at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)

at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)

at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)

at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)

at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343)

at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:160)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)

at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)

at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)

at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)

at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)

at org.eclipse.equinox.launcher.Main.run(Main.java:1515)

at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

Regards

Didier

Posted by Tushar Dhaka on 18-Apr-2019 09:07

Did you modified the code inside form before trying to add a control to it?

So the error basically suggests that inside the method of from there is a block of code which isn't CATCH(for example: IF-ELSE or FOR etc). Those things are not permitted inside the form's method and are definitely not added as part of addition of any controls. Which means there is an issue in the form even before you try to add any control, so even if you resize and save the form you'll get the same issue.

Posted by DenDuze on 18-Apr-2019 09:33

No, i did not modify the code.

Tested again: open the cls in design, selected 'view Source, Check Syntax = Syntax OK

Added an extra space-character in the source + save file = no-problem

Added another extra space-character in the source + back to the design view + save = no-problem

Made the form a bit larger + save = error

I do not get the error when I make the form larger (or put controls on it), I only get the error when I save the changed form in design view

Tried to do the following:

added a control to the form in design-view + View Source but then I also get the error.

So it looks like there must be something wrong with the code that is generated when you go from design-view to source-view.

But because PDS then unloads the design and can't save the source I can't check what is wrong.

Regards

Didier

Posted by Tushar Dhaka on 18-Apr-2019 10:03

Can you share the source code of form here?

Posted by DenDuze on 18-Apr-2019 11:12

Yes I can but what will that help?

I've tested again:

- In OpenEdge Project - New - ABL form

- make that new form larger and save (without doing something else = the error already occurs

But if you think it may help I will post that code here (it's just the code generated for a new form)

/*------------------------------------------------------------------------

   File        : TestForm

   Purpose     :

   Syntax      :

   Description :

   Author(s)   :

   Created     : Thu Apr 18 13:08:39 CEST 2019

   Notes       :

 ----------------------------------------------------------------------*/

using Progress.Lang.*.

using Progress.Windows.Form.

block-level on error undo, throw.

class TestForm inherits Form:

 define private variable components as System.ComponentModel.IContainer no-undo.

 constructor public TestForm (  ):

   SUPER().

   InitializeComponent().

   this-object:ComponentsCollection:add(this-object:components).

   catch e as Progress.Lang.Error:

     undo, throw e.

   end catch.

 end constructor.

 method private void InitializeComponent(  ):

   /* NOTE: The following method is automatically generated.

   We strongly suggest that the contents of this method only be modified using the

   Visual Designer to avoid any incompatible modifications.

   Modifying the contents of this method using a code editor will invalidate any support for this file. */

   this-object:SuspendLayout().

   this-object:Name = "TestForm".

   this-object:text = "TestForm".

   this-object:ResumeLayout(false).

   catch e as Progress.Lang.Error:

     undo, throw e.

   end catch.

 end method.

 destructor public TestForm ( ):

 end destructor.

end class.

Posted by Tushar Dhaka on 18-Apr-2019 12:55

Can't say what is causing this issue. I could only recreate it by adding an if block in the source and then editing in designer.

Will try to replicate your environment having 11.6.0 and 11.7.1 and get back to you. Maybe having different versions of infragistics and telerik controls is causing issues.

Meanwhile, I'll suggest to reinstall PDSOE 11.7.1 again with Ultra Controls and retry this scenario.

Posted by DenDuze on 18-Apr-2019 13:27

Hi,

I'm not the administrator of that machine and the installations on it so I can't do that.

For the moment i can create the form in 11.6 and then copy it to 11.7.1, as long as I do not need to change the UI I have no problem.

But of course I would like that I could find the reason for my problem because it's not the ideal way of working.

Thanks for looking @it

Posted by Tushar Dhaka on 22-Apr-2019 07:00

Hi Didier,

I agree that working like this is far from ideal, there should be no issues what so ever while working with forms however I wasn't able to recreate the issue at my end. So I'll suggest you to open up a case with tech support on this. As we are unable to recreate this behavior, narrowing down on the cause would require some investigation from support.

Regards,

Tushar

Posted by DenDuze on 23-Apr-2019 05:46

Hi Tushar,

Thanks for the effort!

Regards

Didier

This thread is closed