-
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.
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 01:15 PM.
Bookmarks