I had the same problem, and it manifested itself in a big holabaloo of various strange exceptions that had absolutely nothing to do with my real problem.
What happened?
For some reason, the resource for jdbc/[your resource name] not created in GlassFish, and it gives you jdbc/[your resource name]__[generated thing, like "pm"] as the source.
What to do?
One way (the one I used) to fix this is to manually go to the GlassFish admin console in localhost:4848 and go to Resources on the left menu and follow the tree inside it: JDBC > JDBC resources . On the JDBC Resources tab, you create a new resource and name it jdbc/[your resource name] __[generated thing, like "pm"] not necessary.
BUT WHAT DOESN’T WORK NOW, WHAT DO I DO ??
This is exactly what happened to me, and it was here that I began to get strange exceptions, for example, how he suddenly could not find my DB driver, although I looked at it in my dependency folder.
How can I fix this?
Restart NetBeans, upgrade GlassFish, and restart it if you need to. Run the project and you should deploy it.
(I found the source of my problem from the MDB exception, and when I deleted it, it suddenly worked with my added resource, and then I could rename it at any time convenient for me, the resource in GlassFish. You may need to also look at the settings your MDB JNDI in GlassFish and manually create a resource for them)
Extra tip:
NetBeans will autofill existing resources when you write the <jta-data-source> . If it is not autocomplete, it probably does not exist.
source share