R: App + ConnectorJ + MXJ deployment
"tech" <[email protected]>
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Organization | edoss consulenze |
| Message-ID | <[email protected]> |
Hi Eric, I sum up the situation. Now on the deployment pc I have: 1) mysql-connector-java-5.0.3-bin.jar in the $JAVA_HOME/jre/lib/ext directory 2) MySQLTest.jar (my Java application) 3) connector-mxj.jar (my own connector-mxj.jar with the pre-configured DB for the above application, created following paragraph 27.4.5.1 and 27.4.5.2 of the online manual) 4) aspectjrt.jar (copied and pasted from my development pc). All of the paths to the above four jar files are in the CLASSPATH of the deployment pc. Attached you can find: 1) my Console output. JRE cannot find '5-0-22/Win-x86/mysqld-nt.exe'. Actually mysqld-nt.exe is in connector-mxj.jar. I unpacked connector-mxj.jar and found it at 5-0-22/Win-x86/. 2) my Java class which manages the connection to MySQL. Thanks for any hint. Roberto -----Messaggio originale----- Da: Eric Herman [mailto:[email protected]] Inviato: giovedì 21 settembre 2006 15.15 A: tech Cc: [email protected] Oggetto: Re: App + ConnectorJ + MXJ deployment Hello Roberto On Thu, 2006-09-21 at 14:29 +0200, tech wrote: > Hi Eric, > > > > Now on the deployment pc I have: > > > > 1) mysql-connector-java-5.0.3-bin.jar in the $JAVA_HOME/jre/lib/ext > directory > > > > 2) MySQLTest.jar (my Java application) > > > > 3) connector-mxj.jar (my own connector-mxj.jar with the pre-configured > DB for the above application, created following paragraph 27.4.5.1 and > 27.4.5.2 of the online manual) > > > > 4) aspectjrt.jar (copied and pasted from my development pc). > > > > All of the paths to the above four jar files are in the CLASSPATH of > the deployment pc. Okay, so far that sounds good. > > > > I tried to launch my Java app, but I get the attached Console output. > Just looking at the console output, it looks like perhaps the application is trying to make a connection to the database prior to calling "start" upon the MysqldResource. I come to this guess because I do not see any output from Connector/MXJ, and I see the exception is "java.net.SocketException: java.net.ConnectException: Connection refused: connect" which may indicate that the database is not yet started. > Should I maybe first extract directories and files from > connector-mxj.jar and run something ? Provided you re-packaged the connector-mxj.jar correctly, you shouldn't need to extract anything by hand. If I recall, you had good luck with the ConnectorMXJObjectTestExample when doing testing. And I assume that your application's use of Connector/MXJ is based upon the ConnectorMXJObjectTestExample, yes? Do you have some code in your application that looks something like this? /* start mysql */ MysqldResource mysqldResource = new MysqldResource(databaseDir); Map database_options = new HashMap(); database_options.put("port", Integer.toString(port)); mysqldResource.start("mysqld-thread", database_options); /* ... */ String url = "jdbc:mysql://localhost:" + port + "/" + dbName; Connection conn = DriverManager.getConnection(url, user, password); /* ... */ mysqldResource.shutdown(); Since I can not see your application it is hard to guess. But, please take another look at ConnectorMXJObjectTestExample.java and compare your application to the example. Perhaps you will detect a small over-sight. Cheers -Eric > > > Thanks for your help. > > > > Roberto > > > > > > -- Eric Herman, Software Developer MySQL AB, www.mysql.com VoIP Ext: 6594 US: +1 408 213 6540 Europe: +46 18 174 400 Mobile: +31 [0]6-20719662 Are you MySQL certified? www.mysql.com/certification -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/[email protected] __________ Informazione NOD32 1.1765 (20060920) __________ Questo messaggio è stato controllato dal Sistema Antivirus NOD32 http://www.nod32.it -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/[email protected]
Console_20060922_A.txt
(text/plain, 3.3 KB)
Microsoft Windows XP [Versione 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
E:\Documents and Settings\Administrator>cd..
E:\Documents and Settings>cd..
E:\>CD myTestApp
E:\myTestApp>SET CLASSPATH
CLASSPATH=E:\Programmi\Java\jre1.5.0_08\lib\ext\mysql-connector-java-5.0.3-bin.j
ar;E:\myTestApp\aspectjrt.jar;E:\myTestApp\connector-mxj.jar;E:\myTestApp\MySQLT
est.jar
E:\myTestApp>java -jar MySQLTest.jar
java.util.MissingResourceException: Resource '5-0-22/Win-x86/mysqld-nt.exe' not
found
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:12
2)
at com.mysql.management.util.Streams.getResourceAsStream(Streams.java:10
9)
at com.mysql.management.util.Streams$1.inner(Streams.java:138)
at com.mysql.management.util.Exceptions$VoidBlock.exec(Exceptions.java:1
28)
at com.mysql.management.util.Streams.createFileFromResource(Streams.java
:151)
at com.mysql.management.MysqldResource.makeMysqld(MysqldResource.java:45
3)
at com.mysql.management.MysqldResource.exec(MysqldResource.java:418)
at com.mysql.management.MysqldResource.getHelp(MysqldResource.java:580)
at com.mysql.management.MysqldResource.start(MysqldResource.java:154)
at packageAntiriciclaggio.AmministrazioneDB.apriConnessione(Amministrazi
oneDB.java:55)
at packageAntiriciclaggio.AmministrazioneDB.<init>(AmministrazioneDB.jav
a:29)
at packageAntiriciclaggio.LogonAntiriciclaggio$GestoreEventi.windowOpene
d(LogonAntiriciclaggio.java:276)
at java.awt.Window.processWindowEvent(Unknown Source)
at javax.swing.JFrame.processWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at packageAntiriciclaggio.LogonAntiriciclaggio$GestoreEventi.windowOpene
d(LogonAntiriciclaggio.java:279)
at java.awt.Window.processWindowEvent(Unknown Source)
at javax.swing.JFrame.processWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)