I often geht "No User exists with the primary key 0"
I use JAAS and "Authentication by Sreenname", so we provided a AutoLoginFilter to provide Liferay with the correct UserId and we defined the corresponding URL patterns in web.xml
As you can see from the discussion in http://www.liferay.com/community/forums/-/message_boards/message/5086950
it it is not easy to to find all the possible URL's to apply to the filter. There is always one more URL that brings you to "No User exists..." followed by a stacktrace.
I wonder if there is not a better way since there is an attribute "j_remoteuser" which is not used anywhere and contains the correct value.