Bug 826386 - [mvn] Glossary-push compendium PO file: failed to run if zanata.xml absent
Summary: [mvn] Glossary-push compendium PO file: failed to run if zanata.xml absent
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Maven
Version: 1.6-SNAPSHOT
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 1.6.1
Assignee: Alex Eng
QA Contact: Ding-Yi Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-30 06:06 UTC by Ding-Yi Chen
Modified: 2012-07-03 05:27 UTC (History)
3 users (show)

Fixed In Version: 1.6.1-SNAPSHOT
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-03 05:27:46 UTC
Embargoed:


Attachments (Terms of Use)

Description Ding-Yi Chen 2012-05-30 06:06:16 UTC
Version-Release number of selected component (if applicable):
1.6.0-beta-2-SNAPSHOT (20120530-0019)

Steps to Reproduce: 
1. run without zanata.xml

Actual results: 
[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:1.6-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception: NullPointerException

Expected results:
glossary-push need not require zanata.xml,
or at least give more informative error such as
"Cannot find zanata.xml"

Comment 1 Alex Eng 2012-06-05 01:31:40 UTC
Fixed in zanata maven client version 1.6.1-SNAPSHOT.

See https://github.com/zanata/zanata-client/commit/dacfdb3a70aef7d134c5a39ccb5914f93c6085e7

Comment 2 Ding-Yi Chen 2012-06-12 03:39:19 UTC
As tested with  org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT

It does shows 

[WARNING] Project config file '/home/dchen/devel/zanata-tests/zanata.xml' not found; ignoring

Yet the command still failed as NullPointerException


[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.zanata:zanata-maven-plugin:1.6.1-SNAPSHOT:glossary-push (default-cli) on project null: Zanata mojo exception
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Zanata mojo exception
        at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:134)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: java.lang.NullPointerException
        at org.zanata.client.commands.glossary.push.AbstractGlossaryPushReader.getLocaleFromMap(AbstractGlossaryPushReader.java:45)
        at org.zanata.client.commands.glossary.push.GlossaryCSVReader.setupLocalesMap(GlossaryCSVReader.java:124)
        at org.zanata.client.commands.glossary.push.GlossaryCSVReader.extractGlossary(GlossaryCSVReader.java:56)
        at org.zanata.client.commands.glossary.push.GlossaryPushCommand.run(GlossaryPushCommand.java:140)
        at org.zanata.maven.ConfigurableMojo.runCommand(ConfigurableMojo.java:145)
        at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:130)
        ... 21 more

Comment 4 Alex Eng 2012-06-18 22:57:11 UTC
Applied fix in zanata maven client version 1.6.1-SNAPSHOT

See https://github.com/zanata/zanata-client/commit/d5ba307730b7b74cbc5fd2021491936e8e334c13

Comment 5 Ding-Yi Chen 2012-06-28 07:04:46 UTC
VERIFIED with: 
client API version: 1.6.0-alpha-2, server API version: 1.6.0
1. Server Zanata version 1.6.1-SNAPSHOT (20120628-0014)
2. Server Zanata version 1.7-SNAPSHOT (20120626-0025)


Note You need to log in before you can comment on or make changes to this bug.