Presence related exception.

3 views
Skip to first unread message

aayush

unread,
Mar 2, 2009, 4:55:07 AM3/2/09
to mobicents-public
Hello,

When i add my own self as a buddy in the presence soft client, I get
an exception as below. It is throwing an exception in the
PresenceComposition.java class.

The SIP URI of the soft phone and the buddy is identical:
aay...@rancore.com. Is this going against the OMA presence composition
policies ? Kindly assist...

Log:

15:07:31,312 INFO [PublicationControlSbb] publication:
entity=sip:aay...@rancore.com,eventPackage=presence,eTag=f69adcb8949198b6c517a624f0330e05
modified.
15:07:31,328 ERROR [PublicationControlSbb] failed to refresh
publication
javax.slee.TransactionRolledbackLocalException: Invocation resulted in
exception !
at
org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject
(SbbLocalObjectInterceptor.java:79)
at
org.mobicents.slee.sipevent.server.publication.ImplementedPublicationControlSbbLocalObjectImpl.combinePublication
(ImplementedPublicationControlSbbLocalObjectImpl.java)
at
org.mobicents.slee.sipevent.server.publication.PublicationControlSbb.getUpdatedComposedPublication
(PublicationControlSbb.java:263)
at
org.mobicents.slee.sipevent.server.publication.PublicationControlSbb.modifyPublication
(PublicationControlSbb.java:534)
at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject
(SbbLocalObjectInterceptor.java:72)
at
org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnvoid
(SbbLocalObjectInterceptor.java:113)
at
org.mobicents.slee.sipevent.server.publication.PublicationControlSbbLocalObjectImpl.modifyPublication
(PublicationControlSbbLocalObjectImpl.java)
at
org.mobicents.slee.sipevent.server.publication.SipPublicationControlSbb.onPublish
(SipPublicationControlSbb.java:222)
at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler
(SbbEntity.java:873)
at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent
(EventRouterImpl.java:933)
at org.mobicents.slee.runtime.EventRouterImpl.access$100
(EventRouterImpl.java:64)
at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run
(EventRouterImpl.java:121)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalStateException
at java.util.AbstractList$Itr.remove(AbstractList.java:433)
at
org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy.composeTuples
(PresenceCompositionPolicy.java:94)
at
org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy.compose
(PresenceCompositionPolicy.java:36)
at
org.mobicents.slee.sippresence.server.publication.PresencePublicationControlSbb.combinePublication
(PresencePublicationControlSbb.java:253)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectInterceptor.invokeAndReturnObject
(SbbLocalObjectInterceptor.java:72)


Thanks in advance

aayush


aayush

unread,
Mar 2, 2009, 6:03:50 AM3/2/09
to mobicents-public
Forgot to add:

I am using the beta4 release of the server. Have not tried beta4 cp1
yet.

Now i have deleted all the buddies from the list. The UE is publishing
its own presence only. The error is still coming frequently, almost
every 3 messages when i try to republish presence quickly..5-10 times
from the soft client.

The error log is also identical everytime:

at
org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy.composeTuples
(PresenceCompositionPolicy.java:94)
at
org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy.compose
(PresenceCompositionPolicy.java:36)
at
org.mobicents.slee.sippresence.server.publication.PresencePublicationControlSbb.combinePublication
(PresencePublicationControlSbb.java:253)




> ayush

Eduardo Martins

unread,
Mar 2, 2009, 10:58:10 AM3/2/09
to mobicent...@googlegroups.com
Seems like a concurrency issue to be investigated...

-- Eduardo

aayush

unread,
Mar 17, 2009, 9:00:32 AM3/17/09
to mobicents-public
Tried reproducing this one while debugging in eclipse. Was difficult
to reproduce, as could not achieve concurrency...but got it once
though.
Under normal load, happens everytime.

I am not sure, but i think there is some transaction related problem
and the local object invocation transaction rolls back. Is it possible
that the child sbb is invoked when the sbb entity no longer exists?
Just groping in the dark !

