wso2 / streaming-integrator-tooling

Apache License 2.0
45 stars 33 forks source link

"java.lang.NoClassDefFoundError" is logged in Streaming Integrator Tooling M4 and M7 packs when trying out XML custom mapping #148

Closed RukshiW closed 3 years ago

RukshiW commented 3 years ago

Description:

The following are the steps followed:

  1. Create an XML file with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <flights>
     <flightevent>
        <flight>QR-1405</flight>
        <details>
           <destination>lisbon</destination>
           <passengers>200</passengers>
           <duration>6 35m</duration>
        </details>
     </flightevent>
     <flightevent>
        <flight>QR-0273</flight>
        <details>
           <destination>amsterdam</destination>
           <passengers>220</passengers>
           <duration>7h 40m</duration>
        </details>
     </flightevent>
     <flightevent>
        <flight>QR-1019</flight>
        <details>
           <destination>amsterdamn</destination>
           <passengers>210</passengers>
           <duration>7h 35m</duration>
        </details>
     </flightevent>
    </flights>

Save it is a preferred location (e.g., /Users/foo directory).

  1. In the Streaming Integrator Tooling milestone pack, create and save the following Siddhi application.

    @App:name('ConvertXMLFormatApp')
    
    @App:description('Description of the plan')
    
    @source(type = 'file', file.uri = "file:/users/foo/flights.xml",
        @map(type = 'xml', enclosing.element = "/flights/flightevent", enclosing.element.as.event = "true",
            @attributes(flight = "flight", destination = "details/destination", passengers = "details/passengers", timeDuration = "details/duration")))
    define stream FlightInfoStream (flight string, destination string, passengers int, timeDuration string);
    
    @sink(type = 'file', file.uri = "file:/users/foo/formatttedflights.xml",
        @map(type = 'xml'))
    define stream FormattedFlightInfoStream (flight string, destination string, passengers int, timeDuration string);
    
    @info(name = 'Publish formatted events')
    from FlightInfoStream 
    select * 
    insert into FormattedFlightInfoStream;
  2. Start the Siddhi application. An error log appears and it includes the "java.lang.NoClassDefFoundError" error. The complete error log is attached.

XML Custom Mapping Error Log.txt

dnwick commented 3 years ago

This issue is not there anymore in the latest pack.