I tried skipping the upload code and just executed this and got same stack trace. I tried with your api project instead of provided jar and got a stack trace that says unexpected return code 302 (but still got a KS ok)
Object result = client.getCategoryService().list(filter, pager);