Bug 1193297 - [mvn] When transLang is missing from glossary-push compendium PO file, error message "transLang is required" should be shown instead of NullPointerException
Summary: [mvn] When transLang is missing from glossary-push compendium PO file, error ...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Maven
Version: client-3.4
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Patrick Huang
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
: 987211 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-17 06:07 UTC by Ding-Yi Chen
Modified: 2015-07-29 02:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-29 02:47:18 UTC
Embargoed:


Attachments (Terms of Use)

Description Ding-Yi Chen 2015-02-17 06:07:09 UTC
When pushing a compendium PO file and transLang is missing from glossary-push, error message "transLang is required" should be shown instead of NullPointerException


Version-Release number of selected component (if applicable):
zanata-maven-plugin:3.4.1:glossary-push
[INFO] client API version: 3.4.1, server API version: 3.6.0-SNAPSHOT
[WARNING] client API version is 3.4.1, but server API version is 3.6.0-SNAPSHOT

Server Zanata 3.6.0-SNAPSHOT (git-server-3.5.1-149-g7745558)


Steps to Reproduce: 
1.  Assume COMPENDIUM_PO_FILE be the compendium file you want to push,
    Run:
    mvn -e org.zanata:zanata-maven-plugin:glossary-push -Dzanata.glossaryFile=$COMPENDIUM_PO_FILE

Actual:
[ERROR] Failed to execute goal org.zanata:zanata-maven-plugin:3.4.1:glossary-push (default-cli) on project standalone-pom: Zanata mojo exception: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.zanata:zanata-maven-plugin:3.4.1:glossary-push (default-cli) on project standalone-pom: Zanata mojo exception
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
	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:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Zanata mojo exception
	at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:142)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 19 more
Caused by: java.lang.NullPointerException
	at org.zanata.common.LocaleId.<init>(LocaleId.java:34)
	at org.zanata.client.commands.glossary.push.GlossaryPushCommand.getLocaleFromMap(GlossaryPushCommand.java:95)
	at org.zanata.client.commands.glossary.push.GlossaryPushCommand.<init>(GlossaryPushCommand.java:77)
	at org.zanata.maven.GlossaryPushMojo.initCommand(GlossaryPushMojo.java:111)
	at org.zanata.maven.GlossaryPushMojo.initCommand(GlossaryPushMojo.java:41)
	at org.zanata.maven.ConfigurableMojo.runCommand(ConfigurableMojo.java:149)
	at org.zanata.maven.ConfigurableMojo.execute(ConfigurableMojo.java:140)
	... 21 more

Expected:
   Error message: transLang is required

Additional:
   CSV glossary file does not require transLang, so transLang should be mandatory only to PO files.

Comment 1 Ding-Yi Chen 2015-02-17 06:15:01 UTC
*** Bug 987211 has been marked as a duplicate of this bug. ***

Comment 2 Ding-Yi Chen 2015-02-17 08:23:43 UTC
Well, it seems like CSV glossary also require transLang as well.

Comment 3 Zanata Migrator 2015-07-29 02:47:18 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-192


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