My GlassFish instance uses two JDBC resources (different databases) and drives
two applications. So each application is bound to its own JDBC resource.
Unfortunately, by incident I have bound both applications to the same JDBC
resource when I redeployed a new version of one of the applications. As a
result, certainly the mis-bound application did not work.
So I fixed the WAR once my, and did another redeploy. Strange but true, still it
complained to not find its tables!
Then, I undeployed the WAR, and deployed it from scratch. But STILL it did not
find its tables!
Then, I did nothing else but to stop and start the GlassFish instance (without
any other action) – and THEN it was bound to the right JDBC resource!
That's pretty weird. It looks as if the undeploy doesn't really "forget" the
mis-bound JDBC resource, and just binds again to it when doing another deploy.