File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Unable to find database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Unable to find database" Watch "Unable to find database" New topic

Unable to find database

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 229

With Maven2, jpa2, hibernate 3.6.5.Final, Mysql 5 and Glassfish 3.1, I am trying to deploy a WAR file, but it comes up with the following error:

Here is my src/WEB-INF/persistence.xml file:

my src/main/webapp/WEB-INF/web.xml file:

I didn't create any datasource in glassfish. And I also don't understand why the deployment trying to find Derby. I actually have define MySQL in persistence.xml file.
Do I need to create datasource to point to mysql/guestbook? then how to use this newly created datasource in my persistence.xml file?

Very appreciate for any suggestion.

Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

if you look at line 53

the system is complaining about a named query. please check its syntax.

hibernate parses all named queries while the system is starting up .. this way it can save time when the query is executed (as it doesn't have to parse it every time the query is run).
I agree. Here's the link:
subject: Unable to find database
It's not a secret anymore!