You need one more line here

```scala
Thread.currentThread.setContextClassLoader(getClass.getClassLoader)
```