James Doucette wrote:
>
> I'm running a java application that accesses a mysql database and
> produced reports in html formats.. anyways, the program compiles and runs
> one one machine (Irix), but when I try it on a different machine (Linux)
> it will compile, but won't run... instead it produces the following errors:
>
> SIGSEGV 11* segmentation violation
> stackbase=0xbffffa78, stackpointer=0xbffff978 Full thread dump:
> "Finalizer thread" (TID:0x4076d210, sys_thread_t:0x414b1e0c, state:R)
> prio=1
> "Async Garbage Collector" (TID:0x4076d258, sys_thread_t:0x41490e0c,
> state:R) prio=1
> "Idle thread" (TID:0x4076d2a0, sys_thread_t:0x4146fe0c, state:R)
> prio=0
> "Clock" (TID:0x4076d088, sys_thread_t:0x4144ee0c, state:CW) prio=12
> "main" (TID:0x4076d0b0, sys_thread_t:0x8188d78, state:R) prio=5
> *current thread*
> java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:60)
> java.net.Socket.<init>(Socket.java:52)
> java.net.Socket.<init>(Socket.java:198)
> java.net.Socket.<init>(Socket.java:89)
> org.gjt.mm.mysql.MysqlIO.<init>(MysqlIO.java:87)
> org.gjt.mm.mysql.Connection.<init>(Connection.java:228)
> org.gjt.mm.mysql.Driver.connect(Driver.java:126)
> java.sql.DriverManager.getConnection(DriverManager.java:83)
> java.sql.DriverManager.getConnection(DriverManager.java:126)
> worktable.start(worktable.java:63)
> worktable.main(worktable.java:36) Monitor Cache Dump:
> java.lang.Class@1081544640/1081943312: owner "main" (0x8188d78, 2
> entries)
> org.gjt.mm.mysql.Driver@1081544648/1081943304: owner "main"
> (0x8188d78, 1 entry) Registered Monitor Dump:
> Thread queue lock: <unowned>
> Name and type hash table lock: <unowned>
> String intern lock: <unowned>
> JNI pinning lock: <unowned>
> JNI global reference lock: <unowned>
> BinClass lock: <unowned>
> Class loading lock: <unowned>
> Java stack lock: <unowned>
> Code rewrite lock: <unowned>
> Heap lock: <unowned>
> Has finalization queue lock: <unowned>
> Finalize me queue lock: <unowned>
> Dynamic loading lock: <unowned>
> Monitor IO lock: <unowned>
> Child death monitor: <unowned>
> Event monitor: <unowned>
> I/O monitor: <unowned>
> Alarm monitor: <unowned>
> Waiting to be notified:
> "Clock" (0x4144ee0c)
> Monitor registry: owner "main" (0x8188d78, 1 entry) Thread Alarm Q:
> Aborted (core dumped)
>
> Here is the code.....
>
> import org.gjt.mm.mysql.*;
> import org.gjt.mm.mysql.Connection;
> import org.gjt.mm.mysql.Statement;
> import org.gjt.mm.mysql.Driver;
> import org.gjt.mm.mysql.ResultSet;
> import org.gjt.mm.mysql.ResultSetMetaData;
> import java.io.*;
> import java.sql.*;
> import java.util.*;
> import java.awt.*;
> import java.awt.event.*;
> import java.applet.Applet;
>
> class worktable {
> static Connection con;
> static ResultSet rs;
>
> //********************************************************************
> // main method
> //********************************************************************
> public static void main(String argv[]) {
> start();
> }
>
> //*******************************************************************
> //******************************************************************
> static void start() {
>
> String url = "urlstuff";
>
> try {
> PrintStream ostream = new PrintStream(new
> FileOutputStream("worktable.html"));
>
> try {
> Class.forName("org.gjt.mm.mysql.Driver");
> }
> catch (Exception ex) {
> System.out.println("Can't find database driver class:
> " + ex);
> }
>
> try {
> con = (Connection)DriverManager.getConnection(url,
> "james", null);
> }
> catch (SQLException ex) {
> System.out.println("SQL Exception: " + ex);
> }
>
> ............................ etc.
>
> The error seems to be occuring at con = (Connection)DriverManager.getConnection(url,
> "james", null);
>
> Any suggestions.....
Hi James
_Never_ import the driver classes.
You didn't say what VM and OS version you are using.
The above seems to be a buggy VM (or threading problems).
BTW:
Why are you compiling it on Linux again?
Can't you just move the class files to the Linux box?
Tschau
Christian