Results 1 to 6 of 6
- 10-17-2010, 12:19 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 6
- Rep Power
- 0
Probelms with the ConnectorJ and exported JAR
Hi, I am using the connectorj to access a mysql database, which works fine as long as I run the application in eclipse. But if I export it as a runnable Jar I get the following error:
Null data: com.mysql.jdbc.LocalizedErrorMessages
Null data: com.mysql.jdbc.LocalizedErrorMessages_en
Exception in thread "doDealHandThread" java.lang.ExceptionInInitializerError
at com.mysql.jdbc.Util.stackTraceToString(Util.java:3 53)
at com.mysql.jdbc.Util.<clinit>(Util.java:118)
at com.mysql.jdbc.NonRegisteringDriver.parseURL(NonRe gisteringDriver.java:712)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:280)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(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
at com.mysql.jdbc.Messages.<clinit>(Messages.java:63)
... 16 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name com.mysql.jdbc.LocalizedErrorMessages, locale en
at java.util.ResourceBundle.throwMissingResourceExcep tion(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at com.mysql.jdbc.Messages.<clinit>(Messages.java:61)
... 16 more
I searched the web for hours but I cannot find a solution.
The only one I found suggests that the connector.jar directory might include illegal characters, but this is not the case.
Thanks a lot!
- 10-17-2010, 07:09 PM #2
does the export as executable jar file repackage the mysql .jar file as well, such as create a single jar file with your code and the stuff in the connector-j jar file ?
Its possible that this operation is not collecting resource bundle (.properties) files from within the connector-j file, and is only copying the .class files.
Have a look at the contents of your exported jar file and the original connector-j file, and try to manually repackage the jar file by hand to stuff in those resources, if they are missing, to see if that makes it work. If it does, it is likely a setting option or a bug with the eclipse export as executable jar file task.
- 10-17-2010, 10:58 PM #3
Member
- Join Date
- Sep 2010
- Posts
- 6
- Rep Power
- 0
Unfortunately, the packages are absolutly identical, there is no difference. I also get the same error if I use Fat Jar.
- 10-18-2010, 09:43 AM #4
Member
- Join Date
- Sep 2010
- Posts
- 6
- Rep Power
- 0
Has anyone an idea?
Thanks a lot, I really do not know what to do.
- 10-18-2010, 10:22 AM #5
Member
- Join Date
- Sep 2010
- Posts
- 6
- Rep Power
- 0
Finally, I figured it out, instead of merging the connectorj classes into the jar, I dynamically load the file like in the class given at this forum:
Java Runtime Environment (JRE) - Modify Classpath At Runtime [Locked]
- 10-18-2010, 10:26 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks