naitsir
hi all, me again :p now i have a little problem
well, i developed a small application that connect with the database, for now the connection parameters are static, but i try to read this parameters from a txt file
db.txt
--------
server:localhost
dbName:db
dbUser:user
dbPass:pass
when i try to read this values i can't connect to the DB.
the db.txt and java classes are in the same folder. to open the file i do this:
File f = new File("db.txt");
...
brInput = new BufferedReader( new FileReader( f ) );
while(brInput.ready()){
line = brInput.readLine().trim();
//i load the variables here
...
}
when compiled an execute this code from eclipse all works fine, but when i put the complile classes into lightstreamer server nothing happneds.
so, to see where the problem occurs i try to trace the compiled classes.
i try to put log4j into mi class, and again, all works fine on eclipse or command line, but when i put the compiled class into lightstreamer server nothing happends.
i think the problem is to open the file db.txt or open de file log4j.properties (to trace the class)
how can i solve this???
see you.
Dario Crivelli
There might be a difference in the default directory between the Eclipse and the direct launch.
If you use files in your adapter, you should lean on the configDirargument you receive in the init call.
It contains a reference to the directory in which your Adapter Set is deployed (that is, in which adapters.xml is located).
If you want to add log4j logging to your adapter only for testing purpose,
you could take advantage of the Server's own logging configuration file and extend it.
naitsir
i was doing some tests, and i managed to identify the execution path of the classes
LS_SERVER\bin\windows\ for windows and LS_SERVER\bin\unix-like\ for linux.
so, when i try to read a file, i need to put the file in this directory.
with this i could also run the log4j :Smile_Ag:
Later i see the logging configuration of lightstreamer.
thanks for your help