Unable to connect to external host with CBL

Now that support for connecting to external sites with CBL has been released, I applied for (and was accepted) weather.livedoor.com. This site has REST API to get Japanese weather info. Using the following Java code I still get a socket permission error and am unable to connect.









@Asset( "Order" )

public class OrderTableEventHandler extends com.backendless.servercode.extension.PersistenceExtender<Order>

{




	@Override

	public void beforeCreate( RunnerContext context, Order order ) throws Exception

	{

		// add your code here

		String openURL = "http://weather.livedoor.com/forecast/webservice/json/v1?city=400010";

		System.out.println( "opening URL: " + openURL);

		URL u;

		InputStream is = null;

		DataInputStream dis;

		String s;

		u = new URL(openURL);

		is = u.openStream();

		dis = new DataInputStream(new BufferedInputStream(is));

		while ((s = dis.readLine()) != null) {

			System.out.println(s);

		}

		is.close();

	}




}

When I run the following curl command I get the error below it, and on the CodeRunner console all I see is the above System.out.println( "opening URL: " + openURL); output but with no JSON response content thereafter, as I would expect if able to successfully connect.









curl -H application-id:XXXXX -H secret-key:XXXXXXX name\":\"foobar corp\"}" -v https://api.backendless.com/v1/data/Order

error:









* Connection #0 to host api.backendless.com left intact

{"message":"access denied (\"java.net.SocketPermission\" \"weather.livedoor.com:80\" \"connect,resolve\")","code":0}

Hi, Simon!
You use latest CodeRunner SDK?
https://backendless.com/backend-as-a-service/downloads/

Hi Simon,

As Kate said, make sure you’re using the latest CodeRunner SDK. If you already do, code runner must be restarted after you received a notification that the URL had been approved.

Regards,
Mark