ClassNotFound exception when developing custom components

Discussion on developing CloverETL engine, transformation components etc.

mrmac
Posts: 1
Joined: Sat Mar 23, 2013 8:54 pm

ClassNotFound exception when developing custom components

Postby mrmac » Sat Mar 23, 2013 9:05 pm

I followed http://doc.cloveretl.com/documentation/ ... ngine.html to create a custom component using the latest versions of RCP and RAP Eclipse and CloverETL after I build the component and place it CloverETL plugin directory I am able to import and see it the palette. I tried to create and run a basic graph but I receive the following exception:

Exception in thread "main" ERROR [main] - Unknown component: NEW_COMPONENT class: NEW_COMPONENT
java.lang.ClassNotFoundException: NEW_COMPONENT
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:97)
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:126)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:498)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:461)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:376)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:296)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:225)
at org.jetel.main.runGraph.main(runGraph.java:325)
java.lang.RuntimeException: Unknown component: NEW_COMPONENT class: NEW_COMPONENT
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:108)
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:126)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:498)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:461)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:376)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:296)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:225)
at org.jetel.main.runGraph.main(runGraph.java:325)
Caused by: java.lang.ClassNotFoundException: NEW_COMPONENT
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:97)
... 7 more

They are a few differences that I saw when following the guide. In the MANIFEST on the extensions tab when adding the engine plugin, classLoaderProvider is a required field the documentation doesnt have that. Any help will be greatly appreciated.

tkramolis
Posts: 8
Joined: Tue Nov 15, 2011 2:53 pm

Re: ClassNotFound exception when developing custom component

Postby tkramolis » Mon Mar 25, 2013 3:13 pm

Hi mrmac,

Yes, the "classLoaderProvider" is now required, we have to update the guide. Creating this classloader provider is very simple: in your Designer plugin, just create new class which extends com.cloveretl.gui.plugin.engine.AbstractClassLoaderProvider class (leave body of the class empty) and enter fully qualified name of this class in the "classLoaderProvider" field.

If you've left the "classLoaderProvider" field empty, your engine plugin failed to be loaded resulting in the error you mentioned.

To diagnose Designer plugins loading issues, run the CloverETL Designer with standard and error outputs redirected to files -- go into Designer installation directory and execute the following command:

Code: Select all

CloverETLDesigner.exe -clean > std.log 2> err.log

(the -clean option is mentioned in the guide's "Integrating a Custom Component in CloverETL Designer" section). In these files you can view Designer startup logging messages. After the Designer is started, splash screen appears, all the Designer plugins are being loaded and once the splash screen disappears, you can examine the err.log file which should be empty if everything went well, or should contain (hopefully useful) error message. The std.log contains info about successfully loaded plugins -- one of the "Component extension plugin found:" lines should be followed by a line with ID of your Designer plugin. There should be also "Engine plugin extension plugin found:" line followed by your engine plugin ID, plugins directory and classloader class name.

Hope this helps.

Best regards,
_________________
Tomas Kramolis
Javlin, a.s.


cron