• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem in setting mySql as default database server

 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to use MySql as a database server, instead of Hsqldb.
I followed the rules of this jboss article, where in step 5, I didn't found standardjbosscmp-jdbc.xml file, and in the 7,8,9 steps (I believe this is setting of some JBoss older version, but 5.0) I replace hsqldb-persistence-service.xml with mysql-persistence-service.xml.
When I try to start server, the console output to me this stack, when executiong :


However, behind in the log/server.log file it throws many exceptions pointing on error during creation of some (to me unknown) table, or errors of already existing values and so on...
What should I do, and what I didn't set correctly?
Thanks ranchers...
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GiPeter.
I am using Jboss 5.0 GA, and I am studying i from "Jboss in Action". this is the steps I perform in order to try to deploy mysql as a database server;
1-I delete hsqldb-ds.xml, and replace it with mysql-ds.xml, with following context;

where each value is set correctly.
2-I change calue of property org.quartz.jobStore.driverDelegateClass to org.quartz.impl.jdbcjobstore.StdJDBCDelegate, inside ejb3-timer-service.xml file
3- I change hsqldb-persistence-service.xml into mysql-persistence-service.xml
4-I delete .jar of hsqldb from common/lib folder where they were stored
5-I add mysql.jar into default/lib folder, in order to load mysql connector
6-I change value of <datasource-mapping> elemnt of standardjbosscmp-jdbc.xml from -Hypersonic SQL- to -mySQL-
7-I change values modify followed elemnt as such- <application-policy name = "MySqlDbRealm"> - of login-config.xml, and also update changes considering database setup (username, password, ...)

What did I do wrong, and how to correct it???
thanks
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I try to perform isolated datasource, by creating the same file mysql-ds.xml, and place it along my .war and ejb-jar file, inside .ear. I also create jboss-web.xml file, and provide following content :


now, when server try to execute this

I get this error:

It would be nice to connect to mysql using this way either, but it won't.Does anyone have an idea, what is wrong happens now???
Thanks guys and girls
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's tackle one problem at a time. The DefaultDS data source is used by various JBoss AS services and by default uses the HSQL database. Do you really want to replace HSQLDB with MySQL so that the JBoss AS services are using MySQL? Or are you more concerned with setting up a database for your application? Pick one, and only on,e and we will work on that first.

Since you have the book, do you also have the book's source code? If so, can you run target 03 in jbia-src/ch15, and does that work for you?

One more thing - the table "system_sequences" does not belong to any of the JBoss AS services. I suspect that you have deployed an app and that app is not properly configured, hence this problem. If you are really trying to replace DefaultDS, remove this app and see if startup works ok.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Let's tackle one problem at a time. The DefaultDS data source is used by various JBoss AS services and by default uses the HSQL database. Do you really want to replace HSQLDB with MySQL so that the JBoss AS services are using MySQL? Or are you more concerned with setting up a database for your application? Pick one, and only on,e and we will work on that first.



You have right. I do not want to replace entirely HSQLDB (my intent was just in testing purpose), so I would like to set my application to use mysql, or whatever other db server.
I try it just as I described in previous post, placing mysql-ds.xml file at the top level of .ear, and referencing it from jboss-web.ml file, inside META-INF.

One more thing - the table "system_sequences" does not belong to any of the JBoss AS services. I suspect that you have deployed an app and that app is not properly configured, hence this problem. If you are really trying to replace DefaultDS, remove this app and see if startup works ok.



Nothing is wrong with application. It is simple testing apps. used just to store simple entity in mysql (no messaging, no timers). When I remove it, the server start-up fine. When I exclude mysql-ds.xml file, and use Hypersonic database, the application also works fine.


Since you have the book, do you also have the book's source code? If so, can you run target 03 in jbia-src/ch15, and does that work for you?



Yes, I have source code, but have a problem deploying your example.I got this error :

I tried to modify build.properties file, to reference to my jboss-5.0.0.GA.zip, but I get the same error, just like it never read again.
However, can you figure out what goes wrong when I try to use mysql just for storing simple entity?
And, can you advice me about best practice when should I use different database but Hypersonic (should I leave Hypersonic for messaging, timer, etc.)?
 
pie. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic