Error when i launched the designer

Hello,
I m developing module for perspectives and vision modules but when i m uninstall vision module and launch the designer i have this error message.

ModuleLoadException: Error loading hook class "com.axone_io.ignition.calendar.designer.DesignerHook" for module "Calendar".
	caused by NoClassDefFoundError: com/inductiveautomation/vision/api/client/AbstractClientModuleHook
	caused by ClassNotFoundException: com.inductiveautomation.vision.api.client.AbstractClientModuleHook

Ignition v8.1.20 (b2022082313)
Java: Azul Systems, Inc. 11.0.15

I need my module to work without perspective or vision installed.

I dont know how to resolve this...

Thanks

Your DesignerHook class appears to extend Vision's AbstractClientModuleHook. Did you mean to extend AbstractDesignerModuleHook instead?

My class DesignerHook already extends of AbstractDesignerModuleHook

Then perhaps it has a reference to AbstractClientModuleHook somehow? You have all the information here and I have none of it, so help me out.

1 Like

Look in your designer's diagnostic console to see the full error, with line number in your code that triggers it. (If you can't launch far enough to get to that console, run the designer's java command from a terminal.)

1 Like

I understand my error when i launche the designer DesignerHook add Bundle of ClientHook using AbstractClientModuleHook but without Vision module the bundle added is null and this throw an error.

You need to use the context's API to get a reference to the Vision module (like you would do to add a component to its palette), and if null, don't do anything that would load classes from Vision, even indirectly.

OK thank you, it's the same way to check if perspective module existe ?

Yes. Get the module manager from the context, then use its API to request the other module object (which is that module's gateway hook object, fwiw).

Use reflection if needed to test-load classes without failing your whole module.