asad ali

+ Follow
since Dec 12, 2000
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by asad ali

I am trying to create a XML document using JAXP 1.1 DOM tree with namespace. When I add a new element I use the method document.createElementNS(..). Once the whole DOM tree is created, I wish to write the DOM tree to a file. I am using Transformer class to write to file. What should I do to generate a XML file with namespaces in it ? If I have to use xsl to generate such a file, what should be the content of the xsl ?
Following is true for Red Hat Linux 7.0.
After starting the rmiregistry, execute the following command from command line
ps -ef | grep java
You should list of processes that are similar to
Kill the first of these processes and that should kill your rmiregistry.
CAUTION:If you have any other java process like client and/or server running, then you need to stop these processes before you run the 'ps' command.
23 years ago
You are declaring two dimensional array of String which is referenced by retRecords. However, you are not defining the size of the array.
Your code is failing at the following statement :
retRecords[recsFound] = searchResults[i].getValues();
searchResults[i].getValues() returns an array of Strings but the size of your two dimensional array is not defined.
Hence you need to define the size like :
retRecords = new String[searchResults.length][searchResults[0].length];
before the 'for' loop.
Looks like you are returning an array of array from searchFlights method. Please show the code where you are creating and populating the array of array in the method. It will help identify the problem.
Create all your packages under suncertify. If you decide to extend data class instead of modifying it, then place the new class in suncertify.db package. It would be easier also to keep client and server classes under suncertify. e.g. suncertify.client etc.
Moreover, when binding, use the full url.
e.g. Naming.rebind("Hostname ortNumber/Data", new Data());
This is important if you start your rmiregistry in a port other than 1099.
23 years ago
One way to handle your request is to lookup for the server again when the client receives the 'server not found error'. Your client executes the methods on the server by using the stub. When your server goes down, the stub becomes invalid. If you lookup for the server again, the client will receive a valid stub value.
23 years ago
Look at the constructor of the Data class that reads the records from the data file. It only reads binary data.
One of the evaluation criteria for the exam is object oriented programming. The assignment can be done with minimum interfaces. But for a good programming technique, it is essential that interfaces to be used where suitable. This decision you have to make per your judgement. Too many interfaces also make the program difficult to follow. Hence follow the OO programming technique to create interfaces for your assignment.
Hi Linda,
It is exciting to see your book as a giveaway this week. Among all the patterns one of my favorite is factory pattern. It was helpful to me in solving the assignment for Java developer certification. To be precise, I used the pattern to connect my client to the database in local or network mode. In this case, the client never knew what mode it is connected to the database in, and hence was very flexible. The factory enabled me to generate objects depending upon the parameter passed to it.
I had used menu on the client GUI to select the mode. This way the client can change the mode without exiting the GUI.
You should use multi threading for chat as RMI does not guarantee multithreading. Multithreading may be working in your environment, but it may not always work in other environments. Moreover, you should use RMI callback instead of clients connecting to server periodically to get new messages.
Check the RMI spec for multithreading
23 years ago
I tried your application on my PC and it works.
Following is my environment
1. Windows NT workstation 4.0
2. Using JRun 3.0 for servlet
3. Using JDK1.2.2
4. My zip file size is 4,965 KB
I commented the line
res.setBufferSize(data.length + 10240);
in your servlet's doPost method as it is not recognized method for response interface.
23 years ago
The way to install RMISecurityManager in your application is
System.setSecurityManager(new RMISecurityManager());
23 years ago