Arul Jose

Ranch Hand
+ Follow
since Jan 14, 2005
Merit badge: grant badges
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 Arul Jose

I could not get japanese characters displayed in my jsp. I have set content type as UTF 8.

<%@page contentType="text/html;charset=UTF-8"%>

I am not manipulating anything.

I am getting the japanese string in a request parameter and I am just printing it.

Any help would be great.


12 years ago
How bigger will this pool get? Any parameters which decide this? Any way to control this thru code?

Arul Jose.
15 years ago
While the following code is run in a loop, is there a possibility of memory leak? Has any of you come accross this before?

16 years ago
I am doing a system call using Runtime.execute() method. I am getting the following error. Has anyone of you come accross this error. What did you do to rectify? Cannot allocate memory|
at java.lang.UNIXProcess.<init>(|
at java.lang.ProcessImpl.start(|
at java.lang.ProcessBuilder.start(|
at java.lang.Runtime.exec(|
at java.lang.Runtime.exec(|
at java.lang.Runtime.exec(|
at export.StudioRobot.runRobot(Unknown Source)|
at export.ImageExportScheduler.executeTask(Unknown Source)|
at taskengine.internal.SchedulerBean.executeTask(|
at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)|
at sun.reflect.DelegatingMethodAccessorImpl.invoke(|
at java.lang.reflect.Method.invoke(|
at mfw.bean.BeanProxy.invoke(|
at $Proxy3.executeTask(Unknown Source)|
at taskengine.internal.ScheduleExecutor.executeNextTask(|
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(|
at java.util.concurrent.ThreadPoolExecutor$|
[ July 31, 2007: Message edited by: Arul Jose ]
16 years ago
I am creating two thread objects and making them print from 0 to 9. I am setting different priorities. But the priorities doesn't show up in the output at all. I would like to know why.

the output is always :

Call Order : 1 iteration : 0
Call Order : 2 iteration : 0
Call Order : 1 iteration : 1
Call Order : 2 iteration : 1
Call Order : 1 iteration : 2
Call Order : 2 iteration : 2
Call Order : 1 iteration : 3
Call Order : 2 iteration : 3
Call Order : 1 iteration : 4
Call Order : 2 iteration : 4
Call Order : 1 iteration : 5
Call Order : 2 iteration : 5
Call Order : 1 iteration : 6
Call Order : 2 iteration : 6
Call Order : 1 iteration : 7
Call Order : 2 iteration : 7
Call Order : 1 iteration : 8
Call Order : 2 iteration : 8
Call Order : 1 iteration : 9
Call Order : 2 iteration : 9

I expected something like the following

Call Order : 1 iteration : 0
Call Order : 2 iteration : 0
Call Order : 2 iteration : 1
Call Order : 1 iteration : 1
Call Order : 2 iteration : 2
Call Order : 2 iteration : 3
Call Order : 1 iteration : 2

that is i expected more priority for the second thread.
16 years ago
i think he says 'start with a lang like c or lisp then come to java'.

i have talked about it here.

[ March 01, 2007: Message edited by: Arul Jose ]
[ March 01, 2007: Message edited by: Arul Jose ]
16 years ago
Hi Ranchies,

Is there a way to keep the code for one class in multiple files?

say like having the code for in,, etc.

arul jose
16 years ago
Dear Seema,

There are already very popular books for SCJP preparation. What have you done special to make your book stand out. Please tell.

First of all thanks for your answers.

wait() releases the lock so that some other thread can grab the lock, do whatever the original thread is waiting for

1. so, only when the current thread is waiting for some other thread's execution, the wait() method is called?

2. so the method wait() waits till the current thread gets a notification?

3. if it doesn't get notified, it will keep waiting?

4. when a thread says notify() there is no guarantee that the thread which we are expecting will get notified right? so if the original thread gets a notify from some other unexpected thread, the original thread may run before the 'other thread'(which it is waiting for to finish some operation) finishes operation right? so what is the point in saying wait()?

to explain thread A is saying wait() expecting B to say notify(). what if some other thread C says notify() before B says notify() and A gets notified?

why should b release its lock before finishing operations?

in the given code, when the thread comes to line 9, it has already got the lock of b, why should it then wait for the lock of b?

It must be done correctly. And it must be used as it was intended.

Henry, do you mean, it is the responsibility of the 'coder' to be careful ?

We have two methods here one is synchronized and the other is not. When an object of this class is locked, only one thread can access method1() but any number of threads can access method2(). while method1() runs, method2() also can simultaneously change the value of i which is used by method1() (method1 will see a different value for i, since it was altered by method2), since it is accessible by any number of threads. Is this not making the purpose of 'synchronized' void?
[ July 19, 2006: Message edited by: Arul Jose ]
Kindly see the following code.

when the line "Waiting for b to complete ..." is printed, already the lock for b is gotten. Am I right? why should the current thread wait to get b? Only after getting the lock on b the synchronized(b) block can be entered isn't? Why after getting b's lock, the thread should wait?
I could not come to a conclusion why the class TestInterfaceMember is not compiling. Please see if you can help.

[aruljose@aruljose javatry]$ javac -classpath ./classes:. cannot find symbol
symbol : class pkg
location: class test
class TestInterfaceMember implements test.pkg.I
^ interface expected here
class TestInterfaceMember implements test.pkg.I
^ cannot find symbol
symbol : variable i
location: class TestInterfaceMember
3 errors
[aruljose@aruljose javatry]$ ls classes
[aruljose@aruljose javatry]$ ls classes/test/
[aruljose@aruljose javatry]$ ls classes/test/pkg/

17 years ago