Visual Designer cannot load this class:no property named <

Posted by rbf on 09-Feb-2012 06:21

Another version of 'Visual Designer cannot load this class..." that has been bugging us for a long long time.

Very often during development, when switching to the VD, the following error occurs:

Visual Designer cannot load this class.

An exception occurred loading the design canvas: The type ' <typename> ' has no property named '<propertyname>'.

The error is complete nonsense as <typename> has had this property for ages and nothing has changed in that class.

Needless to say the class compiles and runs fine.

We try the following steps in order to solve the issue:

1. Compile the visual class again. This sometimes helps.

2. If that does not help, restart the AVM. This often helps.

3. If that does not help, restart OEA.

4. If that does not help, perform a Project Clean on all involved projects.

5. If that does not help, restart the PC.

6. If that does not help, try again the next day. Then it usually works

I have read the other thread on a similar case but that does not explain why these workarounds fix the problem.

I would really like to know the real cause of this problem so we don't have to keep guessing and retrying anymore.

-peter

All Replies

Posted by Anil Kumar on 09-Feb-2012 06:54

Hi Peter,

Does the development uses cross reference mechanism of ABL Forms (Like ABL form residing in one project and the UserControl which is dropped onto form belongs to another project). When you modify base or super class and try loading the visual designer which result in the specified problems. If so performing project clean would solve the problems.

Also make sure to change the 'Class Cache' options (Workspace or POPATH) from the Preferences dialog.

Were the references are made acros several projects in your case ?

Thanks and Regards,

Anil Kumar.

Posted by rbf on 09-Feb-2012 07:00

Hi Anil,

Yes my forms have user controls defined in another project with complex class hierarchies in that other project.

However, that does not explain the message, even if *something* has changed *somewhere* in the other project, does it?

What should I changes in the class cache options and why to solve this issue? It is currently set to Workspace (default).

Thanks,

-peter

Posted by bab on 09-Feb-2012 23:56

The visual designer dependence on the code model (contains meta information about classes and procedures) to load the form. Code model reads the classes and procedures from PROPATH of each project while opening the OpenEdge architect.

If user control is not part any workspace project and part of any PROPATH entry then class cache option should be set to PROPATH. Then only Code model will know about your user control. If user control is part of any workspace project then class cache option should be workspace is fine.

If ABL form and ABL user control are in different project then ABL user control project path should be part of PROPATH of ABL form project. Then only ABL form will know about user control.

Posted by rbf on 10-Feb-2012 06:10

Balachandar can you explain to me what a 'workspace project' is?

Posted by bab on 10-Feb-2012 07:46

project that is opened in project explorer.

Posted by rbf on 10-Feb-2012 07:56

OK in that case the Workspace setting is fine since both projects are workspace projects.

Setting this option to PROPATH would slow things down enormously since the PROPATH contains many more resources that are not relevant.

Anyway, this sounds like a performance option only. How could it address my original problem?

Posted by nacharya on 10-Feb-2012 08:02

Hi Peter,

Here 'workspace project' means projects of a workspace where you are currently working. There can be projects outside the current workspace but which can be referred through project PROPATH.

If form and UserControl exists in two different projects, then open project properties where the form exists.

> Switch to PROPATH page

> 'Add Workspace Directory'/'Add External directory'

> Specify the directory where user control exists.

> Click OK to project properties

And then close all and clean the work space. This should solve your problem.

Thanks and regards

Nrusingha

Posted by rbf on 10-Feb-2012 08:06

That is a slightly different story but anyway it is not relevant to my issue.

Both of my projects are in the same workspace, they are both opened AND project B (where the Form lives) references project A (where the user control lives) through the PROPATH.

Anyway, none of this explains why I can resolve my issue with the steps describes above. That proves the configuration is definitely OK isn't it?

Posted by bab on 13-Feb-2012 00:53

While loading visual designer editor will construct in memory model for form with the help of code model. There may be possibility code model may contains out of data about user control. Because of that this error may happens.  In order to resolve the issue invoke Project -> clean option, it will rebuild the code model.  Only step 4 mentioned in the post is required. However, you are using shared AVM then restart the shared AVM followed by clean. 

This thread is closed