-
April 20th, 2010, 12:05 PM
#1
Java to .NET port MessengerDemo
Hi.,
I ported the Java Messenger demo Data- and MetaDataAdapters to a .NET version. When I subscribe to the Adapters my buddylist is updated correctly on all subscribed sessions.
However, when I try to send a new message to one of the subscribed buddies the lightstreamer server console gives me a very weird error.
20.apr.10 12:12:48,986 < INFO> Sending message to session: S300999a1064e47b0T120
6726 from 127.0.0.1:63303
20.apr.10 12:12:48,987 <ERROR> Got exception for new message Messages[1] in session
S300999a1064e47b0T1206726: Session error: Unsupported function
Can you please provide me with some insights on how to resolve this error, or where to look for the solution.
Because right now I really don’t know where to look anymore. I even tried to add the Console.WriteLine on every method
In my MetaDataProvider, but after the web client calls engineref.sendMessage() the MetaDataAdapter .NET method “NotifyUserMessage()” never gets called.
Thanks in advance
-
April 20th, 2010, 02:40 PM
#2
The "Unsupported function" message is the default no-op behavior for NotifyUserMessage that is defined in the MetadataProviderAdapter class.
This class is supplied in LS library as a possible base class for a custom Metadata Adapter.
The sample LiteralBasedProvider also inherits from this class.
Is it possible that your Metadata Adapter class does not override NotifyUserMessage properly?
You can ensure that by removing any dependance from MetadataProviderAdapter.
-
April 20th, 2010, 02:48 PM
#3
Hi,
well i indead use the LiteralBasedProvider as my class inheritance. following is my ported from java implementation of the NotifyUserMessage method:
public override void NotifyUserMessage(String user, String session, String message)
{
Console.WriteLine("NotifyUserMessage");
try
{
if (message == null)
{
//logger.warn("Null message received");
throw new NotificationException("Null message received");
}
//Split the string on the | character
//The message must be of the form "SDNINBOXNOTIFICATIONSERVER|fromId|toId|messag e"
Char[] SplitChar = "|".ToCharArray();
String[] pieces = message.Split(SplitChar);
Console.WriteLine("New incoming data: " + "User: " + user + " session: " + session + " message: " + message);
SetupConnectionPipe();
HandleNewIncomingInboxData(pieces, message, user);
}
catch (Exception Error)
{
Console.WriteLine("what fsdfsdfs: " + Error);
}
}
But Console.WriteLine doesn't get called, hence nothing is called in this method. The only thing i see is dat the Constructor of my class wich inherits LiteralBasedProvider and also the overrided Init method gets called on execution. When i press the button with executes the sendMessage() method the console provided me with the Session error, error.
Grtz,
Micha
-
April 21st, 2010, 09:16 AM
#4
I can't replicate the issue.
I wonder whether your use of String instead of string in the method declaration may have any platform-dependent issue.
I still suggest you trying to remove the inheritance from MetadataProviderAdapter (hence, from LiteralBasedProvider),
so that any overriding issue is transferred at compilation level.
-
April 21st, 2010, 09:30 AM
#5
Hi,
i tried both of the methods. Replaced String with string in the method declaration but no success. I removed the inheritance from the LiteralBasedProvider but i got the same message on the lightstreamer server console. So it looks like he doesn't understand that he needs to call my MetaDataAdapter. Can it be an issue that i use a standalone server launcher, same as in the PortfolioDemo? The weird thing is, that on startup of both the consoles the constructor and the overrided Init method of the MetaDataAdapter i wrote gets called.
Should i post more code?
-
April 21st, 2010, 11:54 AM
#6
The standalone Remote Server launcher, as provided in our examples, directly creates an instance of the Metadata Adapter,
so, if you properly extended it to use your class, it should not cause problems.
However, if there is a configuration issue, a different Metadata Adapter may be attached by the Server.
As a first step, please show us the Server log, after performing the following settings:
- set the com.lightstreamer.adapters.remote category to DEBUG level;
- ensure that the LightstreamerLogger.init category is at INFO level.
-
April 21st, 2010, 12:16 PM
#7
After making the requested settings to the log this is what i got in the console after trying to send a message to another online buddie:
21-apr-10 13:19:40,997 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 8 |Serving request: /lightstreamer/control.js --> LS_session=Sff17d61f15397ecaT1915608&LS_table=2&LS _win_phase=8&LS_op=add&LS_req_phase=341&LS_mode=DI STINCT&LS_id=im_Gast223&LS_schema=fromNick%20toNic k%20message&LS_snapshot=30&LS_unique=3& from 127.0.0.1:55395
21-apr-10 13:19:40,998 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 8 |Controlling session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55395
21-apr-10 13:19:41,000 |DEBUG|emote.request_reply.RequestSender|SERVER POOLED THREAD 8 |Sending request 30000012820171d81: 'SUB|S|im_Gast223'...
21-apr-10 13:19:41,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: '1271848781002|EOS|S|im_Gast223|S|30000012820171d8 1'...
21-apr-10 13:19:41,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: '1271848781002|UD3|S|buddy_list|S|20000012820171d8 1|B|0|S|key|S|im_Gast223|S|command|S|ADD'...
21-apr-10 13:19:41,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: '30000012820171d81|SUB|V'...
21-apr-10 13:19:41,013 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 5 |Serving request: /lightstreamer/control.js --> LS_session=Sff17d61f15397ecaT1915608&LS_table=3&LS _win_phase=8&LS_op=add&LS_req_phase=342&LS_mode=CO MMAND&LS_id=buddy_list&LS_schema=command%20key&LS_ snapshot=true&LS_unique=4& from 127.0.0.1:55401
21-apr-10 13:19:41,014 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 3 |Controlling session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55401
21-apr-10 13:19:42,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:42,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:43,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:43,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:44,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:44,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:45,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:45,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:46,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:46,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:47,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:47,002 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:48,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:48,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:49,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:49,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:49,645 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 2 |Serving request: /lightstreamer/send_message.js --> LS_session=Sff17d61f15397ecaT1915608&LS_message=SD NINBOXPUSHER%7CGast143%7Cim_Gast223%7Choi&LS_req_p hase=0&LS_sequence=messages&LS_max_wait=5000&LS_un ique=5& from 127.0.0.1:55389
21-apr-10 13:19:49,646 |INFO |LightstreamerLogger.requests |SERVER POOLED THREAD 2 |Sending message to session: Sff17d61f15397ecaT1915608 from 127.0.0.1:55389
21-apr-10 13:19:49,649 |ERROR|LightstreamerLogger.pump.messages|SERVER POOLED THREAD 2 |Got exception for new message messages[0] in session Sff17d61f15397ecaT1915608: Session error: Unsupported function
21-apr-10 13:19:50,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:50,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:51,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:51,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:52,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:52,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:53,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:53,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:54,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:54,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:55,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:55,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:56,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:56,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:57,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:57,003 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:58,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:58,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:19:59,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:19:59,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:20:00,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Reply Receiver |Received reply: 'KEEPALIVE'...
21-apr-10 13:20:00,004 |DEBUG|mote.request_reply.NotifyReceiver|#1 Notify Receiver |Received notify: 'KEEPALIVE'...
21-apr-10 13:20:00,736 |INFO |emote.request_reply.RequestSender|#1 Request Sender |Request sender '#1' stopped
21-apr-10 13:20:00,737 |INFO |mote.request_reply.NotifyReceiver|#1 Reply Receiver |Reply receiver '#1' stopped
-
April 21st, 2010, 01:45 PM
#8
The message request is not forwarded to the Remote Server,
so it seems that the Server is not configured for the use of the Proxy Adapter for the Metadata part,
as it is in DOCS-SDKs\sdk_adapter_dotnet\examples\Remote_Portfolio_ Adapters\Deployment\Deployment_LS\Portfolio_socket s\adapters.xml;
it is probably configured for the local java-based LiteralBasedProvider,
as in DOCS-SDKs\sdk_adapter_java\examples\StockListDemo_DataA dapter\Deployment_LS\StockList\adapters.xml.
The initial part of the Server log could offer more evidence.
-
April 21st, 2010, 02:03 PM
#9
Okay,
but i don't understand the difference 'cause in the Portfolio_sockter adapters.xml the metadataprovider is linked to <adapter_class>com.lightstreamer.adapters.remote.m etadata.NetworkedMetadataProvider</adapter_class>. I used the same configuration only different port numbers.
-
April 21st, 2010, 03:32 PM
#10
For some unclear reason, your configuration is not used.
If multiple Adapter Sets or multiple Remote Servers are configured, the wrong one may be used for your requests.
What does the Server log at startup?
What does it log when the session is created?
Similar Threads
-
By leonardo.magalhaes in forum Client SDKs
Replies: 1
Last Post: February 27th, 2012, 11:00 AM
-
By msgiribabu in forum General
Replies: 4
Last Post: January 11th, 2011, 10:21 AM
-
By UweF in forum Client SDKs
Replies: 1
Last Post: December 2nd, 2010, 09:25 PM
-
By Otake in forum Client SDKs
Replies: 2
Last Post: November 26th, 2009, 06:58 PM
-
By k.mcc2009 in forum Adapter SDKs
Replies: 1
Last Post: May 21st, 2009, 09:41 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 04:46 AM.
Bookmarks