Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JavaDB: Schema 'root' does not exist

 
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The title's exception is thrown when I try to persist some data to my DB. I had followed a very informative video to set up my JDBC Realm, connection pool etc... When I ping it, it's successful.

But when I try to persist the data, it crashes with these messages.


Why would it look for a "root" schema though? Aren't all settings set correctly when I created my persistence unit? My connection to the DB says "root on APP".

In an Java SE app I think you can set the schema you want to connect to, in Java EE I don't know how/if it's done.

Any suggestions?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's too small to read. Please always post text, not screenshots. That has the added advantage that you can copy and search it.

Aren't all settings set correctly when I created my persistence unit?


That's impossible to say without knowing what all the relevant parameters are.
 
Vasilis Souvatzis
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I'm sorry for that. i have the Netbeans log when Glassfish crashed, here it is: link

My persistence.xml is this:


If you would like to see some code of mine, I can provide snippets of the classes I have so far.
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But how is that datasource defined? Specifically, the name of the DB? It seems you're trying to access a DB named "ROOT", which doesn't exist.
 
Vasilis Souvatzis
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name of the DB is "jdbcrealm".

Now, in Glassfish I have set the following:

JDBC Resources:
JNDI Name - jdbc/securityDatasource
Poolname - jdbcRealmPool

JDBC Connection Pools:
Resource Type - javax.sql.ConnectionPoolDatasource
Datasource Classname - org.apache.derby.jdbc.ClientDatasource

Additional Properties:
DB name - jdbcrealm
User - root

I thought that when I created the persistent unit and entered the Datasource, that was it. But I guess I'm missing something.

By the way, thanks a lot for helping me on this
 
Vasilis Souvatzis
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may have figured it out... I checked one of my books and noticed that my persistence.xml looks nothing like the one the book has.

The book:


I think it's safe to assume that I need to enter properties for my database right? Maybe something like this:


edit: I noticed that my glassfish-resources.xml has all that information. So...
 
Vasilis Souvatzis
Ranch Hand
Posts: 109
1
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it hahahaha it was such an easy fix! My glassfish-resources.xml settings, had User="root". The User property is the schema name and not the actual user that connects to the DB! When I changed it to my schema name (app) it worked perfectly!
 
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic