Description of problem: zanata-cli push produce following error messages: Exception in thread "main" java.lang.NoClassDefFoundError: antlr/TokenStreamException at org.zanata.adapter.po.PoReader2.createParser(PoReader2.java:278) at org.zanata.adapter.po.PoReader2.extractTemplate(PoReader2.java:200) at org.zanata.client.commands.push.AbstractGettextPushStrategy.loadSrcDoc(AbstractGettextPushStrategy.java:82) at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:416) at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:207) at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:56) at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:164) at org.zanata.client.ZanataClient.main(ZanataClient.java:90) Caused by: java.lang.ClassNotFoundException: antlr.TokenStreamException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 8 more Version-Release number of selected component (if applicable): zanata-client-3.1.1-1.fc20.noarch How reproducible: Always Steps to Reproduce: 1. zanata-cli -e -B -s . -t. Actual results: Exception in thread "main" java.lang.NoClassDefFoundError: antlr/TokenStreamException at org.zanata.adapter.po.PoReader2.createParser(PoReader2.java:278) at org.zanata.adapter.po.PoReader2.extractTemplate(PoReader2.java:200) at org.zanata.client.commands.push.AbstractGettextPushStrategy.loadSrcDoc(AbstractGettextPushStrategy.java:82) at org.zanata.client.commands.push.PushCommand.pushCurrentModule(PushCommand.java:416) at org.zanata.client.commands.push.PushCommand.run(PushCommand.java:207) at org.zanata.client.commands.ArgsUtil.runCommand(ArgsUtil.java:56) at org.zanata.client.ZanataClient.processArgs(ZanataClient.java:164) at org.zanata.client.ZanataClient.main(ZanataClient.java:90) Caused by: java.lang.ClassNotFoundException: antlr.TokenStreamException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 8 more Expected results: Push successfully. Additional info:
This is apparently happening because the classpath we create for the zanata-cli script in zanata-client.spec (using maven's dependency:build-classpath at build time) is no longer valid at runtime. In zanata-client.spec, I think we should instead try using dependency:copy-dependencies to copy the jars to one place, and then xmvn-subst to replace them with symlinks to their runtime locations. Then we could either include the symlinks in the rpm, or get a list of their link targets and use them directly in the zanata-cli script.
I think I found an easy workaround. We just need to change the script to use antlr.jar instead of antlr-2.7.7.jar. Same goes with the xom.jar. They used to place the jar with version in the name. But not anymore therefore breaks the classpath.
zanata-client-3.3.2-3.fc20 is in update-testing repo
pushed to stable both in f19 and f20