Help coderanch get a
new server
by contributing to the fundraiser

Kumar Kausikasa

Ranch Hand
+ Follow
since Jun 04, 2002
Merit badge: grant badges
For More
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 Kumar Kausikasa

Only SHA and MD5 are valid one way hash algorithms. From the list all the other SHA reamining algorithms are used for symmetric and asymmetric ciphers.

Please reply if my understanding is wrong
Rajiv,

Congrats on clearing the part of SCEA. Can you please post your notes.

Also any luck with mock exams provided in SCEA links.

I am not able to download the following

Moelholm.com Applet based mock exam
Exforsys Free exam simulator
Hi,

My requirement is as follows. I have two servlet based web applications A and B. From the application A business delegate class, i have to call a servlet in application B, get the data.

I thought i would be able to do this via URLConnection. Following is the code snippet, but the call to servletB is not happening

Am i doing something wrong here ? If yes, please let me know the approach how this can be accomplished.

Thank you all for your time
14 years ago
Hi,

Merry christmas to all.

I have a quick question. I have created an ear application say A.

Inside the ear, i have a web module B. This web module is a servlet based application. (So i can access: http://hostname:port/B if it is deployed as a standalone war file to test the application).

Since it is deployed as a ear file, how can i test the deployment ?. I have deployed as exploded ear A.

Would i be able to test this http://hostname:port/A/B ?

My application.xml in META-INF looks like below

<application>

<module>
<web>
<web-uri>B.war</web-uri>
<context-root>/B</context-root>
</web>
</module>

</application>


Please let me know.

TIA





14 years ago
Hi ,
I have written a simple "HelloWorld", using RMI. The program works fine when in run both client and server on the same machine.
But when i run client on a different machine, i get connectionException.
I have checked the policy file and that seems to be ok, i mean no restriction.
Serverside rebind code:
LocateRegistry.createRegistry(2002);
Registry registry = LocateRegistry.getRegistry(2002);
registry.rebind("Hello", obj);
System.out.println("HelloImpl bound in registry");
client side look-up code:
Registry registry = LocateRegistry.getRegistry(2002);
Hello obj = (Hello)registry.lookup("//134.168.56.47:2002"+"/Hello");
String message = obj.sayHello();
System.out.println(message);
Can some one tell me what i am doing wrong ?
TIA
praveen.
20 years ago
Hi,
I want to spawn a new JVM on a remote host.Suppose there is a Java Program "A".
What i have in "A" is Tasks and hosts where it should run (host).
To be more clear
i say
Task1 -- host1
Task2 -- host2
Task3 -- host3.
These Hosts can be anywhere on the internet.
I do not know whether such a thing is possible or not ?
I apologize if it not very clear and i will clarify.
Thank you for your time.
Thanks
Praveen.
21 years ago
Hi,
Abstract classes are permitted to contain implementations of some methods while interfaces are not.
But declaring interfaces, you are giving the complete responsibility to the programmer who is implementing it.
But if you want the classes extending the abstract should have some default functionality, you can declare them in one of the methods. Then all the classes extending the abstract class will have them.
In interfaces you have implement all the methods of interface or atleast declare them , with abstract classes, there is no such need.
"These are the two mechanisms for defining a type that permits multiple implementations" -- Joshua Bloch.
HTH
praveen.
21 years ago
Thank you Maulin.
Yes, this was the link i was looking.
--praveen
21 years ago
Hi ,
I have a question about custom serialization. I read about serialization on sun'web site.
http://developer.java.sun.com/developer/technicalArticles/Programming/serialization/
According to the above document, if i want to change the way i control serialization and deserialization process , i need to overide writeObject and readObject method.
But if i want to have the total control ( including the methods used for serilaization)i need to implement Externalizable interface which has readExternal and writeExternal methods.
So i guess, in the first case it is using java standard object serialization.
But in case of Externalizable interface, i can specify my own serialization mechanism.
Please correct me, if the above statement is wrong.
If i decide to implement Externalizable, can some one provide me links where i can find examples of such implementation.
can some one throw light on the techniques and methods to improve the serialization ( example improving the speed of serialization).
Thanks very much for your time.
Thanks
Praveen.
21 years ago
Hi,
I want to calculate the rate/speed bytes are placed on the wire. This is what i have done
byte[] bytes = new byte[1024*32];
ByteArrayOutputStream byteout = new ByteArrayOutputStream(1024*100);
ObjectOutputStream objectout = new ObjectOutputStream(byteout);
long startbyte = System.currentTimeMillis();
objectout.write(bytes);
long endbyte = System.currentTimeMillis();
Is this the right way ?.
I have also found that it is not linear.
I have observed this
1024 * 32 bytes less than 1 millisec
1024 * 100 bytes 4~7 millisec
1024 * 128 bytes less than 1 millisec
1024 * 1024 bytes 134 millisec
Does someone through more light on this.
Thanks for your time.
Thanks
Praveen.
21 years ago
Hi,
Can someone tell me how to creates blocks of bytes.
I want to create blocks of size 100KB, 32KB, 128KB, 1MGB etc.
Thanks for your time.
praveen.
21 years ago
Hi,
How to calculate log values of base2. The Math.log gives the natural logarithm value.
Please help
Thanks
Praveen.
Hi ,
Does the browser has enough cache to hold the entire rules roundup of 36 questions?. I am asking this, because i took rules roundup yesterday and today. I cannot say for sure , but more than 98 % of the question were same. I think even their order is same. Does the browser is holding entire questions in the cache ?. or this is just my feeling ?
Thanks
Praveen.
Hi ,
I have a small question on creating an instance of a class at runtime , bu its name.
I load a class at runtime. I get the name of the class.Now given the name of the class how can i create an instance of the class.I get to know the name of the class only at runtime.
ClassLoader loader = new NetworkClassLoader();
loader.setPath("Testentries\\");
//create a "Class" object out of it
Class classref = loader.loadClass("Task");
I am loading the class of Name Task;
Now if i want to create an instance of class how can i do it. I do not anything about the Task before hand.
( What i was thinking was to write a method which takes the name of the class and create an instance, as we are loading it at runtime, it java runtime environment knows, how class looks like..this is my guess..but i do not have any concrete idea how can i implement that)
Please help!
Thanks very much for your time
Praveen.
21 years ago
Hi ,
I do not know whether i understand your question right or not. But this is the general idea:
Compiler Error is generated mainly when the syntax you have written is not allowed in the java language. It means java compiler is not able to genrate a .class file becuase it doe snot understand what you have written.
Runtime Error: you get Runtime errors when you actually run the program. A good example is you have written a socket program to connect a machine.If that machine is not up and runnig, then it will throw a runtime excpetion.
HTH
Praveen.