[xgws-user] WS-Messenger UnSubcriptions

Yi Huang yihuan_at_cs.indiana.edu
Thu, 26 Apr 2007 00:50:04 -0400


This is a multipart message in MIME format.

------=_NextPart_000_010C_01C7879C.D6DB6960
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi, Alex,

Thanks for reporting this bug and providing the steps to reproduce it. =
It is
very helpful. I reproduced the problem using your test files and fixed =
it.=20

Please replace the ConsumerList.java in the wsmg.adapter package with =
the
attached file and recompile. I will updated the web site's package =
later.

Thanks,

Yi

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Yi Huang
PhD Candidate
Computer Science Dept.
Indiana University
http://www.cs.indiana.edu/~yihuan/


-----Original Message-----
From: Alex Piqueras [mailto:apm6_at_alu.um.es]=20
Sent: Wednesday, April 18, 2007 10:18 AM
To: Yi Huang
Subject: Re: [xgws-user] WS-Messenger UnSubcriptions


Sorry, yesterday I forgot to attach the example files.

First I execute the file WseServiceTest.java, and while this program is
running I execute the file WseClientTest.java. Then I get the same =
error.

Thanks,

Alex.

Alex Piqueras escribi=F3:
> Hi,
> I've revised my source code and I've found a particular situation=20
> where the program fails.
> I've written a simple java example to show this error, and also I've=20
> repeated this situation using the command line programs as following.
>
> C:\wsmg_1.76.1\java>java wsmg.demo.TestWSE_Subscriber -consumer
> localhost:19999 -producer localhost:12345 -topic msg1 -xpath=20
> "//dst[text()=3D\"all\"]"
> SubscriptionID received=3D<wse:Identifier=20
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub7_at_11768
> 09241198</wse:Identifier>
>
> SubscriptionId=3D<wse:Identifier
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub7_at_11768
> 09241198</wse:Identifier>
>
>
> C:\wsmg_1.76.1\java>java wsmg.demo.TestWSE_Subscriber -consumer
> localhost:19999 -producer localhost:12345 -topic msg2 -xpath=20
> "//dst[text()=3D\"all\"]"
> SubscriptionID received=3D<wse:Identifier=20
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub6_at_11768
> 09241198</wse:Identifier>
>
> SubscriptionId=3D<wse:Identifier
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub6_at_11768
> 09241198</wse:Identifier>
>
>
> C:\wsmg_1.76.1\java>java wsmg.demo.TestWSE_Subscriber -consumer
> localhost:18888 -producer localhost:12345 -topic msg1 -xpath=20
> "//dst[text()=3D\"all\"]"
> SubscriptionID received=3D<wse:Identifier=20
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub1_at_11768
> 09241198</wse:Identifier>
>
> SubscriptionId=3D<wse:Identifier
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub1_at_11768
> 09241198</wse:Identifier>
>
>
> C:\wsmg_1.76.1\java>java wsmg.demo.TestWSE_Subscriber -consumer
> localhost:18888 -producer localhost:12345 -topic msg2 -xpath=20
> "//dst[text()=3D\"all\"]"
> SubscriptionID received=3D<wse:Identifier=20
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub2_at_11768
> 09241198</wse:Identifier>
>
> SubscriptionId=3D<wse:Identifier
> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub2_at_11768
> 09241198</wse:Identifier>
>
>
> C:\wsmg_1.76.1\java>java wsmg.demo.WSE_DeleteSubscription -subManager
> localhost:12345 -subId Xsub1_at_1176809241198 Finished!
>
> C:\wsmg_1.76.1\java>java wsmg.demo.WSE_DeleteSubscription -subManager
> localhost:12345 -subId Xsub2_at_1176809241198 Exception in thread "main"
> xsul.invoker.DynamicInfosetInvokerException: HTTP server error 500=20
> Runtime exception when pro cessing request connection18on12345 =
body=3D"
> <html>
> <head>
> <title>Runtime exception when processing request connection18on12345:=20
> null</title>
> </head>
> <body>
> <h1>Runtime exception when processing request connection18on12345:=20
> null</h1>
> <p><pre>java.lang.NullPointerException&#13;
>        at
> wsmg.adapter.XPath.YFilterInfo.removeSubscription(YFilterInfo.java:85)
> &#13;
>
>        at
> wsmg.adapter.XPath.YFilterAdapter.handleUnsubscribe(YFilterAdapter.jav
> a:175)&#13;
>
>        at
> wsmg.processors.SubscriptionManager.removeSubscription(SubscriptionMan
> ager.java:577)&#13;
>
>        at
> wsmg.processors.SubscriptionManager.unsubscribe(SubscriptionManager.ja
> va:554)&#13;
>
>        at =
wsmg.WSMGService.executeSoapEnvelope(WSMGService.java:325)&#13;
>        at
> wsmg.xsul.XSULDedicatedBrockerService.processHttpXml(XSULDedicatedBroc
> kerService.java:180)&#13;
>
>        at
> xsul.processor.http.HttpDynamicInfosetProcessor.service(HttpDynamicInf
> osetProcessor.java:189)&#13;
>
>        at
> wsmg.xsul.XSULDedicatedBrockerService.service(XSULDedicatedBrockerServ
> ice.java:257)&#13;
>
>        at
> xsul.processor.http.HttpDynamicInfosetProcessor$HdisServlet.service(Ht
> tpDynamicInfosetProcessor.java:267)&#13
>
> ;
>        at
> xsul.http_server.impl.HttpMiniServerConnection.process(HttpMiniServerC
> onnection.java:183)&#13;
>
>        at
> xsul.http_server.impl.HttpMiniServerConnection.run(HttpMiniServerConne
> ction.java:112)&#13;
>
>        at java.lang.Thread.run(Unknown Source)&#13; </pre></p> </body> =

