apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Munagala Ramanath <...@datatorrent.com>
Subject XmlParser operator in Malhar 3.2 and 3.3
Date Mon, 09 May 2016 02:02:03 GMT
Hi,

I wrote a small app to exercise the XmlParser operator. The app works fine
with Malhar 3.2
but fails with 3.3 with an exception like this:

java.lang.IllegalArgumentException
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
at com.datatorrent.lib.parser.XmlParser.setup(XmlParser.java:135)
at com.datatorrent.lib.parser.XmlParser.setup(XmlParser.java:63)
at com.datatorrent.stram.engine.Node.setup(Node.java:161)
at
com.datatorrent.stram.engine.StreamingContainer.setupNode(StreamingContainer.java:1287)
at
com.datatorrent.stram.engine.StreamingContainer.access$100(StreamingContainer.java:92)
at
com.datatorrent.stram.engine.StreamingContainer$2.run(StreamingContainer.java:1361)

The operator has moved to the library module in 3.3 from contrib and there
are other changes as
well, so I made the minor changes needed to accomodate the move but to no
avail. I tried
both 3.2.0 and 3.3.0 of apex-core, tried adding JAXB annotations to the
Employee class
but nothing seems to make any difference -- I get the same exception.

My app for 3.3 (slightly different for 3.2) looks like this:
-------------------------------------
  *public void populateDAG(DAG dag, Configuration conf)*
*  {*
*    Gen gen = dag.addOperator("generator", new Gen());*

*    // configure parser*
*    XmlParser parser = dag.addOperator("parser", new XmlParser());*
*    parser.setClazz(Employee.class);*

*    ConsoleOutputOperator cons = dag.addOperator("console", new
ConsoleOutputOperator());*

*    dag.addStream("input", gen.output, parser.in
<http://parser.in>).setLocality(Locality.CONTAINER_LOCAL);*
*    dag.addStream("data", parser.parsedOutput,
cons.input).setLocality(Locality.CONTAINER_LOCAL);*
----------------------------------------

Both versions of the project are in branch *add-xmlparse* at:
  *git@github.com:amberarrow/examples.git*

Anybody know the right way to use this operator in 3.3 ?

Thanks.

Ram

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message