IET-OU / nquire-web-source

Join missions to explore your world. The nQuire-it web source code (front end & Java back end) —
http://www.nquire-it.org
GNU General Public License v3.0
2 stars 2 forks source link

Java 500 error: "java.lang.IllegalArgumentException: id to load is required for loading" #11

Open nfreear opened 9 years ago

nfreear commented 9 years ago

Appears to happen after a restart, after fixing another runtime error?!

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: id to load is required for loading

type Exception report

message Request processing failed; nested exception is java.lang.IllegalArgumentException: id to load is required for loading

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: id to load is required for loading
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:943)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:822)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:177)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
...
evilfer commented 9 years ago

Hi Nick, that's a weird error, what request(s) causes the error?

nfreear commented 8 years ago

Hi Eloy, Thanks - good question.

Errors for:

No error for:

I wondered if it was to do with whether I'm (or someone) is logged in to the nQuire-it site when I stop the server, then restart with another exception... ? (And, the affected methods are ones that do an is-logged-in or is-admin type check?)

Any ideas welcome!

Nick

evilfer commented 8 years ago

The error URLs seem to be api endpoints expected to work both with and w/o a logged user. If you haven't done it yet, I'd try stopping the server, deleting the stored sessions (there must be a SESSIONS.ser file somewhere), then restarting again. That should prevent any problem with incompatible sessions. I don't think session info is stored in the DB, but it may be worth looking at it to make sure.

Another thing is to debug the app (if you can replicate the problem in local), to get the original exception that causes the problem. I find it a bit strange, but Spring consumes the original exception and throws a new one, so that the printed stacktrace is not very useful. If you can, set a breakpoint at line 943 of org.springframework.web.servlet.FrameworkServlet and take a look at the stacktrace of variable ex. With a bit of luck, that should backtrace to the nquireit sourcecode. Otherwise it must be in the config... :(

Hi Eloy, Thanks - good question.

Errors for:

No error for:

I wondered if it was to do with whether I'm (or someone) is logged in to the nQuire-it site when I stop the server, then restart with another exception... ?

Any ideas welcome!

Nick

— Reply to this email directly or view it on GitHub https://github.com/IET-OU/nquire-web-source/issues/11#issuecomment-162922703 .