Java .lang.illegalStateException in org.jpos.JDBMSpace

43 views
Skip to first unread message

Awadh Nandan

unread,
Nov 21, 2016, 9:13:46 AM11/21/16
to jPOS Users
Hi All,

I'm getting below exception in my application. Usually it works without any issue, But after few days it throws this exception. when I restart the application, again It works fine.
Can anyone please tell me what is causing this issue:-

java.lang.IllegalStateException: Timer already cancelled. at java.util.Timer.sched(Timer.java:397) at java.util.Timer.schedule(Timer.java:248) at org.jpos.space.JDBMSpace.<init>(JDBMSpace.java:76) at org.jpos.space.JDBMSpace.getSpace(JDBMSpace.java:104) at org.jpos.space.JDBMSpace.getSpace(JDBMSpace.java:91) at org.jpos.space.SpaceFactory.createSpace(SpaceFactory.java:140) at org.jpos.space.SpaceFactory.getSpace(SpaceFactory.java:119) at org.jpos.space.SpaceFactory.getSpace(SpaceFactory.java:107) at com.host.network.participant.SendResponse.sendResponse(SendResponse.java:187) at com.host.network.participant.SendResponse.commit(SendResponse.java:93) at org.jpos.transaction.TransactionManager.commit(TransactionManager.java:456) at org.jpos.transaction.TransactionManager.commit(TransactionManager.java:399) at org.jpos.transaction.TransactionManager.run(TransactionManager.java:256) at java.lang.Thread.run(Thread.java:724)

Environment:- Windows 2012 R2
RAM: 32 GB
JPOS version: 1.9.4
jdk :1.7.0_25


Thanks in advance for your help.

Mark Salter

unread,
Nov 21, 2016, 12:19:12 PM11/21/16
to jPOS Users


On Monday, November 21, 2016 at 2:13:46 PM UTC, Awadh Nandan wrote:
 at com.host.network.participant.SendResponse.sendResponse(SendResponse.java:187)
at com.host.network.participant.SendResponse.commit(SendResponse.java:93)

What is your code doing here?

Is it sending a response?

To what?

--
Mark

Awadh Nandan

unread,
Nov 21, 2016, 12:28:57 PM11/21/16
to jpos-...@googlegroups.com

It is sending response to Acquirer.


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/WezeCyxyp_w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/4fe33c0e-bb5e-47a3-9319-75ce4ec583e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Salter

unread,
Nov 21, 2016, 1:52:00 PM11/21/16
to jPOS Users


On Monday, November 21, 2016 at 5:28:57 PM UTC, Awadh Nandan wrote:

It is sending response to Acquirer.


Sometimes it is best not to ask....

... what exact request message was it responding to when it drew the Exception you are asking about?
Something you expected it to be, something old?

I am trying to indicate that your code and config and perhaps some log output or details about your system and setup might help your question become smart :-

http://www.catb.org/~esr/faqs/smart-questions.html#asking

--
Mark
Life is too short some days.



--
Mark

chhil

unread,
Nov 21, 2016, 9:20:59 PM11/21/16
to jpos-...@googlegroups.com

From the exception it looks like the JDMBSpace constructor is called to create the space. 
Are you trying to create the space and put some value in it or trying to access a value from it?

Can you show show us the snippet of the code that is accessing the space in your participant?
And is this space created somewhere else in code and you are simply trying to get to it to access a value from it.

-chhil


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

Awadh Nandan

unread,
Nov 28, 2016, 4:44:43 AM11/28/16
to jPOS Users
Hi Chhil,

Sorry for the late reply, I was travelling and have no access to my mail.

Below is the code snippet, here my network participant is trying to add Authorization/Financial transaction request message details to space for reversal checking in Network.
Usually network module works as expected but from last week it's started giving above exception.
If i'm restarting my system, it's started working fine.

Space sp = SpaceFactory.getSpace("jdbm:NAUTH");
String Key = compute90((ISOMsg) ctx.get(Constant.REQUEST),ctx);
sp.out(Key, (ISOMsg) ctx.get(Constant.REQUEST));


Thanks in Advance for your help.
  

On Tuesday, November 22, 2016 at 7:50:59 AM UTC+5:30, chhil wrote:

From the exception it looks like the JDMBSpace constructor is called to create the space. 
Are you trying to create the space and put some value in it or trying to access a value from it?

Can you show show us the snippet of the code that is accessing the space in your participant?
And is this space created somewhere else in code and you are simply trying to get to it to access a value from it.

-chhil

On Tue, Nov 22, 2016 at 12:22 AM, 'Mark Salter' via jPOS Users <jpos-...@googlegroups.com> wrote:


On Monday, November 21, 2016 at 5:28:57 PM UTC, Awadh Nandan wrote:

It is sending response to Acquirer.


Sometimes it is best not to ask....

... what exact request message was it responding to when it drew the Exception you are asking about?
Something you expected it to be, something old?

I am trying to indicate that your code and config and perhaps some log output or details about your system and setup might help your question become smart :-

http://www.catb.org/~esr/faqs/smart-questions.html#asking

--
Mark
Life is too short some days.



--
Mark

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

Awadh Nandan

unread,
Nov 28, 2016, 4:47:30 AM11/28/16
to jPOS Users
Hi Mark,

Sorry for late and incomplete reply.

Below is the code snippet, here my network participant is trying to add Authorization/Financial transaction request message details to space for reversal checking in Network.
Usually network module works as expected but from last week it's started giving above exception.
If i'm restarting my system, it's started working fine.

Space sp = SpaceFactory.getSpace("jdbm:NAUTH");
String Key = compute90((ISOMsg) ctx.get(Constant.REQUEST),ctx);
sp.out(Key, (ISOMsg) ctx.get(Constant.REQUEST));


Thanks in Advance for your help.

chhil

unread,
Nov 29, 2016, 11:55:46 PM11/29/16
to jpos-...@googlegroups.com

Its difficult to tell from the snippet what is causing it.
The Timers javadoc states

If the timer’s task execution thread terminates unexpectedly, for example, because its stop method is invoked, any further attempt to schedule a task on the timer will result in an IllegalStateException, as if the timer’s cancel method had been invoked.


​Basically indicating if some exception was thrown by the task.​ The task in the JDBMSpaces is the object itself and the run method which does cleanup is what gets scheduled. You could try debugging and see if you can break on an illegalstate exception in your debugger. There is a place where the gc method throws a SpaceError. Wondering if that exception gets logged to your log?

My 2 paisa : I would recommend moving to JESpace, its faster and we have also seen instances of jdbmspace getting corrupt. All our prod systems use JESapce.

​-chhil​


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages