1

currently, I try to use CloudRail with the last version of cloudrail-si-java (version: 2.21.1), but I get this error with Twitter API:

Exception in thread "main" java.lang.RuntimeException: ServiceCode Error in function authenticate at 13 at com.cloudrail.si.servicecode.Interpreter.run(Interpreter.java:111) at com.cloudrail.si.servicecode.Interpreter.callFunction(Interpreter.java:45) at com.cloudrail.si.services.Twitter.login(Twitter.java:909) at com.whois.multiPlateformPosting.testDemo.main(testDemo.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.lang.NullPointerException at java.io.Reader.(Reader.java:78) at java.io.InputStreamReader.(InputStreamReader.java:72) at java.util.Scanner.(Scanner.java:563) at com.cloudrail.si.servicecode.commands.stream.StreamToString.dumpStream(StreamToString.java:39) at com.cloudrail.si.servicecode.commands.stream.StreamToString.execute(StreamToString.java:33) at com.cloudrail.si.servicecode.Interpreter.run(Interpreter.java:87) ... 8 more

My source code look like that:

import com.cloudrail.si.servicecode.commands.awaitCodeRedirect.LocalReceiver;
import com.cloudrail.si.services.Twitter;
public class testDemo {

    public static void main(String args[]){
        com.cloudrail.si.CloudRail.setAppKey("5----------19");
        System.out.println("getAppKey: " + com.cloudrail.si.CloudRail.getAppKey());
        com.cloudrail.si.CloudRail.validateKey();
        Twitter service = new Twitter(
                new LocalReceiver(8042),
                "8KS-----1Hd",
                "gT---kzTu",
                "http://localhost:8042/auth"
        );
        service.login();
        System.out.println("end" );
    }
}

the identifiers come from this page: enter image description here

How I can fixe it ? Best regards,

pi-2r
  • 1,259
  • 4
  • 27
  • 52
  • 1
    So what exactly happens when you run the code? Does it crash immediately or does it open the website to perform the authentication and only crashes when you return back? – Dr. GIT Nov 08 '17 at 14:28
  • Hi there, thanks you for your reply. The code crash immediately, after to display my appkey of Cloudrail. – pi-2r Nov 08 '17 at 14:57
  • Did you setup the redirect URL on twitter APP website? (on the settings tab) – Felipe Cesar Assis Nov 10 '17 at 02:22

0 Answers0