Bug #48298 Starting MySQL MXJ 5.0.9 on Windows 7
Submitted: 26 Oct 2009 2:38 Modified: 16 Dec 2009 10:44
Reporter: Product Support Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / MXJ Severity:S2 (Serious)
Version:latest MXJ, latest c/J snapshot OS:Windows (7)
Assigned to: Eric Herman CPU Architecture:Any
Tags: MXJ, windows 7

[26 Oct 2009 2:38] Product Support
Description:
When starting up MXJ on Windows 7 a stack trace is logged and the database does not start.

Exception in thread “Thread-3” java.util.MissingResourceException?: Resource ‘5-0-51a/Windows_7-x86/mysqld-nt.exe’ not found
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:133)
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:107)
at com.mysql.management.util.Streams$1.inner(Streams.java:149) at com.mysql.management.util.Exceptions$VoidBlock?.exec(Exceptions.java:128)
at com.mysql.management.util.Streams.createFileFromResource(Streams.java:162)
at com.mysql.management.MysqldResource?.makeMysqld(MysqldResource?.java:533)
at com.mysql.management.MysqldResource?.deployFiles(MysqldResource?.java:518)
at com.mysql.management.MysqldResource?.exec(MysqldResource?.java:495)
at com.mysql.management.MysqldResource?.start(MysqldResource?.java:216)
at com.mysql.management.MysqldResource?.start(MysqldResource?.java:166)

How to repeat:
Start MXJ on Windows 7
[10 Nov 2009 11:03] Tonci Grgin
Hi and thanks for your report.

I did test and made sure all is in place but the error is there just as described. Eric is already notified and provided with entire trace.
[10 Nov 2009 11:12] Eric Herman
Looks like we need to add "Windows_7-x86-x86=Win-x86" to the platform-map.properties file
[10 Nov 2009 14:23] Tonci Grgin
I just tested, it is enough to add mentioned line (no quotes). Changing workaround availability.

Full workaround description:
  As platform-map is read from JAR one should create separate folder (ie. c:\foo) for this file and copy it from mysql-connector-mxj-gpl-5-0-9\resources there (ie. into c:\foo). Then make change by adding Windows_7-x86=Win-x86 near the bottom of file. After that, new folder (ie. c:\foo) should be added as *first* folder into CLASSPATH variable.

C:\Users\tonci\Downloads\mysql-connector-mxj-gpl-5-0-9\mysql-connector-mxj-gpl-5
-0-9\src>java ConnectorMXJUrlTestExample
jdbc:mysql:mxj://localhost:3336/our_test_app?server.basedir=C:\Users\tonci\AppDa
ta\Local\Temp\test-mxj&createDatabaseIfNotExist=true&server.initialize-user=true

[C:\Users\tonci\AppData\Local\Temp\test-mxj\bin\mysqld-nt.exe][--no-defaults][--
console][--port=3336][--socket=mysql.sock][--basedir=C:\Users\tonci\AppData\Loca
l\Temp\test-mxj][--datadir=C:\Users\tonci\AppData\Local\Temp\test-mxj\data][--pi
d-file=C:\Users\tonci\AppData\Local\Temp\test-mxj\data\MysqldResource.pid]
[MysqldResource] launching mysqld (driver_launched_mysqld_1)
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
091110 15:11:35  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
091110 15:11:35  InnoDB: Log file .\ib_logfile0 did not exist: new to be created

InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
091110 15:11:36  InnoDB: Log file .\ib_logfile1 did not exist: new to be created

InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
091110 15:11:36  InnoDB: Started; log sequence number 0 0
091110 15:11:36 [Note] C:\Users\tonci\AppData\Local\Temp\test-mxj\bin\mysqld-nt.
exe: ready for connections.
Version: '5.0.51a-community-nt'  socket: ''  port: 3336  MySQL Community Edition
 (GPL)
[MysqldResource] mysqld running as process: 1344
------------------------
SELECT VERSION()
------------------------
5.0.51a-community-nt
------------------------
[MysqldResource] stopping mysqld (process: 1344)
091110 15:11:42 [Note] C:\Users\tonci\AppData\Local\Temp\test-mxj\bin\mysqld-nt.
exe: Normal shutdown

091110 15:11:42  InnoDB: Starting shutdown...
091110 15:11:43  InnoDB: Shutdown completed; log sequence number 0 43655
091110 15:11:43 [Note] C:\Users\tonci\AppData\Local\Temp\test-mxj\bin\mysqld-nt.
exe: Shutdown complete

[MysqldResource] shutdown complete
[18 Nov 2009 12:31] Enterprise Tools JIRA Robot
Eric Herman writes: 
Windows_7-x86 not in platoform-map.properties
[14 Dec 2009 8:41] Enterprise Tools JIRA Robot
Eric Herman writes: 
fixed in 5.0.11
[16 Dec 2009 10:44] Tony Bedford
There was, somehow, an existing entry in the changelog for this bug. However, it has been updated to include additional information as follows:

On startup Connector/MXJ generated an exception on Windows 7:

Exception in thread “Thread-3” java.util.MissingResourceException?: Resource
‘5-0-51a/Windows_7-x86/mysqld-nt.exe’ not found
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:133)
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:107)
at com.mysql.management.util.Streams$1.inner(Streams.java:149) at
com.mysql.management.util.Exceptions$VoidBlock?.exec(Exceptions.java:128)
at com.mysql.management.util.Streams.createFileFromResource(Streams.java:162)
at com.mysql.management.MysqldResource?.makeMysqld(MysqldResource?.java:533)
at com.mysql.management.MysqldResource?.deployFiles(MysqldResource?.java:518)
at com.mysql.management.MysqldResource?.exec(MysqldResource?.java:495)
at com.mysql.management.MysqldResource?.start(MysqldResource?.java:216)
at com.mysql.management.MysqldResource?.start(MysqldResource?.java:166)

The default platform-map.properties file, which maps platforms to the supplied binary bundles, has been updated with additional platforms, including Windows 7, Windows Server 2008, amd64 and sparcv9 for Solaris, and Mac OS X 64-bit.
[8 Feb 2010 17:40] Kilian Koller
Hi,
is there any reason why one should not use MXJ on 64 bit windows systems?

I added the following line to platform-map.properties:
Windows_7-amd64=Win-x86

This works perfect.

Regards, Kilian
[8 Feb 2010 17:41] Tonci Grgin
Kilian, no there is not. As a matter of fact, I tested on W7 x64.
[14 Aug 2013 17:59] Jaja Galore
Killian is saying that there is still a missing entry in the platform-map.properties file. The missing entry is for Windows 7 64-bit.

In any case, wouldn't it be less of a maintenance burden to just default Windows to Win-x86 unless a specific mapping for the (OS version, bitness) combo is defined? Right now, 5.0.12 would have to be extracted, the mapping added, and then it will have to be pushed back into Nexus under a different version. A bit verbose for such a small issue.
[14 Aug 2013 18:02] Jaja Galore
To clarify, on my 64-bit machine, I had to add Windows_7-amd64=Win-x86 to platform-map.properties to allow it to work. I am using 5.0.12, which already has 
Windows_7-x86=Win-x86 in that file - obviously that doesn't work.