> >> PresenceComposition.java class.
>
> >> The SIP URI of the soft phone and the buddy is identical:
> >> aay...@rancore.com. Is this going against the OMA presence composition
> >> policies ? Kindly assist...
>
> >> Log:
>
> >> 15:07:31,312 INFO  [PublicationControlSbb] publication:
> >> entity=sip:aay...@rancore.com,eventPackage=presence,eTag=f69adcb8949198b6c517a624f0330e05
> >> modified.
> >> 15:07:31,328 ERROR [PublicationControlSbb] failed to refresh
> >> publication
> >> javax.slee.TransactionRolledbackLocalException: Invocation resulted in
> >> exception !
> >>         at
> >> org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectIntercep­tor.invokeAndReturnObject
> >> (SbbLocalObjectInterceptor.java:79)
> >>         at
> >> org.mobicents.slee.sipevent.server.publication.ImplementedPublicationContro­lSbbLocalObjectImpl.combinePublication
> >> (ImplementedPublicationControlSbbLocalObjectImpl.java)
> >>         at
> >> org.mobicents.slee.sipevent.server.publication.PublicationControlSbb.getUpd­atedComposedPublication
> >> (PublicationControlSbb.java:263)
> >>         at
> >> org.mobicents.slee.sipevent.server.publication.PublicationControlSbb.modify­Publication
> >> (PublicationControlSbb.java:534)
> >>         at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown
> >> Source)
> >>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> >> (DelegatingMethodAccessorImpl.java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectIntercep­tor.invokeAndReturnObject
> >> (SbbLocalObjectInterceptor.java:72)
> >>         at
> >> org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectIntercep­tor.invokeAndReturnvoid
> >> (SbbLocalObjectInterceptor.java:113)
> >>         at
> >> org.mobicents.slee.sipevent.server.publication.PublicationControlSbbLocalOb­jectImpl.modifyPublication
> >> (PublicationControlSbbLocalObjectImpl.java)
> >>         at
> >> org.mobicents.slee.sipevent.server.publication.SipPublicationControlSbb.onP­ublish
> >> (SipPublicationControlSbb.java:222)
> >>         at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown
> >> Source)
> >>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> >> (DelegatingMethodAccessorImpl.java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> org.mobicents.slee.runtime.sbbentity.SbbEntity.invokeEventHandler
> >> (SbbEntity.java:873)
> >>         at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent
> >> (EventRouterImpl.java:933)
> >>         at org.mobicents.slee.runtime.EventRouterImpl.access$100
> >> (EventRouterImpl.java:64)
> >>         at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run
> >> (EventRouterImpl.java:121)
> >>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> >> (ThreadPoolExecutor.java:650)
> >>         at java.util.concurrent.ThreadPoolExecutor$Worker.run
> >> (ThreadPoolExecutor.java:675)
> >>         at java.lang.Thread.run(Thread.java:595)
> >> Caused by: java.lang.IllegalStateException
> >>         at java.util.AbstractList$Itr.remove(AbstractList.java:433)
> >>         at
> >> org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy­.composeTuples
> >> (PresenceCompositionPolicy.java:94)
> >>         at
> >> org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy­.compose
> >> (PresenceCompositionPolicy.java:36)
> >>         at
> >> org.mobicents.slee.sippresence.server.publication.PresencePublicationContro­lSbb.combinePublication
> >> (PresencePublicationControlSbb.java:253)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>         at sun.reflect.NativeMethodAccessorImpl.invoke
> >> (NativeMethodAccessorImpl.java:39)
> >>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> >> (DelegatingMethodAccessorImpl.java:25)
> >>         at java.lang.reflect.Method.invoke(Method.java:585)
> >>         at
> >> org.mobicents.slee.container.deployment.interceptors.SbbLocalObjectIntercep­tor.invokeAndReturnObject

Eduardo Martins

unread,
Mar 17, 2009, 9:28:16 AM3/17/09
to mobicent...@googlegroups.com
Hi Aayush, the problem is:


Caused by: java.lang.IllegalStateException
      at java.util.AbstractList$Itr.remove(AbstractList.java:433)
      at org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy.composeTuples
(PresenceCompositionPolicy.java:94)

Looking at the code I think I found the issue:

        // process all from tuples trying to match each with othertuples
        for (Iterator<Tuple> tuplesIt = tuples.iterator(); tuplesIt.hasNext(); ) {
            Tuple tuple = tuplesIt.next();
            for (Iterator<Tuple> otherTuplesIt = otherTuples.iterator(); otherTuplesIt.hasNext(); ) {
                Tuple otherTuple = otherTuplesIt.next();
                Tuple compositionTuple = compose(tuple, otherTuple);
                if (compositionTuple != null) {
                    // the composition has a result
                    result.add(compositionTuple);
                    // remove the tuples to not be iterated again
                    tuplesIt.remove();
                    otherTuplesIt.remove();
                }
            }
        }

After otherTuplesIt.remove(); there should be a break; otherwise the inner for can continue and invoke  tuplesIt.remove(); again

Try the patch attached.

-- Eduardo
patch-compositionpolicy.txt

aayush

unread,
Mar 17, 2009, 9:37:28 AM3/17/09
to mobicents-public
Okay...i will try this out and report back...

> Hi Aayush, the problem is:
>
> Caused by: java.lang.IllegalStateException
>       at java.util.AbstractList$Itr.remove(AbstractList.java:433)
>       at
> org.mobicents.slee.sippresence.server.publication.PresenceCompositionPolicy­.composeTuples
> (PresenceCompositionPolicy.java:94)
>
> Looking at the code I think I found the issue:
>
>         // process all from tuples trying to match each with othertuples
>         for (Iterator<Tuple> tuplesIt = tuples.iterator();
> tuplesIt.hasNext(); ) {
>             Tuple tuple = tuplesIt.next();
>             for (Iterator<Tuple> otherTuplesIt = otherTuples.iterator();
> otherTuplesIt.hasNext(); ) {
>                 Tuple otherTuple = otherTuplesIt.next();
>                 Tuple compositionTuple = compose(tuple, otherTuple);
>                 if (compositionTuple != null) {
>                     // the composition has a result
>                     result.add(compositionTuple);
>                     // remove the tuples to not be iterated again
>                     tuplesIt.remove();
>                     otherTuplesIt.remove();
>                 }
>             }
>         }
>
> After* otherTuplesIt.remove();* there should be a *break;* otherwise the
> inner for can continue and invoke * tuplesIt.remove();* again
>
> Try the patch attached.
>
> -- Eduardo
>
>
>
>
>
> On Tue, Mar 17, 2009 at 1:00 PM, aayush <abhatnagar192...@gmail.com> wrote:
>
> > Tried reproducing this one while debugging in eclipse. Was difficult
> > to reproduce, as could not achieve concurrency...but got it once
> > though.
> > Under normal load, happens everytime.
>
> > I am not sure, but i think there is some transaction related problem
> > and the local object invocation transaction rolls back. Is it possible
> > that the child sbb is invoked when the sbb entity no longer exists?
> > Just groping in the dark !
>
> >> >> PresenceComposition.java class.
>
> >> >> The SIP URI of the soft phone and the buddy is identical:
> >> >> aay...@rancore.com. Is this going against the OMA presence composition
> >> >> policies ? Kindly assist...
>
> >> >> Log:
>
> >> >> 15:07:31,312 INFO  [PublicationControlSbb] publication:
> >> >> entity=sip:aay...@rancore.com <sip%3Aaay...@rancore.com>
>
> ,eventPackage=presence,eTag=f69adcb8949198b6c517a624f0330e05>> >> modified.
>  patch-compositionpolicy.txt
> 2KViewDownload

aayush

unread,
Mar 17, 2009, 12:03:40 PM3/17/09
to mobicents-public
It works well now..

aayush !

Eduardo Martins

unread,
Mar 18, 2009, 5:17:25 AM3/18/09
to mobicent...@googlegroups.com
Cool, I will open an issue with the patch and commit.

-- Eduardo
Reply all
Reply to author
Forward
0 new messages