Saha Kumar

Ranch Hand
+ Follow
since Feb 23, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Saha Kumar

Hello all,

I am trying to access the weblogic console and get the following error:

[Server:002623]Connection rejected, the server is in the RUNNING state. Starting service weblogic.application.internal.BackgroundDeploymentService$WaitForBackgroundCompletion, 110 of 112. Last service weblogic.deploy.service.internal.adminserver.HeartbeatService took 4ms.

Weblogic is deployed on solaris. The error occurs when using the http protocol to access a url from a browser, https seems to at least bring up a web page. The weblogic server was running fine for many months before this happened.

Thanks in advance for your help.

-Saha
16 years ago
Hi Jim,

Thank you. I just found that there were more locks than unlocks (2 more locks). That was it. It took awhile to find.

Again thanks for your wisdom!

-Saha
Hello all,

I am getting a java.lang.IllegalStateMonitorException when trying to unlock a read lock as follows: ReentrantReadWriteLock.Readlock.unlock(). I have several threads which are locking and unlocking the readlock of a given object.

The java 5 api docs state the following:


A reentrant write lock intrinsically defines an owner and can only be released by the thread that acquired it. In contrast, in this implementation, the read lock has no concept of ownership, and there is no requirement that the thread releasing a read lock is the same as the one that acquired it. However, this property is not guaranteed to hold in future implementations of this class.



My question is why am I getting the exception on a Readlock?

Thanks in advance.

-Saha
Hello Stan,

If the thread was interrupted by the system, for example to gracefully shutdown the cache cleaning, then I wanted to terminate the thread. If it was interrupted due to the action exceeded a time limit, then I want to loop and try to execute it again.

The problem for me is not knowing the source of the interrupt. I don't want the cache cleaner to stop running forever just because it timed out.

Thanks for your wisdom.

-Saha
Hello all,

I have written some code as follows. Please look at the comments in the code.

public void run(){
while (true){
try{
Thread.sleep(SOME_TIME);
myCache.lock.writeLock().lock();
//there is code here to remove cache elements
myCache.lock.writeLock().unlock();
}catch(InterruptedException ie){
//What goes here? I have read that one should use:
//Thread.currentThread.interrupt();
//But my question is: is there another way that the
// InterruptedException can be thrown other than when the
// Thread.sleep(SOME_TIME) has timed out? Could this
// thread be interrupted by another source...for
// example the thread is being shut down gracefully by an
// application server which contains this code?
}
}
}

The thread above is a thread which is used for garbage collection of a cache. The code is loaded statically and is started by some code called from a servlet.

My problem is: if I include Thread.currentThread.interrupt();
then I don't think the thread will ever be stopped because it resides within an application server. If I don't include Thread.currentThread.interrupt();
then I think that if an InterruptedException occurs, then the cache garbage collector will stop running (which is not good either).

Please let me know some solution and a discussion of this topic.

Thanks in advance.

-Saha
Hello,

I am currently working on the J2ME certification. Along the way, a question has come up. Is there a phone call listener? I want to perform certain tasks depending on who is calling. I haven't seen any apis which would handle telephony.

Thanks.

-Saha
17 years ago
Thanks Faraz and Eduardo for the device lists. This will help quite a bit!

-Saha
17 years ago
Hello,

Can someone name a pda/cell phone and perhaps a service provider that will allow me to write, download, and successfully run J2ME applications with the following features: SMS/wireless messaging, bluetooth, and graphics? What about JavaPhone...can this be used on any devices? Any help is appreciated!

-Saha
17 years ago
Thanks, Theodore! I am now reading this book. I'm sure I will have more questions as I read.

-Saha
17 years ago
Hello All,

I want to program using J2ME to prepare for the SCMAD certification. I found the Java ME device table on the Sun website. Java ME devices If I purchase one of these devices, should I expect documentation on their software and custom apis? What kind of documentation will be supplied? What kind of documentation have you J2ME developers been using from the vendor?

Thanks in advance.

-Saha
17 years ago
Thanks Anton and Marc! I missed that. Sorry about the lack of formatting. -Saha
Hello All,

For Q4 of mock test, mock test

why is the answer B instead of A?

The question is:

What is the output of class TestCafe4Java?



Option 1:
SubCafe4Java
SubCafe4Java

Option 2:
SuperCafe4Java
SuperCafe4Java

The answer should be Option 1...correct?

Thanks.

-Saha


[HENRY: Added Code Tags. Formatted Code]
[ January 10, 2007: Message edited by: Henry Wong ]
Thanks again, Keith!
The mock exam referred to above can be found at:

mock exam

-Saha
Thanks so much, Keith. Can the same be said for other cases, such as between:

Integer, int
Float, float
etc.

For example:
Integer a = 200;
int b = 200;

a == b yeilds true because a is autounboxed to int?

Thanks in advance.

-Saha