Jump to content
Sign in to follow this  
hellohello

LightStreamer Connection Issue

Recommended Posts

i try to connect to the lightstream server using the Java lightstream client.

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newpackage;

import com.lightstreamer.ls_client.ConnectionInfo;
import com.lightstreamer.ls_client.ConnectionListener;
import com.lightstreamer.ls_client.LSClient;
import com.lightstreamer.ls_client.PushConnException;
import com.lightstreamer.ls_client.PushServerException;
import com.lightstreamer.ls_client.PushUserException;

/**
 *
 *
 */
public class NewClass {
    public static void main(String[] args) throws PushConnException, PushServerException, PushUserException {
        LSClient lsc=new LSClient();
        ConnectionInfo ci=new ConnectionInfo();
        ci.pushServerUrl="https://push.cityindex.com/STREAMINGTRADINGACCOUNT/";
        ConnectionListener cl=new ConnectionListener() {

            public void onConnectionEstablished() {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onSessionStarted(boolean bln) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onNewBytes(long l) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onDataError(PushServerException pse) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onActivityWarning(boolean bln) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onClose() {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onEnd(int i) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onFailure(PushServerException pse) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }

            public void onFailure(PushConnException pce) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
            }
        };
        lsc.openConnection(ci, cl);
    }
}

but when i try to execute this snippet java returns:
 

 

Exception in thread "main" com.lightstreamer.ls_client.PushConnException: java.io.FileNotFoundException: https://push.cityindex.com/STREAMINGTRADINGACCOUNT/lightstreamer/create_session.txt
    at com.lightstreamer.ls_client.HttpProvider.connectAndGetAnswer(HttpProvider.java:251)
    at com.lightstreamer.ls_client.HttpProvider.doPost(HttpProvider.java:219)
    at com.lightstreamer.ls_client.PushServerTranslator.callSession(PushServerTranslator.java:91)
    at com.lightstreamer.ls_client.PushServerProxy.connectForSession(PushServerProxy.java:112)
    at com.lightstreamer.ls_client.ServerManager.connect(ServerManager.java:101)
    at com.lightstreamer.ls_client.LSClient.openConnection(LSClient.java:168)
    at com.lightstreamer.ls_client.LSClient$1.run(LSClient.java:97)

 

 

why doesn't it work?

Shall i set username and password?

Or username ant the session-Tokken that is provided by the ciapi?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×