Turns out there were orphan records in the sde.table_registry table.
When I checked the logs it showed that the jpa_viewer account was getting a lot of errors trying to select from tables that didn't exist in the geodata schema. But the phantom tables existed as a recordrecords in the table_registrysde.table_registry. Once I cleaned out thethese phantom tables jpa_viewer account connected successfully.