[jboss-user] [Management, JMX/JBoss] - Re: Embedding MySQL as an MBean with Connector/MXJ
danliang
do-not-reply at jboss.com
Mon Oct 23 16:08:30 EDT 2006
These changes are made in MysqldResource.java:
To allow a defaults file
Line 514 was changed to:
| String[] constructArgs(Map mysqldArgs)
| {
| List strs = new ArrayList();
| strs.add(utils.files().getPath(getMysqldFilePointer()));
|
| //This line was previously "no-defaults" or something to this effect
| //The defaults file "my.ini" now is expected to be in the "datadir"
| //NOTE: This can be changed to any directory, but is hardcoded
| //so it is not very portable.
| strs.add("--defaults-file=\".\\my.ini\"");
|
| if (isWindows()) {
| strs.add("--console");
| }
|
Code changes to use specified data and base dirs:
Line 414:
| /** called from option parser as well */
| synchronized Shell exec(String threadName, Map mysqldArgs,
| PrintStream outStream, PrintStream errStream, boolean withListeners) {
|
| //Change the order these calls were made so that the files will be
| //created prior to making sure the files exist.
| makeMysqld();
| ensureEssentialFilesExist();
| adjustParameterMap(mysqldArgs);
| //end changes made
|
|
| String[] args = constructArgs(mysqldArgs);
| outStream.println(new ListToString().toString(args));
|
Line 441:
|
| private void adjustParameterMap(Map mysqldArgs) {
| /*
| //Commented out the ensureDir, this is one major cause of the problem.
| //since it checks the base and data dir against the defaults.
| //It appeared there were other constructors to allow for the data and
| //base dir to be specified but these can not be called through JBoss.
|
| ensureDir(mysqldArgs, baseDir, MysqldResourceI.BASEDIR);
| ensureDir(mysqldArgs, dataDir, MysqldResourceI.DATADIR);
| */
| mysqldArgs.put(MysqldResourceI.PID_FILE, utils.files().getPath(
| pidFile()));
| ensureSocket(mysqldArgs);
| }
|
As far as I remember these were all the changes that had to be made, it has been a while so I may be wrong.
I remember recompiling the source was a real PITA, as there were alot of dependencies on other files.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980176#3980176
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980176
More information about the jboss-user
mailing list