Win a copy of Spark in Action this week in the Open Source Projects forum!

Charu Krishnan

Greenhorn
+ Follow
since Oct 24, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charu Krishnan

Thanks a ton Venkat. I have been breaking my head for two days over this and finally it is resolved
Many thanks
Charu
18 years ago
I am new to servlets and just downloaded Tomcat - version 3.2.1
Since I am working on Windows 95 thought an earlier version may be better. Also working with J2EE 1.3
I set up all the environment variables and classpaths.
Now I have my test servlet under the directory c:\servlets. I am compiling it using the following command from the directory c:\servlets "javac -classpath servlet.jar;.HelloWorld.java". I get no error messages, but find no class files under this directory as expected.
If I don't specify the classpath then I get errors while compiling saying that it can't find the required libraries, so definitely when I specify the right classpath I know that it has all the libraries to compile. It is a weird problem since I don't get any error messages.
I am wondering if I need to place the file HelloWorld.java somewhere in the tomcat install_dir or is it some problem like that. Amy advice would be much appreciated.
Regards
Charu
18 years ago
Great Mark. Great score and congrats. It was worth the waiting I guess.
I am also palnning to do the web developer exam, so see you at that forum
Charu
Thanks Mark for pointing out . Yes I did forget the "NOT". This group has been great. I took the written exam last Tuesday (20th) and got my results on the 29th. I seem to remember from your posts that Mark you submitted the assignment around the same time.
Regarding the documentation. I meant realy elaborate documentation in the readme.txt, user documentation and design choices documentation. Otherwise within the code , as per the specs I just documented the functionality of the public classes in the javadoc format.
Charu
Thanks Mark for pointing out . Yes I did forget the "NOT". This group has been great. I took the written exam last Tuesday (20th) and got my results on the 29th. I seem to remember from your posts that Mark you submitted the assignment around the same time.
Regarding the documentation. I meant realy elaborate documentation in the readme.txt, user documentation and design choices documentation. Otherwise within the code , as per the specs I just documented the functionality of the public classes in the javadoc format.
Charu
Here is my score breakup
General Considerations(maximum = 58): 55 Documentation(maximum = 20): 20 GUI(maximum = 24): 19 Server(maximum = 53): 51

I must realy thank this group for all the valuable discussions. Without the group I would have been able to complete the assignment. I am particularly happy since I have no java work experience and I learnt java primarily through this project.
I realy took a very simple approach to the project, just the basics required.
- I used RMI
- Server had no GUI , just simple DOS shell
- I attached to the different modes (local and network) using command line parameters
- No client id tracking in the lock.
- My GUI had everything on one screen
- My documentation was very elaborate and I documented everything.
Thanks guys
This group is great
Charu Krishnan
I start my remote client using the following command
java -Djava.rmi.server.codebase=file:/c:\testclient/ -Djava.security.policy=mypermit3.policy -classpath . suncertify.client.FBNModel 127.0.0.1 1099
It works fine, but the instructions say not to use absolute file paths and drive names so what does one do
What do I use instaed of "file:/c:\testclient/ "
Any help from the experienced guys would be much appreciated
Thanks
Charu
I have a client class taht handles the GUI issues and two seperate database interface classes for different connection types. Both implement the same interface DataClient. This allowed me to declare a single DataClient variable in the GUI class taht is transperant to the connection type.
When I run the application in local mode I get an error "Local Database connection failed" unable to find Data_stub. Somehow my local mode is also going thru RMI which I did not intend it to and is looking for the stuff. Is there something wrong with my design.
When I run the local mode I don't start the server or anything as expected and just run my GUI with the single parameter (for local mode). Can't understand where stub is comming into teh picture. Quite confused.
Please any comments or solutions
Code:
public class DataClientLocal implements DataClient {
private Data dbInstance;
public DataClientLocal(String dbName) {

try {
dbInstance = new Data(dbName);
}
catch(Exception ex) {
System.out.println("Local Database connection failed" + ex);
}
}

Similarly class DataClientRMI for RMI implementation

public interface DataClient extends Remote
//implement all the data class methods throwning remote and database exceptions.
public class Data extends UnicastRemoteObject implements DataClient
//I do not subclass Data
In my GUI
private DataClient myData = null;
If (localmode)
myData = new DataClientLocal(%databasename);
else
myData = newDataClientRMI(%hostname , %portno);

Regards
Charu
Mark and friends,
Had a queston about creating the instance of myData in my GUI. I will d0 it with code like
try
{
myData = new Data("c:/javadevback/scjd/starting/suncertify/db/db.db");
}
So here is my doubt and this may seem basic to some
In my Data Client class my code says:
if (connection.equals("local"))
myData = new DataConnectImpl("c:/javadevback/scjd/starting/suncertify/db/db.db");
else
System.setSecurityManager(new RMISecurityManager());
myData = (RemoteData) Naming.lookup ("rmi://"+ "127.0.0.1:1099" + "/dataserver");
}
This way I can use the remote or local version and it is transperant to the user. My question is that what will creating another insatnce of database in my GUI do. When I do the locking will creating another instance create a lock on the second instance , or physically is there just one version of the database. Just confused. Also in the remote version is it Ok to do this. Can anyone tell me if what I am doing in the DataClient class and GUI is ok.
Thanks
Charu
This may seem very basic to some but here is a DOS question. What is the command in DOS to scroll back a couple of screens to be able to completely see the error message generated while running the Javac command from a DOS prompt
Regards
Charu
Thanks shall try it out
Charu
Hi,
My lock function does not seem to work as intended in seperate VMs. I am testing it by creating a lock and unlock button in my GUI that just has the lock /unlock code. I start the server and registry and that works ok. Then start one client in local mode on my machine and lock a recoed (say 12). Then open another DOS window and try to lock the same record. But it allows me to lock the same record.(It does not go into the wait code as I expected). As I understand RMI implements multithreading so I have not anywhere in my code implicitly started a new thread. Is that Ok?.
Here is my code for the lock and unlock. Your comments would be much appreciated. How to mak ethis work properly on a separate VM

