I want to make a custom component as a plugin for a CloverETL Designer. I have the version CloverETL Designer 2.9.7.
I read a manual Integrating a Custom Component in CloverETL Designer, there is the sequence of steps File → New → Project → Plugin Project → …
But in my edition of Designer, there is no option Plugin Project. There are only four options: General (Project), CloverETL (C. Project, C. Example Project), Java (Java, Ant Project), Examples (Editing and validating XML…).
Hello Jana,
Plugin project is available in Eclipse for RCP/Plug-in Developers only. But you don’t need to create the Plugin project, as all you need to develop is the component and plugin.xml.
In addition to your component Java code, the plugin.xml file, you also need to create another xml file, which serves to integrate the component into CloverETL Designer.
You need to go to Window->Preferences, expand the CloverETL category and click the Components item.
After that, locate this customcomponents.xml file using the Browse button, click Import and OK.
After restarting CloverETL Designer, the component will be displayed in Palette of Components within specified category with specified icons, label, etc.
sorry to bother you again, but I am not able to find the problem, why my new component does not work. I have the component in the palette, but when I run the graph, it ends with an error.
The failure occurs:
ERROR [main] - Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent…
(The whole Exception Message is down.)
I changed the plugin.xml in the folder C:\Program Files\CloverETL Designer\plugins\com.cloveretl.gui_2.9.7\lib\plugins\org.jetel.component
What have I forgotten? There is something about the ComponentFactory, but I don’t know what to change and where.
Thanks
Jana
There is information from the Console, if it is needed (I wanted to add it as the txt file, but extension txt is not supported):
ERROR [main] - Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent
at org.jetel.plugin.PluginClassLoader.findClassInPrerequisities(PluginClassLoader.java:119)
at org.jetel.plugin.PluginClassLoader.findClass(PluginClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:104)
at org.jetel.component.ComponentFactory.createComponent(ComponentFactory.java:126)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiateNodes(TransformationGraphXMLReaderWriter.java:476)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:439)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:354)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:284)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:213)
at org.jetel.main.runGraph.main(runGraph.java:334)
Exception in thread “main” java.lang.RuntimeException: Unknown component: NEW_COMPONENT class: cz.muni.fi.xkadlec6.components.NewComponent
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:476)
at org.jetel.graph.TransformationGraphXMLReaderWriter.instantiatePhases(TransformationGraphXMLReaderWriter.java:439)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:354)
at org.jetel.graph.TransformationGraphXMLReaderWriter.read(TransformationGraphXMLReaderWriter.java:284)
at org.jetel.graph.TransformationGraphXMLReaderWriter.loadGraph(TransformationGraphXMLReaderWriter.java:213)
at org.jetel.main.runGraph.main(runGraph.java:334)
Caused by: java.lang.ClassNotFoundException: cz.muni.fi.xkadlec6.components.NewComponent
at org.jetel.plugin.PluginClassLoader.findClassInPrerequisities(PluginClassLoader.java:119)
at org.jetel.plugin.PluginClassLoader.findClass(PluginClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.jetel.component.ComponentFactory.getComponentClass(ComponentFactory.java:104)
… 7 more
Hello Jana,
check if your plugin is loaded and if you have correct path in your plugin.xml file. Similar problem was resolved in Custom component and 3.0.0 release topic.
I have done everything again according the docs, which is included in my edition of CloverETL Designer.
The first capture is about doing plugin into the Engine.
I copied the the org.company.components folder into the folder:
C:\Program Files\CloverETL Designer\plugins\com.cloveretl.gui_2.9.7\lib\plugins
Is it in the right folder?
There are files plugin.xml and the customcomponent.xml in this project
2) I have imported the customcomponent.xml, like it is written above, but the plugin.xml I was not able to import. I think it is necessary to give some connections between the component and plugin.xml, but I don’t know how. The plugin is exactly the same as in the manual.
I think, the my plugin.xml is not well loaded. Where can I find out, if my plugin.xml is loaded?
In the console (and in the log too) there is only information about loading the plugin org.company.components:
DEBUG [main] - Plugin org.company.components loaded.
id - org.company.components
version - 1.0.0
provider-name - null
component { className = org.company.components.NewComponent; type = NEW_COMPONENT; }
I see the component in the Palette, I can use it, but it does not have the icon, just only red square.
When I run the graph (only one UniversalDataReader, my component and UniversalDataWriter), it does not end, The UniversalDataWriter is still running, the other components not. I tried it with different writers, but the result was the same, it is cycling. But any error message doesn’t occur.
Where did I missunderstand? I think I need the punctual description please. And can you write me the meaning of the plugin.xml file too?
Jana
Hello Jana,
it seems, that your plug-in is loaded and the component works, but doesn’t inform the downstream component, that it has finished processing.
Usually the execute method looks like follows:
public Result execute() throws Exception {
DataRecord outRecord = new DataRecord(getOutputPort(OUTPUT_PORT).getMetadata());
outRecord.init();
DataRecord inRecord = new DataRecord(getOutputPort(INPUT_PORT).getMetadata());
inRecord.init();
while ((inRecord = readRecord(INPUT_PORT, inRecord)) != null && runIt) {
//process your input record into the output one
}
broadcastEOF();
return runIt ? Result.FINISHED_OK : Result.ABORTED;
}
Check if you for sure returns Result.FINISHED_OK, Result.ABORTED, Result.ERROR or throw an exception.