我想嵌入到我的Java項目的門。我已閱讀關於如何構建GATE獨立應用程序的GATE指南。但是,我收到很多錯誤,說每個插件(ANNIE,Twitter等)的creole.xml都無法加載。這裏是我的代碼:無法加載Creole.xml GATE
public class NERGate {
public NERGate(){}
public static void main(String args[]) throws GateException, MalformedURLException{
Gate.setGateHome(new File("/Applications/GATE_Developer_8.1"));
Gate.setPluginsHome(new File("/Applications/GATE_Developer_8.1/plugins"));
Gate.init();
}
}
而下面是我的控制檯上的輸出:
Using /Applications/GATE_Developer_8.1 as GATE home
Using /Applications/GATE_Developer_8.1/plugins as installed plug-ins directory.
Using /Applications/GATE_Developer_8.1/gate.xml as site configuration file.
Using /Users/adibangun/.gate.xml as user configuration file
Using /Users/adibangun/.gate.session as user session file
edu.stanford.nlp.util.Function is available via both the system classpath and a plugin; the plugin classes will be ignored
edu.stanford.nlp.ling.CoreLabel is available via both the system classpath and a plugin; the plugin classes will be ignored
edu.stanford.nlp.trees.Tree is available via both the system classpath and a plugin; the plugin classes will be ignored
edu.stanford.nlp.trees.GrammaticalStructureFactory is available via both the system classpath and a plugin; the plugin classes will be ignored
edu.stanford.nlp.tagger.maxent.MaxentTagger is available via both the system classpath and a plugin; the plugin classes will be ignored
edu.stanford.nlp.process.LexedTokenFactory is available via both the system classpath and a plugin; the plugin classes will be ignored
CREOLE plugin loaded: file:/Applications/GATE_Developer_8.1/plugins/Stanford_CoreNLP/
Cannot load file:/Applications/GATE_Developer_8.1/plugins/Twitter/ CREOLE repository.
gate.util.GateException: couldn't open creole.xml
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:299)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:317)
at gate.Gate.initCreoleRepositories(Gate.java:449)
at gate.Gate.init(Gate.java:220)
at thmeaticAnalysis.controller.NERGate.main(NERGate.java:29)
at thematicanalysis.GUI.Home.GateNERButtonActionPerformed(Home.java:169)
at thematicanalysis.GUI.Home.access$200(Home.java:24)
at thematicanalysis.GUI.Home$3.actionPerformed(Home.java:75)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NoClassDefFoundError: Lpt/tumba/spell/SpellChecker;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at gate.creole.CreoleAnnotationHandler.processParameters(CreoleAnnotationHandler.java:502)
at gate.creole.CreoleAnnotationHandler.processCreoleResourceAnnotations(CreoleAnnotationHandler.java:343)
at gate.creole.CreoleAnnotationHandler.processAnnotationsForResource(CreoleAnnotationHandler.java:313)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:283)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:286)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:269)
at gate.creole.CreoleRegisterImpl.processFullCreoleXmlTree(CreoleRegisterImpl.java:365)
at gate.creole.CreoleRegisterImpl.parseDirectory(CreoleRegisterImpl.java:348)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:293)
... 43 more
Caused by: java.lang.ClassNotFoundException: pt.tumba.spell.SpellChecker
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
Cannot load file:/Applications/GATE_Developer_8.1/plugins/ANNIE/ CREOLE repository.
gate.util.GateException: couldn't open creole.xml
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:299)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:317)
at gate.Gate.initCreoleRepositories(Gate.java:449)
at gate.Gate.init(Gate.java:220)
at thmeaticAnalysis.controller.NERGate.main(NERGate.java:29)
at thematicanalysis.GUI.Home.GateNERButtonActionPerformed(Home.java:169)
at thematicanalysis.GUI.Home.access$200(Home.java:24)
at thematicanalysis.GUI.Home$3.actionPerformed(Home.java:75)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NoClassDefFoundError: Lpt/tumba/spell/SpellChecker;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at gate.creole.CreoleAnnotationHandler.processParameters(CreoleAnnotationHandler.java:502)
at gate.creole.CreoleAnnotationHandler.processCreoleResourceAnnotations(CreoleAnnotationHandler.java:343)
at gate.creole.CreoleAnnotationHandler.processAnnotationsForResource(CreoleAnnotationHandler.java:313)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:283)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:286)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:269)
at gate.creole.CreoleRegisterImpl.processFullCreoleXmlTree(CreoleRegisterImpl.java:365)
at gate.creole.CreoleRegisterImpl.parseDirectory(CreoleRegisterImpl.java:348)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:293)
... 43 more
Caused by: java.lang.ClassNotFoundException: pt.tumba.spell.SpellChecker
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
Cannot load file:/Applications/GATE_Developer_8.1/plugins/Tools/ CREOLE repository.
gate.util.GateException: couldn't open creole.xml
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:299)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:317)
at gate.Gate.initCreoleRepositories(Gate.java:449)
at gate.Gate.init(Gate.java:220)
at thmeaticAnalysis.controller.NERGate.main(NERGate.java:29)
at thematicanalysis.GUI.Home.GateNERButtonActionPerformed(Home.java:169)
at thematicanalysis.GUI.Home.access$200(Home.java:24)
at thematicanalysis.GUI.Home$3.actionPerformed(Home.java:75)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NoClassDefFoundError: Lpt/tumba/spell/SpellChecker;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at gate.creole.CreoleAnnotationHandler.processParameters(CreoleAnnotationHandler.java:502)
at gate.creole.CreoleAnnotationHandler.processCreoleResourceAnnotations(CreoleAnnotationHandler.java:343)
at gate.creole.CreoleAnnotationHandler.processAnnotationsForResource(CreoleAnnotationHandler.java:313)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:283)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:286)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:269)
at gate.creole.CreoleRegisterImpl.processFullCreoleXmlTree(CreoleRegisterImpl.java:365)
at gate.creole.CreoleRegisterImpl.parseDirectory(CreoleRegisterImpl.java:348)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:293)
... 43 more
Caused by: java.lang.ClassNotFoundException: pt.tumba.spell.SpellChecker
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
Cannot load file:/Applications/GATE_Developer_8.1/plugins/Stanford_CoreNLP/ CREOLE repository.
gate.util.GateException: couldn't open creole.xml
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:299)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:317)
at gate.Gate.initCreoleRepositories(Gate.java:449)
at gate.Gate.init(Gate.java:220)
at thmeaticAnalysis.controller.NERGate.main(NERGate.java:29)
at thematicanalysis.GUI.Home.GateNERButtonActionPerformed(Home.java:169)
at thematicanalysis.GUI.Home.access$200(Home.java:24)
at thematicanalysis.GUI.Home$3.actionPerformed(Home.java:75)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NoClassDefFoundError: Lpt/tumba/spell/SpellChecker;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at gate.creole.CreoleAnnotationHandler.processParameters(CreoleAnnotationHandler.java:502)
at gate.creole.CreoleAnnotationHandler.processCreoleResourceAnnotations(CreoleAnnotationHandler.java:343)
at gate.creole.CreoleAnnotationHandler.processAnnotationsForResource(CreoleAnnotationHandler.java:313)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:283)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:286)
at gate.creole.CreoleAnnotationHandler.processAnnotations(CreoleAnnotationHandler.java:269)
at gate.creole.CreoleRegisterImpl.processFullCreoleXmlTree(CreoleRegisterImpl.java:365)
at gate.creole.CreoleRegisterImpl.parseDirectory(CreoleRegisterImpl.java:348)
at gate.creole.CreoleRegisterImpl.registerDirectories(CreoleRegisterImpl.java:293)
... 43 more
Caused by: java.lang.ClassNotFoundException: pt.tumba.spell.SpellChecker
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
我不知道是否有什麼錯誤的奇怪我的項目配置,因爲我試圖創建一個統一進口新項目GATE,並且在使用Gate.init()初始化Gate時沒有顯示任何錯誤。此外,所有插件都存在於我的/Applications/GATE_Developer_8.1/plugins上,並帶有自己的creole.xml。 有誰知道有什麼問題?任何意見和建議將非常感激。非常感謝:)
非常感謝。它現在有效。我沒有單獨添加twitter.jar。現在,我刪除了twitter.jar後,它可以加載每個插件的所有克里奧爾語。但是,我有一些新的錯誤,但這次是不同的錯誤。許多謝謝@伊恩羅伯茨 – bohr