Regards
Charu
[ Please use CODE tags around code -- PdH ]
[This message has been edited by Peter den Haan (edited September 26, 2001).]
I have almost completed coding and have access to just a single PC and am wondering how I can go about testing my local and remote mode using the hardware I have. Any suggestions would be appreciated. If a second PC is absolutely essential to test then I can get one.
Could anyone in a similar situation tell me how they went aboutthe testing phase
Please your comments.
Thanks
Charu
I have the table model - FBNTable and myData is an instance of data class. I am having problems with getting the correct recnum. When I click on book seats button , I try to pick up the row selected from the GUI and then do a getRecord to get the record number.
here is some code from the action performed method
int rowSelected = FBNTable.getSelectedRow();
DataInfo di = myData.getRecord(rowSelected);
int recnum = di.getRecordNumber();

The problem is that after I have done a search filter and for eg the GUI may have just 4 records, so rowSelected value is now 3 if my mouse has selected the 3rd record. Now when I press the book seats button, the getRecord method uses a value of 3 for row selected, and is therefore pointing to the wrong record. The 3rd record in the GUI could have been actually the 20th record in the database. So how can I get to the correct record to pick up its recnum. Any help will be much appreciated.
Thanks
Charu
DataClient is the client program
--------------------------------cha
public class DataClient {
RemoteData myData;
public DataClient(String connection) throws RemoteException, Exception {
System.out.println("Starting DBClient(String) constructor");
if (connection.equals("local"))
myData = new DataConnectImpl(db.db");
else
// System.setSecurityManager(new RMISecurityManager());
myData = (RemoteData) Naming.lookup("rmi://"+ "127.0.0.1:1099" + "/dataserver");
}
}

class Remote Data is the Remote Interface implementing all the Data Class Methods with Remote and DataBase Exception
class DataConnectImp is the Remote object ie middle tier and has all methods of the Data Class
Now I have a class FBNModel that basically defines the GUI . To this I want to pass the package variable mydata(declared as a package variable in DataClient), so that it is transperant wether I am using the local or network mode. But I get an error �Variable myData is not declared in FBNModel� (even though I declared it with package scope in myData). What am I doing wrong here . How have others worked around this.
The other thought was to declare myData in FBNModel as follows.
MyData = new Data(db.db). But in doing this does it not defeat the purpose of what I am trying to achieve in DataClient. In declaring myData in FBNModel will the Network Mode not wrongly get a copy of the database on the c drive, is this OK?. Just very confused.

public class FBNModel extends JFrame {
�variable declaration
public FBNModel() {
super("Fly By Night Reservation System");
try {
schema = myData.getFieldInfo();
recordCount = myData.getRecordCount();
columnCount = myData.getFieldInfo().length;
}
}
}
Thanks
Charu