Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError when 8.6 plugins try calling Utils.logOnce #123

Closed
greenwoodma opened this issue Jun 2, 2020 · 1 comment
Closed

NoSuchMethodError when 8.6 plugins try calling Utils.logOnce #123

greenwoodma opened this issue Jun 2, 2020 · 1 comment

Comments

@greenwoodma
Copy link
Contributor

It looks as if I've managed to break backwards compatibility around the Utils.logOnce() method working on updating the logging in GATE. This is the error you get if you run the ANNIE POS tagger over an empty doc with failOnMissingAnnotations set to false and hit an empty document

Exception in thread "ApplicationViewer1" java.lang.NoSuchMethodError: gate.Utils.logOnce(Lorg/apache/log4j/Logger;Lorg/apache/log4j/Level;Ljava/lang/String;)V
	at gate.creole.POSTagger.execute(POSTagger.java:265)
	at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:293)
	at gate.creole.ConditionalSerialController.runComponent(ConditionalSerialController.java:172)
	at gate.creole.SerialController.executeImpl(SerialController.java:158)
	at gate.creole.ConditionalSerialAnalyserController.executeImpl(ConditionalSerialAnalyserController.java:225)
	at gate.creole.ConditionalSerialAnalyserController.execute(ConditionalSerialAnalyserController.java:132)
	at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:293)
	at gate.gui.SerialControllerEditor$RunAction$1.run(SerialControllerEditor.java:1777)
	at java.lang.Thread.run(Thread.java:748)

Ideally apps built with 8.6.x should still work in 9.0-SNAPSHOT (especially those using the ANNIE plugin) unless we specifically blacklist the plugin to force users to update (see #89)

@greenwoodma
Copy link
Contributor Author

The fix for this was to go back to explicitly using Log4J in the gate.Utils.logOnce() method call (which is deprecated) so that plugins built against older versions of GATE can find the method and don't simply throw a NoSuchMethodError. I don't like this as it again means Log4J is a runtime dependency (technically it's the SLF4J bridge but still). but I can't see a way around this until we've fixed all our plugins which use Log4J, and even then we'd break any external plugins which used Log4J as well and we shouldn't blacklist a plugin simply because it uses the logging mechanism we previously recommended, or not yet anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants