I am building an EJB that uses Hibernate and Netbeans as my IDE. I have written tests for all of my entities and when I run the tests, everything works great: Hibernate connects to my database and pulls data like it should. However, when I deploy to the embedded GlassFish server, I will get this error when using getNamedQuery():
org.hibernate.MappingException: Named query not known: User.getPassword
If I try to createQuery() using the same code as in the named query, I get:
org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [SELECT u.password FROM User u WHERE u.userID = :userID]
And if I try using the full package name in the createQuery(), I get this:
WARNING: no persistent classes found for query class: SELECT u.password FROM com.tdocc.service.entities.User u WHERE u.userID = :userID
Once again, everything works great when tested and if I try to take everything and make a quick command-line application out of it, everything works perfectly. It's only when I deploy it to GlassFish. It's like GF isn't picking up any of my Entity classes.
I should also mention that GF doesn't pick up on any of the Libraries I have configured in my project. I had to manually copy all of the Hibernate libraries to GF (glassfish-3.0.1/glassfish
ib/ext) in order to get this far.
Thank you in advance for any help you can give me.