我想为GATE编写我的第一个插件,但不知道如何开始: 从这个"教程" https://gate.ac.uk/sale/tao/splitch12.html#x16-32100012.3.2我复制&粘贴给定的源代码,创建一个.jar文件,并将其与.xml文件放在" plugins" -directory下的新目录中。 .xml文件如下所示:
<?xml version="1.0"?>
<CREOLE-DIRECTORY>
<CREOLE>
<JAR SCAN="true">cooccurrences.jar</JAR>
</CREOLE>
</CREOLE-DIRECTORY>
当我尝试在GATE中加载它时,我得到了这个:
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)
有没有我错过的东西?除了JAR和XML,我还需要什么?
答案 0 :(得分:0)
从错误消息中,您的班级gate.cooccurrences.Cooccurrences
似乎不是gate.Resource
的子类。这是强制性的,否则GATE无法处理你的东西......