You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "László Bodor (Jira)" <ji...@apache.org> on 2022/01/02 20:10:00 UTC

[jira] [Comment Edited] (YARN-9554) TimelineEntity DAO has java.util.Set interface which JAXB can't handle

    [ https://issues.apache.org/jira/browse/YARN-9554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17458788#comment-17458788 ] 

László Bodor edited comment on YARN-9554 at 1/2/22, 8:09 PM:
-------------------------------------------------------------

while I'm trying to upgrade tez to hadoop 3.3.1, a [unit test|https://github.com/apache/tez/blob/master/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java] [throws an exception|https://github.com/apache/hadoop/commit/fab5b80a36bad90e03f7e5e37ded47d67d6e2e81#diff-a462dd3da66c64d06c4e139cad3c6c6a9e5440bbfb276b660959f6fe2efb64b0R97] which is introduced by patch:
{code}
SEVERE: Failed to generate the schema for the JAX-B elements
javax.xml.bind.JAXBException: TimelineEntity and TimelineEntities has IllegalAnnotation
	at org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.ContextFactory.createContext(ContextFactory.java)
{code}
I'm a bit confused, what's the expected way of making the unit test work again? the exception is thrown when test tries to fetch a timeline entity from AHS (1.0):
{code}
  private <K> K getTimelineData(String url, Class<K> clazz) {
    Client client = new Client();
    WebResource resource = client.resource(url);

    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
    assertEquals(200, response.getStatus());
    assertTrue(MediaType.APPLICATION_JSON_TYPE.isCompatible(response.getType()));

    K entity = response.getEntity(clazz); <--- fails at this point, clazz is TimelineEntity.class
    assertNotNull(entity);
    return entity;
  }
{code}

I don't get how am I supposed to fix this
if I simply copy TimelineEntity class to tez and use the unit test with it (so the actual class won't be present in IGNORE_TYPES), the test passes


was (Author: abstractdog):
while I'm trying to upgrade tez to hadoop 3.3.1, a [unit test|https://github.com/apache/tez/blob/master/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java] throws an exception which is introduced by patch:
{code}
SEVERE: Failed to generate the schema for the JAX-B elements
javax.xml.bind.JAXBException: TimelineEntity and TimelineEntities has IllegalAnnotation
	at org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.ContextFactory.createContext(ContextFactory.java)
{code}
I'm a bit confused, what's the expected way of making the unit test work again? the exception is thrown when test tries to fetch a timeline entity from AHS (1.0):
{code}
  private <K> K getTimelineData(String url, Class<K> clazz) {
    Client client = new Client();
    WebResource resource = client.resource(url);

    ClientResponse response = resource.accept(MediaType.APPLICATION_JSON)
        .get(ClientResponse.class);
    assertEquals(200, response.getStatus());
    assertTrue(MediaType.APPLICATION_JSON_TYPE.isCompatible(response.getType()));

    K entity = response.getEntity(clazz); <--- fails at this point, clazz is TimelineEntity.class
    assertNotNull(entity);
    return entity;
  }

{code}

> TimelineEntity DAO has java.util.Set interface which JAXB can't handle
> ----------------------------------------------------------------------
>
>                 Key: YARN-9554
>                 URL: https://issues.apache.org/jira/browse/YARN-9554
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: timelineservice
>    Affects Versions: 3.3.0
>            Reporter: Prabhu Joseph
>            Assignee: Prabhu Joseph
>            Priority: Major
>             Fix For: 3.3.0
>
>         Attachments: YARN-9554-001.patch, YARN-9554-002.patch
>
>
> TimelineEntity DAO has java.util.Set interface which JAXB can't handle. This breaks the fix of YARN-7266.
> {code}
> Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
> java.util.Set is an interface, and JAXB can't handle interfaces.
> 	this problem is related to the following location:
> 		at java.util.Set
> 		at public java.util.HashMap org.apache.hadoop.yarn.api.records.timeline.TimelineEntity.getPrimaryFiltersJAXB()
> 		at org.apache.hadoop.yarn.api.records.timeline.TimelineEntity
> 		at public java.util.List org.apache.hadoop.yarn.api.records.timeline.TimelineEntities.getEntities()
> 		at org.apache.hadoop.yarn.api.records.timeline.TimelineEntities
> 	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:445)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:124)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
> 	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org