Lightstreamer / Lightstreamer-example-Chat-client-ios-swift

A version of the Chat Demo for iOS developed with Swift
Apache License 2.0
9 stars 5 forks source link

Requested Adapter Set not available #3

Closed santanu4ver closed 9 years ago

santanu4ver commented 9 years ago

Hi,

"2015-07-21 15:02:18.827 SwiftChat[2264:129293] Connection failed with reason "Optional("Server exception (reason: \'Lightstreamer error received: 2 Requested Adapter Set not available\')")", reconnecting..."

I need some help here. Although I'm able to run the project on simulator or device, I can't able to connect to the default Adapter Set. I confirm http://localhost:8080 is running fine with Lightstreamer demos in browser, though (including basic chat demo).

As mentioned to setup adapter by instruction from here https://github.com/Weswit/Lightstreamer-example-Chat-adapter-java, from Install section I downloaded "deploy.zip" folder and updated/overwrite to Lightstreamer-master's adapter/demo section as well, but iOS project still not able to connect mentioned Adapter Set. I also don't see any other procedure to do.

Thanks.

Bravo27 commented 9 years ago

Hi santanu4ver,

It could be that the Adapter set is not properly deployed or is deployed with a different name from "CHAT" that is what the Swift demo expects. You could check in the server log file (lightstreamer.log) what are the Adapter Set loaded at startup. Otherwise, if you prefer, you could send us the log file (to support@lightstreamer.com) for a check.

Thank you, Giuseppe

santanu4ver commented 9 years ago

Hi Thanks, for your reply. I just sent a log to the mail address.

Bravo27 commented 9 years ago

Hi Santanu,

In your case you left only the WELCOME Adapter Set, unchanged with respect the factory configuration. So this should work for you:

let ADAPTER_SET = "WELCOME"
let DATA_ADAPTER = "CHAT"

Please let me know if it works.

As a side note, please note that you can identify the Adapter Set and Data Adapter names to be used in your clients in the adapters.xml file deployed in the adapters folder:

Thank you, Giuseppe

santanu4ver commented 9 years ago

It works! Thank you!!

Btw, I found following differences in adapter set and data provider name values, so I was confused:

< lightstreamer-master >/adapters/welcome_res/adapters.xml : < adapters_conf id="WELCOME" > and < data_provider name="CHAT" >

< lightstreamer-master >/adapters/welcome_res/Chat/adapters.xml: < adapters_conf id="CHAT" > and < data_provider name="CHAT_ROOM" >

Per your saying to determine Adapter Set and Data Adapter to be use in my client, which above one adapter.xml I really want to look into?

Thanks!

santanu4ver commented 9 years ago

Probably I want to look into the former one only.

Bravo27 commented 9 years ago

Hi Santanu,

Please note that in the factory configuration in the _/adapters/welcomeres/Chat/ folder there are no adapters.xml file. In any case, the only files adapters.xml considered by the server for the deploy are those contained directly in the first level of each subfolder of adapters.

I suppose that you have added the file trying to setup the Chat Adapter as described here (https://github.com/Weswit/Lightstreamer-example-Chat-adapter-java). But the provided instructions require: or to leave unchanged the folder adapters and use the CHAT Data Adapter pre-installed or to copy the "Chat" directory directly under the adapters folder, then at the same level of _welcomeres. In this case, your Lightstreamer server will expose both the Data Adapters and at the client side you can choose between the two:

Sorry for the misunderstanding.

Regards, Giuseppe

santanu4ver commented 9 years ago

Hi Giuseppe,

Thank you for clearing the ideas. Yes, I took deploy.zip from https://github.com/Weswit/Lightstreamer-example-Chat-adapter-java (mentioned in Install) contains Chat folder having separate adapter.xml and overwrites over _/adapters/welcomeres/Chat (I tried that because former setting anyway wan't working for me). Thus I also got confused because of different Adapters Set and Data.

Anyway, you made it right, now. Thank you so much.