GATE plugin creation

694 Views Asked by At

I want to write my first plugin for GATE, but don't know how to start: From this "tutorial" https://gate.ac.uk/sale/tao/splitch12.html#x16-32100012.3.2 I copy & pasted the given source code, created a .jar-file and put it together with a .xml file in a new directory under the "plugins"-directory. The .xml-file looks like this:

<?xml version="1.0"?>
<CREOLE-DIRECTORY>  
  <CREOLE>
    <JAR SCAN="true">cooccurrences.jar</JAR>  
  </CREOLE>
</CREOLE-DIRECTORY>

When I try to load it in GATE, I get this:

gate.util.GateException: couldn't open creole.xml
    at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:298)
    at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:314)
    at gate.gui.creole.manager.AvailablePlugins.updateAvailablePlugins(AvailablePlugins.java:615)
    at gate.gui.creole.manager.PluginUpdateManager$3.run(PluginUpdateManager.java:461)
Caused by: java.lang.ClassCastException: class gate.cooccurrences.Cooccurrences
    at java.lang.Class.asSubclass(Class.java:3293)
    at gate.creole.ResourceData.getResourceClass(ResourceData.java:233)
    at gate.creole.CreoleRegisterImpl.put(CreoleRegisterImpl.java:423)
    at gate.creole.CreoleRegisterImpl.put(CreoleRegisterImpl.java:78)
    at gate.creole.CreoleXmlHandler.endElement(CreoleXmlHandler.java:320)
    at org.jdom.output.SAXOutputter.endElement(SAXOutputter.java:1077)
    at org.jdom.output.SAXOutputter.element(SAXOutputter.java:905)
    at org.jdom.output.SAXOutputter.elementContent(SAXOutputter.java:1126)
    at org.jdom.output.SAXOutputter.elementContent(SAXOutputter.java:1098)
    at org.jdom.output.SAXOutputter.element(SAXOutputter.java:897)
    at org.jdom.output.SAXOutputter.output(SAXOutputter.java:621)
    at gate.creole.CreoleRegisterImpl.processFullCreoleXmlTree(CreoleRegisterImpl.java:375)
    at gate.creole.CreoleRegisterImpl.parseDirectory(CreoleRegisterImpl.java:345)
    at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:292)

Is there something I've missed? What else do I need besides the JAR and XML ?

1

There are 1 best solutions below

0
On

From the error message, it seems that your class gate.cooccurrences.Cooccurrences is not a subclass of gate.Resource. This is mandatory, otherwise GATE could not handle your stuff...