rmilbu
rmilbu

Reputation: 1

Unable to deserialize mleap bundle

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

Upvotes: 0

Views: 183

Answers (1)

ordonezalex
ordonezalex

Reputation: 2744

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.

Upvotes: 0

Related Questions