-
October 6th, 2009, 07:31 PM
#1
problems to trace the data adapter
hi all, me again 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
dbPassass
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.
-
October 7th, 2009, 11:08 AM
#2
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 configDir argument 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.
-
October 7th, 2009, 09:17 PM
#3
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
Later i see the logging configuration of lightstreamer.
thanks for your help
Similar Threads
-
By Alessandro in forum Adapter SDKs
Replies: 12
Last Post: May 22nd, 2023, 01:42 PM
-
By intelsmart in forum Adapter SDKs
Replies: 1
Last Post: April 11th, 2012, 09:03 AM
-
By Alessandro in forum Adapter SDKs
Replies: 4
Last Post: October 24th, 2011, 09:33 AM
-
By ericrosevear in forum General
Replies: 3
Last Post: June 18th, 2008, 10:41 AM
-
By Hanumant in forum Adapter SDKs
Replies: 3
Last Post: January 29th, 2008, 03:42 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 02:00 AM.
Bookmarks