> </html>"
>        at
> xsul.invoker.http.HttpDynamicInfosetInvoker.invokeXml(HttpDynamicInfos
> etInvoker.java:369)
>
>        at xsul.ws_addressing.WsaInvoker.sendXml(WsaInvoker.java:318)
>        at
> =
xsul.ws_addressing.WsaInvoker.invokeMessageOptimzed(WsaInvoker.java:233)
>        at
> xsul.ws_addressing.WsaInvoker.invokeMessage(WsaInvoker.java:224)
>        at
> =
wsmg.CommonClientProcessing.unSubscribe(CommonClientProcessing.java:315)
>        at wsmg.WseClientAPI.unSubscribe(WseClientAPI.java:53)
>        at
> wsmg.demo.WSE_DeleteSubscription.main(WSE_DeleteSubscription.java:31)
>
> Thanks,
>
> Alex.
>
>
>
> Yi Huang escribi=F3:
>> Hi,
>>
>> I tested subscriptions with Topic+XPath and topic only cases with=20
>> repeated subscribe and unsubscribe, but I do not get this error. I=20
>> tested from command line as following.
>>
>> Can you try to run the subscribe and unsubscribe at the command line=20
>> and see if you still get the error?
>> Thanks,
>>
>> Yi
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -xpath "//words[text()=3D\"Hello=20
>> World\"]"
>> -epr yihuan
>> SubscriptionID received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub2_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub2_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Xsub2_at_1175824663806 Finished!
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -xpath "//words[text()=3D\"Hello=20
>> World\"]"
>> -epr yihuan
>> SubscriptionID received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub3_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub3_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Xsub3_at_1175824663806 Finished!
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -xpath "//words[text()=3D\"Hello=20
>> World\"]"
>> -epr yihuan
>> SubscriptionID received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub4_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Xsub4_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Xsub4_at_1175824663806 Finished!
>>
>> *******Following are topic-only tests
>>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -epr yihuan SubscriptionID=20
>> received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub5_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub5_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Tsub5_at_1175824663806 Finished!
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -epr yihuan SubscriptionID=20
>> received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub6_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub6_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Tsub6_at_1175824663806 Finished!
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.TestWSE_Subscriber -consumer localhost:19999 -producer
>> localhost:12346 -topic TestTopic -epr yihuan SubscriptionID=20
>> received=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub7_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> SubscriptionId=3D<wse:Identifier
>> =
xmlns:wse=3D"http://schemas.xmlsoap.org/ws/2004/08/eventing">Tsub7_at_1175
>> 8246638
>>
>> 06</wse:Identifier>
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$ java=20
>> wsmg.demo.WSE_DeleteSubscription -subManager localhost:12346 -subId
>> Tsub7_at_1175824663806 Finished!
>> [hunk /u/yihuan/a/temp/codes/xsul/messenger/java]$
>>
>> -----Original Message-----
>> From: xgws-user-admin_at_cs.indiana.edu=20
>> [mailto:xgws-user-admin_at_cs.indiana.edu]
>> On Behalf Of Alex Piqueras
>> Sent: Tuesday, April 03, 2007 11:46 AM
>> To: xgws-user_at_cs.indiana.edu
>> Subject: Re: [xgws-user] WS-Messenger UnSubcriptions
>>
>> Hi,
>>
>> A little more information. When "CleanUpThread" has to remove an old=20
>> subscription I get the same error:
>>
>> Exception in thread "Thread-3" java.lang.NullPointerException
>>         at
>> =
wsmg.adapter.XPath.YFilterInfo.removeSubscription(YFilterInfo.java:85)
>>         at
>> wsmg.adapter.XPath.YFilterAdapter.handleUnsubscribe(YFilterAdapter.ja
>> va:175)
>>
>>         at
>> wsmg.processors.SubscriptionManager.removeSubscription(SubscriptionMa
>> nager.j
>>
>> ava:556)
>>         at
>> wsmg.processors.SubscriptionManager.access$200(SubscriptionManager.ja
>> va:61)
>>
>>         at
>> wsmg.processors.SubscriptionManager$CleanUpThread.run(SubscriptionMan
>> ager.ja
>>
>> va:676)
>>         at java.lang.Thread.run(Unknown Source)
>>
>> Thanks.
>>
>>
>> Alex Piqueras escribi=F3:
>> =20
>>> Hi all,
>>>
>>> I've found another strange behavior in unsubscriptions. When a=20
>>> client subscribe and unsubscribe the same topic twice, i.e.
>>> Subscribe, Unsubscribe, Subscribe, Unsubscribe.
>>> On second unsubscription a get the next stack trace:
>>>
>>> Exception in thread "AWT-EventQueue-0"=20
>>> xsul.invoker.DynamicInfosetInvokerException: HTTP server error 500=20
>>> Runtime exception when processing request connection398on12345 =
body=3D"
>>> <html>
>>> <head>
>>> <title>Runtime exception when processing request
>>> connection398on12345: null</title>
>>> </head>
>>> <body>
>>> <h1>Runtime exception when processing request connection398on12345:=20
>>> null</h1>
>>> <p><pre>java.lang.NullPointerException&#13;
>>>        at
>>>    =20
>> wsmg.adapter.XPath.YFilterInfo.removeSubscription(YFilterInfo.java:85
>> )&#13;
>> =20
>>>        at
>>>    =20
>> wsmg.adapter.XPath.YFilterAdapter.handleUnsubscribe(YFilterAdapter.ja
>> va:174)
>>
>> &#13;
>>>        at
>>>    =20
>> wsmg.processors.SubscriptionManager.removeSubscription(SubscriptionMa
>> nager.j
>>
>> ava:548)&#13;
>>>        at
>>>    =20
>> wsmg.processors.SubscriptionManager.unsubscribe(SubscriptionManager.j
>> ava:533
>>
>> )&#13;
>>>        at
>>> wsmg.WSMGService.executeSoapEnvelope(WSMGService.java:325)&#13;
>>>        at
>>>    =20
>> wsmg.xsul.XSULDedicatedBrockerService.processHttpXml(XSULDedicatedBro
>> ckerSer
>>
>> vice.java:180)&#13;
>>>        at
>>>    =20
>> xsul.processor.http.HttpDynamicInfosetProcessor.service(HttpDynamicIn
>> fosetPr
>>
>> ocessor.java:189)&#13;
>>>        at
>>>    =20
>> wsmg.xsul.XSULDedicatedBrockerService.service(XSULDedicatedBrockerSer
>> vice.ja
>>
>> va:257)&#13;
>>>        at
>>>    =20
>> xsul.processor.http.HttpDynamicInfosetProcessor$HdisServlet.service(H
>> ttpDyna
>>
>> micInfosetProcessor.java:267)&#13;
>>>        at
>>>    =20
>> xsul.http_server.impl.HttpMiniServerConnection.process(HttpMiniServer
>> Connect
>>
>> ion.java:183)&#13;
>>>        at
>>>    =20
>>
xsul.http_server.impl.HttpMiniServerConnection.run(HttpMiniServerConnecti=
on.

>>
>> java:112)&#13;
>>>        at java.lang.Thread.run(Unknown Source)&#13; </pre></p>=20
>>> </body> </html>"
>>>        at
>>>    =20
>> xsul.invoker.http.HttpDynamicInfosetInvoker.invokeXml(HttpDynamicInfo
>> setInvo
>>
>> ker.java:369)
>>>        at xsul.ws_addressing.WsaInvoker.sendXml(WsaInvoker.java:318)
>>>        at
>>> xsul.ws_addressing.WsaInvoker.invokeMessageOptimzed(WsaInvoker.java:
>>> 233)
>>>
>>>        at
>>> xsul.ws_addressing.WsaInvoker.invokeMessage(WsaInvoker.java:224)
>>>        at
>>> wsmg.CommonClientProcessing.unSubscribe(CommonClientProcessing.java:
>>> 314)
>>>
>>>        at wsmg.WseClientAPI.unSubscribe(WseClientAPI.java:53)
>>>
>>> The subscription info sent to the broker is okey, so I think this=20
>>> error could be in broker.
>>> (I'm using WS Eventing API (WseClientAPI) and subscriptions with=20
>>> topic and xpath condition).
>>>
>>> Thanks.
>>>
>>>    =20
>>
>>
>>  =20
>
>


