Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Monmohan Singh

Ranch Hand
+ Follow
since Aug 02, 2002
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 Monmohan Singh

Deadlocks have to be managed by application programmer and can be prevented by
techniques like resource ordering (acquiring and releasing locks in the same order) etc
Hi , Please look at this code
public class TestThreadJoin {
//private MyThread t=new MyThread();
final Thread main=Thread.currentThread();
public static void main(String args[]) throws Exception{

Thread t =new Thread(){
public void run(){
System.out.println("Run for some time");
int i=0;
try {
} catch (InterruptedException e) {


System.out.println("Checking if the thread is live");
System.out.println("Main thread Over>>>>");


It throws an IllegalMonitor exception

I can't understand the reason esp when replacing the same code with
join(0) works
thread.join throws an interrupted exception?
I can't think of a way to handle it. Now the reason a join is called is because i don't want the parent thread to start execution till the child has finished execution. so what do i do in case the join method throws exception
I am writing a test which has following steps

Get a page - this is successful

Simulate click of an image on the page.- when i look at the source code of the page it basically means executing a javscript function


How do I simulate this?

appreciate any help
16 years ago
in case of deprecation, the compiler would warn.. so that is fine
.. the assert keyword was introduced in 1.4?
and in case of methods which are removed , if the code compiles on 1.3 and run on 1.4, shouldn't it give an error?
16 years ago
i think i messed up..
here is what happens

The code is build on 1.3.09 ..
but run on 1.4.02

If performance of reflection is the reason, why should the code not be build on 1.4.02.. what can be other reasons?
16 years ago
Many frameworks, I have seen document the fact that their source code should be build on say jdk1.4.2 , but once compiled and jared, it runs on jdk1.3.x
I am not able to understand the logic .. can anyone help?
16 years ago
well that's what I am faced with.. Rose and even TogetherJ give way too much detail..
I just joined a team of developers working on a product which has a huge code base. However the documentation of the design related to the components in pretty negligble. I need to create high level design documents for each of the subsystem/components in the product
wanted to hear from the people here as to their experience and what are the ways to approach this problem
"But the receptionist needs to continue answering calls on the original port, so the caller is forwarded to a new port, leaving the original free to receive more calls."

I don't think that this forwarding to new port happens.. because in this case when you look at the Socket created by accept call this should show a different value for the destination port which is not the case.
Also, what if firewall doesn't allow opening new ports on the machine?
Sun's tutorial says that the accept call returns a socket with new port so that the server can still accept connections on the port to which it was bound ( eg port 80 for HTTP Server).
I went thru some material and a brief glance at Stevens book and could not find this thing elaborated.
an IP packet is represented by {protocol, source IP address, source port, destination IP address,
destination port}
and as long as one of this is different the packet can be differentiated .
also the packets will be in queue on the port where the server is listening..
Also in case of new port there can be issues with firewall?
Looks like the question was hazy
whatI meant was -
Any decently sized J2EE application has need to read configuration. People do it in property files/XML data base etc,.but I wanted to know if there is a standard way and the benefits/drawbacks of these approaches
Is there a standard way to manage configurations in a J2EE application. The configuration I am talking about is the properties which drive an application
If the communication is java to java then
Using MDB's etc should take care of scalability in terms of processing the messages , since the conatainer pools them.
Do the MOM products have lot of othe features which makes them worth the money?