You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oozie.apache.org by "Robert Kanter (JIRA)" <ji...@apache.org> on 2015/03/21 02:11:38 UTC

[jira] [Updated] (OOZIE-2181) JsonToBean has some missing and incorrect mappings

     [ https://issues.apache.org/jira/browse/OOZIE-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Kanter updated OOZIE-2181:
---------------------------------
    Description: 
{{JsonToBean}} has code to map from Bundle Job, Coordinator Job, etc JSON into the associated {{BundleJob}}, {{CoordinatorJob}}, etc classes.  

If a mapping is missing, and you try to call a getter, the code will compile but you'll get a {{RuntimeException}}.  For example; the mapping for {{BundleJob.getAcl()}} is missing.  Specifically, when you use this code:
{code:java}
BundleJob job = client.getBundleJobInfo(jobId);
String acl = job.getAcl();
{code}
you get this exception:
{noformat}
Exception in thread "main" java.lang.RuntimeException: Undefined method mapping: getAcl
	at org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.invoke(JsonToBean.java:217)
	at com.sun.proxy.$Proxy4.getAcl(Unknown Source)
        ...
{noformat}

There are a number of other inconsistencies, including some extra mappings, incorrectly named mappings, and incorrectly typed mappings.  

We should:
# Fix these inconsistencies.
# Write tests to prevent this sort of thing from happening in the future.

  was:
{{JsonToBean}} has code to map from Bundle Job, Coordinator Job, etc JSON into the associated {{BundleJob}}, {{CoordinatorJob}}, etc classes.  

If a mapping is missing, and you try to call a getter, the code will compile but you'll get a {{RuntimeException}}.  For example; the mapping for {{BundleJob.getAcl()}} is missing.  Specifically, when you use this code:
{code:java}
BundleJob job = client.getBundleJobInfo(jobId);
String acl = job.getAcl();
{code}
you get this exception:
{noformat}
Exception in thread "main" java.lang.RuntimeException: Undefined method mapping: getAcl
	at org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.invoke(JsonToBean.java:217)
	at com.sun.proxy.$Proxy4.getAcl(Unknown Source)
        ...
{noformat}

There are a number of other inconsistencies, including some extra mappings, incorrectly named mappings, and incorrectly typed mappings.  We should:
# Fix these inconsistencies.
# Write tests to prevent this sort of thing from happening in the future.


> JsonToBean has some missing and incorrect mappings
> --------------------------------------------------
>
>                 Key: OOZIE-2181
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2181
>             Project: Oozie
>          Issue Type: Bug
>          Components: client
>            Reporter: Robert Kanter
>            Assignee: Robert Kanter
>
> {{JsonToBean}} has code to map from Bundle Job, Coordinator Job, etc JSON into the associated {{BundleJob}}, {{CoordinatorJob}}, etc classes.  
> If a mapping is missing, and you try to call a getter, the code will compile but you'll get a {{RuntimeException}}.  For example; the mapping for {{BundleJob.getAcl()}} is missing.  Specifically, when you use this code:
> {code:java}
> BundleJob job = client.getBundleJobInfo(jobId);
> String acl = job.getAcl();
> {code}
> you get this exception:
> {noformat}
> Exception in thread "main" java.lang.RuntimeException: Undefined method mapping: getAcl
> 	at org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.invoke(JsonToBean.java:217)
> 	at com.sun.proxy.$Proxy4.getAcl(Unknown Source)
>         ...
> {noformat}
> There are a number of other inconsistencies, including some extra mappings, incorrectly named mappings, and incorrectly typed mappings.  
> We should:
> # Fix these inconsistencies.
> # Write tests to prevent this sort of thing from happening in the future.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)