--
-------------------------------------------------------
Alejandro Piqueras Meseguer (apiqueras_at_dif.um.es) Dept. Ingenier=EDa de =
la
Informaci=F3n y las Comunicaciones Facultad de Inform=E1tica Universidad =
de
Murcia=20



*************************************************************************=
***
*
**
**
** WARNING:  This email contains an attachment of a very suspicious =
type.
**
** You are urged NOT to open this attachment unless you are absolutely
**
** sure it is legitimate.  Opening this attachment may cause irreparable
**
** damage to your computer and your files.  If you have any questions
**
** about the validity of this message, PLEASE SEEK HELP BEFORE OPENING =
IT.
**
**
**
** This warning was added by the IU Computer Science Dept. mail scanner.
**
*************************************************************************=
***
*



------=_NextPart_000_010C_01C7879C.D6DB6960
Content-Type: application/octet-stream;
	name="ConsumerList.java"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="ConsumerList.java"

package wsmg.adapter;

import java.util.ArrayList;
import java.util.HashMap;

import wsmg.processors.ConsumerInfo;

public class ConsumerList {
	HashMap subId2ConsumerInfo =3D new HashMap();

	ArrayList consumerInfoList =3D new ArrayList();

	boolean changed =3D true;
	int size=3D0;  //use size instead of consumerInfoList.size() to avoid =
unnecessary copy of subId2ConsumerInfo in refreshConsumerInfoList() if =
just need the size

	public void addConsumer(String subId, ConsumerInfo consumerInfo) {
		subId2ConsumerInfo.put(subId, consumerInfo);
		changed =3D true;
		size++;
	}

	public int removeConsumer(String subId) {
		Object result=3DsubId2ConsumerInfo.remove(subId);
		if(result=3D=3Dnull){
			return 0;
		}else{
		changed =3D true;
		size--;
		return 1;
		}
	}

	public ArrayList getConsumerList() {
		if (changed) {
			refreshConsumerInfoList();
		}
		return consumerInfoList;
	}
=09
	public int size(){
		return size;
	}
=09
	private void refreshConsumerInfoList(){
		consumerInfoList.clear();
		consumerInfoList.addAll(subId2ConsumerInfo.values());
		changed =3D false;	=09
	}

}

------=_NextPart_000_010C_01C7879C.D6DB6960--