Chapter 2: Ticket: Paging

I passed the unit test but when I run the application and access the status page, i see below error in the logs:

in context with path threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: invalid hexadecimal representation of an ObjectId: [foobar]] with root cause

java.lang.IllegalArgumentException: invalid hexadecimal representation of an ObjectId: [foobar]
at org.bson.types.ObjectId.parseHexString(ObjectId.java:550) ~[bson-3.9.1.jar:na]

futher below i see:

2019-02-20 16:59:23.225 ERROR 19624 β€” [nio-5000-exec-5] Service$$EnhancerBySpringCGLIB$$4bc22a00 : Cannot validate user token Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjIxNzI3NzMsIm5iZiI6MTUyMjE3Mjc3MywianRpIjoiYjFlYmI0ZDQtNjZlZS00MTY4LTg0MWQtZGNhODJkMThmN2NhIiwiZXhwIjoxNTIyMTczNjczLCJpZGVudGl0eSI6eyJlbWFpbCI6ImZvb2JhekBiYXIuY29tIiwibmFtZSI6ImZvbyBiYXIiLCJwYXNzd29yZCI6bnVsbCwicHJlZmVyZW5jZXMiOnsiZmF2b3JpdGVfY2FzdCI6Ik1lZyBSeWFuIiwicHJlZmVycmVkX2xhbmd1YWdlIjoiRW5nbGlzaCJ9fSwiZnJlc2giOmZhbHNlLCJ0eXBlIjoiYWNjZXNzIiwidXNlcl9jbGFpbXMiOnsidXNlciI6eyJlbWFpbCI6ImZvb2JhekBiYXIuY29tIiwibmFtZSI6ImZvbyBiYXIiLCJwYXNzd29yZCI6bnVsbCwicHJlZmVyZW5jZXMiOnsiZmF2b3JpdGVfY2FzdCI6Ik1lZyBSeWFuIiwicHJlZmVycmVkX2xhbmd1YWdlIjoiRW5nbGlzaCJ9fX19.q9z_tG7gEqaRMfrbTpj9Jz52vocqOBWgEpCd3KC6giI: error thrown - JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.
2019-02-20 16:59:23.231 ERROR 19624 β€” [nio-5000-exec-5] mflix.api.security.JWTAuthEntryPoint : Unauthorized error: Full authentication is required to access this resource
2019-02-20 16:59:23.253 ERROR 19624 β€” [nio-5000-exec-3] Service$$EnhancerBySpringCGLIB$$4bc22a00 : Cannot validate user token Bearer undefined: error thrown - JWT strings must contain exactly 2 period characters. Found: 0
2019-02-20 16:59:23.257 ERROR 19624 β€” [nio-5000-exec-3] mflix.api.security.JWTAuthEntryPoint : Unauthorized error: Full authentication is required to access this resource
2019-02-20 16:59:23.305 ERROR 19624 β€” [nio-5000-exec-9] mflix.api.security.JWTAuthEntryPoint : Unauthorized error: Bad credentials

I have the same error, but I can see needed Paging code on the Status page. I believe we will implement more features in the future tickets, so this kind of errors will disappeared

I had the same issue.
However, after fixing MovieDao.getMoviesByCast() method to be same as the solution given, the issue above went away.

Solution is in Chapter 1: Driver Setup

Ticket: Subfield Text Search

I dont understand because my solution for MovieDao.getMoviesByCast() is passing

Thanks Per, it works.

Paul, my passed MovieDao.getMoviesByCast() too but if it’s not same implementation as Paging, it will not work. Try to make it same solution.

I’ve fixed it now by editing the method getMoviesByCast i changed

Sorts.ascending(sortKey)
to
Sorts.descending(sortKey)

2 Likes

It looks like a one-time authorization. Refreshing of de status-page is not possible. Go to the main-page en from there to the status-page, than it works fine.

Thanks, Thats works for me

amazing, this helped me too! thanks a lot!!!