Re: App + ConnectorJ + MXJ deployment
Eric Herman <[email protected]>
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <1158844491.25193.49.camel@localhost> |
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]