IllegalStateException in SpaceUtil -Timer Already Cancelled

28 views
Skip to first unread message

gona

unread,
Jan 29, 2009, 5:50:09 AM1/29/09
to jPOS Users
HI,

Actually i already posted this issue in JDBM open discussion.Then
trumpetinc covey better to contact JPOS guys.

After Restarting Server i am getting the following exception
regularly.

Exception:java.lang.IllegalStateException: Timer already cancelled.
I am using JDBM0.20Dev Jar and JPOS1.5.Actually i have DB and LG
Files.My application will talk with these files using SpaceUtil class
of Jpos.

Is it's issue in JDBM or JPOS.

Following is the Stack Trace of Exception.

INFO | jvm 1 | 2009/01/22 08:49:39 | java.lang.IllegalStateException:
Timer already cancelled.
INFO | jvm 1 | 2009/01/22 08:49:39 | at java.util.Timer.sched
(Timer.java:354)
INFO | jvm 1 | 2009/01/22 08:49:39 | at java.util.Timer.schedule
(Timer.java:222)
INFO | jvm 1 | 2009/01/22 08:49:39 | at org.jpos.space.JDBMSpace.<init>
(JDBMSpace.java:73)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
org.jpos.space.JDBMSpace.getSpace(JDBMSpace.java:101)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
org.jpos.space.JDBMSpace.getSpace(JDBMSpace.java:88)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
org.jpos.space.SpaceFactory.createSpace(SpaceFactory.java:166)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
org.jpos.space.SpaceFactory.getSpace(SpaceFactory.java:144)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
org.jpos.space.SpaceFactory.getSpace(SpaceFactory.java:132)
INFO | jvm 1 | 2009/01/22 08:49:39 | at
com.iteration3.atom.util.CBSUtil.getStan(CBSUtil.java:45)

We have a class JDBMSpace in JPOS.From this class it's calling to the
Timer class.

So please advice me how i can resolve this issue.


Thanks in Advance.
Regards,
Suman

Mark Salter

unread,
Jan 29, 2009, 6:30:26 AM1/29/09
to jPOS Users


On 29 Jan, 10:50, gona <gona.su...@gmail.com> wrote:

> After Restarting Server i am getting the following exception
> regularly.
Can you expand on the detail of why and how you are "Restarting
Server" please? I did suggest this might be needed on your
sourceforge issue?

> Is it's issue in JDBM or JPOS.
I think this is an application issue, so not jPOS and certainly not
JDBM.

You are trying to reuse a JDBMSpace (and DefaultTimer) that has
already been cancelled or garbage collected. Which 'server' are you
using and is it possible that the DefaultTimer singleton is persisting
and *should* be garbage collected as part of your 'restart'?

--
Mark

gona

unread,
Jan 29, 2009, 7:24:17 AM1/29/09
to jPOS Users


I am using Q2 And Jetty.Q2 as App Server and Jetty as Web Server.

Why to Restart Server?
To Update my Production Environment.

How I am Restart My Server?
I am using Wrapper and Script to Restart the server.
I will attach my scripts to your mailID.

What ever your mentioning it might be the case in my application.In my
case i am calling in different classes.Means in one component it
called and at the same time it's calling from the other component also
Rt?

Mark Salter

unread,
Jan 29, 2009, 8:22:07 AM1/29/09
to jpos-...@googlegroups.com
gona wrote:
>
>
> I am using Q2 And Jetty.Q2 as App Server and Jetty as Web Server.
>
> Why to Restart Server?
> To Update my Production Environment.

I really want to know what your 'server' was and how it was running, was
being stopped and restarted. I think you may have given me enough clues...

>
> How I am Restart My Server?
> I am using Wrapper and Script to Restart the server.
> I will attach my scripts to your mailID.

From the files sent directly - I can now see you are using "Java Service
Wrapper" (JSW) to have your server running as a windows service or a
daemon process? The script passed is 'sh', so you are running under
cygwin or a unix environment?

I don't know if we need to know, but it might be useful to know your
operating system - my apologies if this turns out not to be the case!

>
> What ever your mentioning it might be the case in my application.In my
> case i am calling in different classes.Means in one component it
> called and at the same time it's calling from the other component also
> Rt?

Sorry I can't see what you are saying here.

I think your restart is failing because the Timer singleton that is
instanced out of the call to DefaultTimer.getTimer has had it's cancel
method called as part of the shutdown/stop, but it still exists as you
restart and thus issues the message you are seeing.

Perhaps we should be setting the reference to this Timer to be null at
shutdown and are not?

Perhaps you need to stop the whole service (and thus the JVM), rather
than just the server that is running inside the JVM that JSW provides?

This might be where your operating system matters...

... does your stop command stop the JVM, or just the Q2 server running
inside it?

On *windows*, doing a :-

net stop yourservicename

followed by

net start yourservicename

might work, as I would hope everything is closed and restarted.

I'm afraid my script reading and comprehension needs work; so cannot see
what is actually happening for you. Perhaps your JSW output combined
with your Q2 log might hold the clues?


--
Mark

gona

unread,
Jan 31, 2009, 2:19:14 AM1/31/09
to jPOS Users
Mark,

I ran the same script previously also.I didn't face any problems.But
recently only i gave problem.Tried to reproduce the same in my Testing
Environment.
My Production Environment is in Solaris.
You are suggesting to do like as
"'setting the reference to this Timer to be null at
shutdown and are not?''

Mark Salter

unread,
Jan 31, 2009, 8:29:57 AM1/31/09
to jpos-...@googlegroups.com
gona wrote:

> I ran the same script previously also.I didn't face any problems.But
> recently only i gave problem.Tried to reproduce the same in my Testing
> Environment.

I think that when this issue occurs, the components running within your
JVM have not stopped cleanly and thus the JVM may not have exited. If
this is the case, then the Timer object that is hanging around also
remains and causes the issue you are seeing at restart.

> My Production Environment is in Solaris.

Ok, and your test environment also Solaris?

> You are suggesting to do like as
> "'setting the reference to this Timer to be null at
> shutdown and are not?''

Can you first confirm that the JVM has cleanly exited after your stop
and *before* your start? The JSW website indicates that a restart
option is available; either way, can you confirm that you see:-

jvm n | stop(0)

in your JSW output?

If you could also check that every deployed jPos component also stops
cleanly?

If you can confirm that the JVM is not exiting completely or that a jPos
component is not stopping, then we should seek to address the reason for
this first; as it may be something specific to your application.

Can you post your JSW and Q2 logs please? If you can look keep the size
as small as possible?

Does this issue occur if you start, wait, restart?
Does your application need to be running and doing it's work for a while
for the issue to occur?

The information should be in your logs, we just need to find the detail
needed.

--
Mark

Reply all
Reply to author
Forward
0 new messages