Quantcast

server.main() vs server.start()

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

server.main() vs server.start()

William Krick
We currently start an hsqldb server from our Swing GUI database
administrator tool using code that looks like this....

    // create new server
    Server server = new Server();

    // start server in its own thread
    Thread serverThread = new Thread(new Runnable() {
      public void run() {
        try {
          server.main(args);
        }
        catch (Exception ex) {
          System.out.println(ex);
          ex.printStackTrace();
        }
      }
    });
    serverThread.start();


I was wondering how you go about starting a server using server.start() and
stopping it using server.stop from within a Swing GUI application.  Sample
code would be greatly appreciated.



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: server.main() vs server.start()

IchBin
William Krick wrote:

> We currently start an hsqldb server from our Swing GUI database
> administrator tool using code that looks like this....
>
>     // create new server
>     Server server = new Server();
>
>     // start server in its own thread
>     Thread serverThread = new Thread(new Runnable() {
>       public void run() {
>         try {
>           server.main(args);
>         }
>         catch (Exception ex) {
>           System.out.println(ex);
>           ex.printStackTrace();
>         }
>       }
>     });
>     serverThread.start();
>
>
> I was wondering how you go about starting a server using server.start() and
> stopping it using server.stop from within a Swing GUI application.  Sample
> code would be greatly appreciated.
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

There is an example under  \hsqldb\src\org\hsqldb\test\TestBase.java

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA  http://weconsultants.servebeer.com
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: server.main() vs server.start()

IchBin
In reply to this post by William Krick
William Krick wrote:

> We currently start an hsqldb server from our Swing GUI database
> administrator tool using code that looks like this....
>
>     // create new server
>     Server server = new Server();
>
>     // start server in its own thread
>     Thread serverThread = new Thread(new Runnable() {
>       public void run() {
>         try {
>           server.main(args);
>         }
>         catch (Exception ex) {
>           System.out.println(ex);
>           ex.printStackTrace();
>         }
>       }
>     });
>     serverThread.start();
>
>
> I was wondering how you go about starting a server using server.start() and
> stopping it using server.stop from within a Swing GUI application.  Sample
> code would be greatly appreciated.
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

There is an example under  \hsqldb\src\org\hsqldb\test\TestBase.java

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA  http://weconsultants.servebeer.com
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Re: server.main() vs server.start()

William Krick
That doesn't work in a GUI app because it locks up the GUI.



-----Original Message-----
From: IchBin [mailto:[hidden email]]
Sent: Friday, August 26, 2005 11:18 AM
To: [hidden email]
Subject: [Hsqldb-user] Re: server.main() vs server.start()


William Krick wrote:

> We currently start an hsqldb server from our Swing GUI database
> administrator tool using code that looks like this....
>
>     // create new server
>     Server server = new Server();
>
>     // start server in its own thread
>     Thread serverThread = new Thread(new Runnable() {
>       public void run() {
>         try {
>           server.main(args);
>         }
>         catch (Exception ex) {
>           System.out.println(ex);
>           ex.printStackTrace();
>         }
>       }
>     });
>     serverThread.start();
>
>
> I was wondering how you go about starting a server using server.start()
and
> stopping it using server.stop from within a Swing GUI application.  Sample
> code would be greatly appreciated.
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

There is an example under  \hsqldb\src\org\hsqldb\test\TestBase.java

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA  http://weconsultants.servebeer.com
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: server.main() vs server.start()

IchBin
William Krick wrote:

> That doesn't work in a GUI app because it locks up the GUI.
>
>
>
> -----Original Message-----
> From: IchBin [mailto:[hidden email]]
> Sent: Friday, August 26, 2005 11:18 AM
> To: [hidden email]
> Subject: [Hsqldb-user] Re: server.main() vs server.start()
>
>
> William Krick wrote:
>> We currently start an hsqldb server from our Swing GUI database
>> administrator tool using code that looks like this....
>>
>>     // create new server
>>     Server server = new Server();
>>
>>     // start server in its own thread
>>     Thread serverThread = new Thread(new Runnable() {
>>       public void run() {
>>         try {
>>           server.main(args);
>>         }
>>         catch (Exception ex) {
>>           System.out.println(ex);
>>           ex.printStackTrace();
>>         }
>>       }
>>     });
>>     serverThread.start();
>>
>>
>> I was wondering how you go about starting a server using server.start()
> and
>> stopping it using server.stop from within a Swing GUI application.  Sample
>> code would be greatly appreciated.
>>
>>
>>
>> -------------------------------------------------------
>> SF.Net email is Sponsored by the Better Software Conference & EXPO
>> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
>> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
>> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
>
> There is an example under  \hsqldb\src\org\hsqldb\test\TestBase.java
>
> --
>
>
> Thanks in Advance...
> IchBin, Pocono Lake, Pa, USA  http://weconsultants.servebeer.com
> __________________________________________________________________________
>
> 'If there is one, Knowledge is the "Fountain of Youth"'
> -William E. Taylor,  Regular Guy (1952-)
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Hsqldb-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user
>
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

Not sure how you have coded or tried to integrate it for your
application. I use this as a base and then extended the code for my own
purposes as it's own class. I use this in my applications, from my
website, with no problems. I have my GUI running in a different thread.

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA  http://weconsultants.servebeer.com
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

org.hsqldb.HsqlException: General error: java.lang.NullPointerException

William Krick
In reply to this post by William Krick
Lately, with 1.7.3.3, we've been getting this sort of error...

org.hsqldb.HsqlException: General error: java.lang.NullPointerException

Any ideas on what might be causing it?

Here's the output...


[Server@c9131c]: [Thread[Thread-1,5,main]]: checkRunning(false) entered
[Server@c9131c]: [Thread[Thread-1,5,main]]: checkRunning(false) exited
[Server@c9131c]: Startup sequence initiated from main() method
[Server@c9131c]: Loaded properties from [C:\Program Files\EIO
Rater\server.properties]
[Server@c9131c]: Initiating startup sequence...
[Server@c9131c]: Server socket opened successfully in 0 ms.
[Server@c9131c]: [Thread[HSQLDB Server @c9131c,5,main]]: Database
[index=0db=file:./db/db, alias=] did not open: org.hsqldb.HsqlException:
General error: java.lang.NullPointerException
[Server@c9131c]: [Thread[HSQLDB Server @c9131c,5,main]]:
run()/openDatabases():
[Server@c9131c]: Initiating shutdown sequence...
[Server@c9131c]: Shutdown sequence completed in 0 ms.
[Server@c9131c]: 2005-08-24 15:30:53.765 SHUTDOWN : System.exit() was not
called



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: org.hsqldb.HsqlException: General error: java.lang.NullPointerException

Fred Toussi-2
You need to to provide more information on this, especially on what changed
"recently" when this started to happen.

Fred

----- Original Message -----
From: "William Krick" <[hidden email]>
To: <[hidden email]>
Sent: 29 August 2005 18:23
Subject: [Hsqldb-user] org.hsqldb.HsqlException: General error:
java.lang.NullPointerException


Lately, with 1.7.3.3, we've been getting this sort of error...

org.hsqldb.HsqlException: General error: java.lang.NullPointerException

Any ideas on what might be causing it?

Here's the output...


[Server@c9131c]: [Thread[Thread-1,5,main]]: checkRunning(false) entered
[Server@c9131c]: [Thread[Thread-1,5,main]]: checkRunning(false) exited
[Server@c9131c]: Startup sequence initiated from main() method
[Server@c9131c]: Loaded properties from [C:\Program Files\EIO
Rater\server.properties]
[Server@c9131c]: Initiating startup sequence...
[Server@c9131c]: Server socket opened successfully in 0 ms.
[Server@c9131c]: [Thread[HSQLDB Server @c9131c,5,main]]: Database
[index=0db=file:./db/db, alias=] did not open: org.hsqldb.HsqlException:
General error: java.lang.NullPointerException
[Server@c9131c]: [Thread[HSQLDB Server @c9131c,5,main]]:
run()/openDatabases():
[Server@c9131c]: Initiating shutdown sequence...
[Server@c9131c]: Shutdown sequence completed in 0 ms.
[Server@c9131c]: 2005-08-24 15:30:53.765 SHUTDOWN : System.exit() was not
called



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user 



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Loading...