Unable to deserialize mleap bundle

181 views Asked by At

I am getting a java.util.NoSuchElementException: None.get on the following code:

// Deserialize a directory bundle
val bundle = (for(bundleFile <- managed(BundleFile(bundle_path))) yield {
    bundleFile.loadMleapBundle().get
}).opt.get

The error is on the opt.get line

1

There are 1 answers

0
ordonezalex On

An example from one of MLeap's tests deserializes a bundle this way:

val bundle = (for(bundle <- managed(BundleFile(new File(lrUri.getPath)))) yield {
      bundle.loadMleapBundle().get
    }).tried.get

Perhaps you should use tried instead of opt.