Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im building a java application that uses JDBC to connect to MySQL. I have an ant script that compiles my code and then packages it, along with log4j, junit, libshout-java and the mysql jdbc driver into one executable jar. This all works fine on ubuntu 9.10, and my code connects to mysql and away we go.

However my production env will be solaris (my dev box is ubuntu) and when I came to build and run this on there i had the following errors.

17 [main] DEBUG com.radiobusi.ShoutGen.ParseConfig  - [SQL, SELECT * FROM RadioBusi.RadioBusi_song JOIN RadioBusi.RadioBusi_playlist WHERE RadioBusi_playlist.Name = 'Placebo 2';]
18 [main] DEBUG com.radiobusi.ShoutGen.ParseConfig  - this is able to be broken up[SQL, SELECT * FROM RadioBusi.RadioBusi_song JOIN RadioBusi.RadioBusi_playlist WHERE RadioBusi_playlist.Name = 'Placebo 2';]
78 [main] ERROR com.radiobusi.ShoutGen  - An error occured instantiating the class ShoutGen
        at com.mysql.jdbc.Util.stackTraceToString(
        at com.mysql.jdbc.Util.<clinit>(
        at com.mysql.jdbc.NonRegisteringDriver.parseURL(
        at com.mysql.jdbc.NonRegisteringDriver.connect(
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(
        at com.radiobusi.ShoutGen.PlayList.<init>(Unknown Source)
        at com.radiobusi.ShoutGen.ShoutGen.<init>(Unknown Source)
        at com.radiobusi.ShoutGen.ShoutGen.main(Unknown Source)
Caused by: java.lang.RuntimeException: Can't load resource bundle due to underlying exception java.util.MissingResourceException: Can't find bundle for base name com.mysql.jdbc.LocalizedErrorMessages, locale en_AU
        at com.mysql.jdbc.Messages.<clinit>(
        ... 9 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.mysql.jdbc.LocalizedErrorMessages, locale en_AU
        at java.util.ResourceBundle.throwMissingResourceException(
        at java.util.ResourceBundle.getBundleImpl(
        at java.util.ResourceBundle.getBundle(
        at com.mysql.jdbc.Messages.<clinit>(
        ... 9 more
Exception in thread "main" java.lang.NullPointerException
        at com.radiobusi.ShoutGen.ShoutGen.main(Unknown Source)

My mysql database locale is en_US on solaris, but my ubuntu mysql database is the also en_US.

Anybody got any idea's?

Im not sure what other information is needed, so if you would like more information just let me know in the comments.

Jars that get packaged


munderwo@opensolaris:~/ShoutGen-Java$ uname -a
SunOS opensolaris 5.11 snv_111b i86pc i386 i86pc Solaris

MySQL Version: MySQL 5.1.30



PS this is a cross post from as it kind of blurs the line between programming an sys-admin.


the following ant target is how i packaged my jars. This means that the mysql jar is actually inside the jar and should be available to in automatically

<target name="jar">
        <!-- Capture the path as a delimited property using the refid attribute -->
        <property name="myclasspath" refid="classpath"/>
        <!-- Emit the property to the ant console -->
        <echo message="Classpath = ${myclasspath}"/>
        <mkdir dir="${jar.dir}"/>
        <jar destfile="${dest.file}" basedir="${classes.dir}">
                <attribute name="Main-Class" value="com.radiobusi.ShoutGen.ShoutGen"/>
            <zipfileset src="${lib.dir}/junit-4.8.1.jar" includes="**/*.class"/>
            <zipfileset src="${lib.dir}/libshout.jar" includes="**/*.class"/>
            <zipfileset src="${lib.dir}/log4j-1.2.15.jar" includes="**/*.class"/>
            <zipfileset src="${lib.dir}/mysql-5.1.6.jar" includes="**/*.class"/>
share|improve this question

make sure your jar is using the packed libs on your ubuntu box. Just move the libs in the filesystem temporarily to another location. When your jar runs, you can be sure the libs in the jar are used.

How did you reference the external libs from your jar? Did you add them to the Class-Path of your manifest file? When you did so, did you use relative or absolute paths?

share|improve this answer
Do you mean the shared libraries for mysql ie libmysqlclient etc? How do you add these to the jar Class-Path of the manifest file. – Mark Jan 12 '10 at 7:56
no, with libs i meen your additional jars for mysql, junit and log4j. – Christian Jan 12 '10 at 8:55
See Update 1 for my ant packaging. THanks again for your help! – Mark Jan 12 '10 at 11:22
take a look at this link there is an example for a zipfileset. perhaps it helps. – Christian Jan 12 '10 at 12:09
up vote 0 down vote accepted

I think the reason for this surprise, surprise, user error :)

I removed any mysql jdbc from my lib directory in my source code and then put the mysql jdbc connector that came with opensolaris (looks like it came from sun studio) in lib/ext of java. Once I did this it all seemed to work. On closer inspection I think I might have still had the ubuntu mysql JDBC driver in my class path and quite possibly before the cross-platform jar. So I suspect that this was the problem.

Thanks for all your help!


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.