Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

HHH000388: Unsuccessful: insert into users(username, enabled, password, role_id) values ('user', true,'password',1)

Hi folks

Any idea how to get this H2 DB started? Please note the error below.

Thanks

Hibernate: drop table Role if exists Hibernate: drop table Task if exists Hibernate: drop table User if exists Hibernate: create table Role ( id bigint generated by default as identity, name varchar(255), primary key (id) ) Hibernate: create table Task ( id bigint generated by default as identity, complete boolean not null, description varchar(255), primary key (id) ) Hibernate: create table User ( id bigint generated by default as identity, enabled boolean not null, password varchar(100), username varchar(20), role_id bigint, primary key (id) ) Hibernate: alter table User add constraint UK_jreodf78a7pl5qidfh43axdfb unique (username) Hibernate: alter table User add constraint FK84qlpfci484r1luck11eno6ec foreign key (role_id) references Role 2016-08-28 07:46:36.912 ERROR 3564 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000388: Unsuccessful: insert into users(username, enabled, password, role_id) values ('user', true,'password',1) 2016-08-28 07:46:36.912 ERROR 3564 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : Table "USERS" not found; SQL statement: insert into users(username, enabled, password, role_id) values ('user', true,'password',1) [42102-190] 2016-08-28 07:46:36.912 ERROR 3564 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000388: Unsuccessful: insert into users(username, enabled, password, role_id) values ('user2', true,'password',1) 2016-08-28 07:46:36.912 ERROR 3564 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : Table "USERS" not found; SQL statement: insert into users(username, enabled, password, role_id) values ('user2', true,'password',1) [42102-190] 2016-08-28 07:46:36.914 INFO 3564 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete

1 Answer

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

If bug is reproducable, push your repo to GitHub and share link here. The error is strange... But your log is different from mine (I downloaded Chris repo just now) in this line:

Yours:

create table Task ( 
  id bigint generated by default as identity, 
  complete boolean not null, 
  description varchar(255), 
  primary key (id) 
)

Mine:

    create table Task (
        id bigint generated by default as identity,
        complete boolean not null,
        description varchar(255),
        user_id bigint,
        primary key (id)
    )

That means that you've probably change Chris repo code, that's why the only way to debug your error is to see your code completely...