• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database problem in JBoss

 
Gopi Chand
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to use mysql 5.0 with jboss 4.2.3
I have created all the required configuration xml file.
and when i try to launch jboss it gives me an error saying :

Unable to get timer handles for containerId: jboss.j2ee:service=EJB3,ear=server.ear,jar=server.jar,name=UserManagerBean
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'test.timers' doesn't exist

since this is something related to the persistence of timer services, so i ignored it.

but my entity bean is also giving problem. the prblem is :

Unsuccessful: create table UserBean (id integer generated by default as identity (start with 1), name varchar(255), primary key (id))
17:16:35,000 ERROR [SchemaExport] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'generated by default as identity (start with 1), name varchar(255), primary key ' at line 1

from the error message what i could understand is that jboss is trying to create db scheme from entity beans and it is not able to.. but why?
I have my entity beans' primary key as int with @Id and @AutoGenerated annotation.. what could be wrong?

and how do i fix the timer error as well? Please help..

Thanks,
Gopi
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your *-ds.xml file for MySQL, did you set the type-mapping:

 
Gopi Chand
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I afraid i did not..
i will try that..

thank you very much..
 
Gopi Chand
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried what you said and after that I got another problem related to JMS, which i fixed by following https://www.jboss.org/community/docs/DOC-9335

and now i am getting another error:

19:03:01,531 INFO [STDOUT] adding user bean
19:03:01,687 WARN [JDBCExceptionReporter] SQL Error: 1146, SQLState: 42S02
19:03:01,687 ERROR [JDBCExceptionReporter] Table 'test.userbean' doesn't exist

"adding user bean" message is from my remote stateless bean after which i call entityManager.persist(..), but that is throwing some error.

My standardjbosscmp-jdbc.xml has create-table tag set to true, so it is supposed to create table when no table exists.. I don't know why it is not working..

Thanks
 
Gopi Chand
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i manually create the table, it seems to work fine without any problem.. just wondering why automatic creation of db schema from bean is failing ??!?
 
Marcelo Pereira
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gopi Chand. I know this is an old question. I've faced the same problem and found this thread.
Probably you've already found the solution, but I'll answer here in case of anyone come here searching for answers.
I solved the problem adding this to my persistence.xml:

<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcelo, welcome to Java Ranch!

I rather doubt that Gopi is still waiting for a response after 2 years. Also, Gopi was using EJB 2.1, so I doubt that an answer related to EJB 3 would help.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic