Fixed the problem - I am not sure whether this was an Felix issue
anyway... sorry!
The Solution was quite simple: Instead of opening a complete new Process
using the runtime I instantiated a org.hsqldb.Server object with the
proper parameters - and it works.
Sorry to bother you!
So long.
Tim
Richard S. Hall schrieb:
The framework doesn't do anything with Runtime of which I am aware.
-> richard
On 10/26/09 11:52, Tim Dauer wrote:
Hi List!
Here's my first contribution to this list - I tried the search of the
archives, but I had no luck in locating a thread that answers my
question. So here we go:
I am trying to start a whole new process inside a bundle. The used
Programm (the open source database hsqldb) is located in a
subdirectory of the felix runtime.
Basically I start the process using the Process class located in
java.lang:
public boolean startLocalDBProcess() {
Runtime r = Runtime.getRuntime();
Process p = null;
try {
log.info("Starting local database process...");
String dir = System.getProperty("user.dir") +
"\\commonlib\\hsqldb";
log.debug("Directory set to " + dir);
p = r.exec("java -cp " + dir + "\\hsqldb.jar
org.hsqldb.Server "
+ "-database.0 " + this.filename
+ " -port " + this.port +
" -silent false -trace true");
this.dbp = p;
log.info("Local database process started
successfully!");
} catch (IOException e) {
e.printStackTrace();
return false;
}
return true;
}
When Felix is running and I try to open a connection to that hsqldb
instance it fails with the message "socket creation error" - but the
Process is definetly running! And I can't get a connection from an
outside Database-Tool too - for example the DatabaseManager from
hsqldb: When I try to connect to the local database (note: this
DatabaseManager runs in a completely different JVM on a local or
remote system!) the same error occurs.
An Now the funny thing: Once I shutdown the Felix Runtime and I try
to connect to the database again using the exact same setup with the
DatabaseManager, I receive a valid connection! Strange isn't it?
Here is my best guess: Is it possible, that Felix sets all the files
inside the Runtime Path as write protected and the "socket creation
error" is the result of not being able to write to the file of the
hsqldb? hsqldb is a database that needs certain files to operate
correctly and i am pretty sure they are changed during the programs
execution...
Any other ideas?
Thanks ist advance!
Greets
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]