WURFLCloudClientException: No API key was provided

General question about two step analysis, matchers and other general API questions
paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

WURFLCloudClientException: No API key was provided

Postby paramita » Fri Nov 13, 2015 1:33 pm

Hello

I wanted to test and demo WURFL device capabilities. I downloaded the java WURFL cloud client (https://github.com/WURFL/wurfl-cloud-client-java) and setup everything as mentioned.

I am using my API Key in the below code:

ICloudClientManager manager = null;
CloudClientLoader loader = null;
String[] capabilities = null;
try {
loader = new CloudClientLoader("123456:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); // Masked my API Key here
manager = loader.getClientManager();
capabilities = loader.getSearchedCapabilities();
} catch (Exception e) {
e.printStackTrace();
}

AbstractDevice device = manager.getDeviceFromRequest(request, response, capabilities);

-------------------------
When I execute it from my web application, I get the below error:

com.scientiamobile.wurflcloud.exc.WURFLCloudClientException: No API key was provided
com.scientiamobile.wurflcloud.CloudClient.checkHttpConnectionOrThrow(CloudClient.java:457)
com.scientiamobile.wurflcloud.CloudClient.detectDevice(CloudClient.java:424)
com.scientiamobile.wurflcloud.CloudClientManager.detectDevice(CloudClientManager.java:143)
com.scientiamobile.wurflcloud.CloudClientManager.getDeviceFromRequest(CloudClientManager.java:167)

If anyone could point me what's wrong, I would appreciate much.

Thank you!

Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Fri Nov 13, 2015 5:20 pm

Hello,

I am having a difficult time replicating this issue on my end. Are you able to run the sample code below and let me know if you continue to see an API key exception?

Code: Select all

import com.scientiamobile.wurflcloud.CloudClientLoader;
import com.scientiamobile.wurflcloud.ICloudClientManager;
import com.scientiamobile.wurflcloud.device.AbstractDevice;

public class Detect {

    public static void main(String[] args) {

        ICloudClientManager manager = null;
        CloudClientLoader loader = null;
        String[] capabilities = null;

        String user_agent = "Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";

        try {
            // #wurflcloud.properties
            // wurflcloud.cache=None
            loader = new CloudClientLoader("123456:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "/path/to/wurflcloud.properties");
            manager = loader.getClientManager();
            AbstractDevice device = manager.getDeviceFromUserAgent(user_agent);

            System.out.println("is_wireless_device: " + device.get("is_wireless_device"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

Re: WURFLCloudClientException: No API key was provided

Postby paramita » Mon Nov 16, 2015 11:50 am

Hello Elliot

Thanks for posting your reply. Your code with hardcoded user agent string works for me too. But if you replace the user agent string with mine below you will be able to reproduce the error in your code too:

String user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36";

Thanks
Paramita
Elliotfehr wrote:Hello,

I am having a difficult time replicating this issue on my end. Are you able to run the sample code below and let me know if you continue to see an API key exception?

Code: Select all

import com.scientiamobile.wurflcloud.CloudClientLoader;
import com.scientiamobile.wurflcloud.ICloudClientManager;
import com.scientiamobile.wurflcloud.device.AbstractDevice;

public class Detect {

    public static void main(String[] args) {

        ICloudClientManager manager = null;
        CloudClientLoader loader = null;
        String[] capabilities = null;

        String user_agent = "Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";

        try {
            // #wurflcloud.properties
            // wurflcloud.cache=None
            loader = new CloudClientLoader("123456:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "/path/to/wurflcloud.properties");
            manager = loader.getClientManager();
            AbstractDevice device = manager.getDeviceFromUserAgent(user_agent);

            System.out.println("is_wireless_device: " + device.get("is_wireless_device"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Mon Nov 16, 2015 3:44 pm

Paramita,

I have replaced the User Agent with the one provided and I am still not able to replicate the error. I am receiving `is_wireless_device: false` as the output. Is this what you are seeing as well?

Thank you,

Elliot

paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

Re: WURFLCloudClientException: No API key was provided

Postby paramita » Mon Nov 16, 2015 4:08 pm

Hello Elliot,

Thanks very much for your help.
Here is my code:

import com.scientiamobile.wurflcloud.CloudClientLoader;
import com.scientiamobile.wurflcloud.ICloudClientManager;
import com.scientiamobile.wurflcloud.device.AbstractDevice;

public class Detect {

public static void main(String[] args) {

ICloudClientManager manager = null;
CloudClientLoader loader = null;

//String user_agent = "Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
String user_agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36";
try {
// #wurflcloud.properties
// wurflcloud.cache=None
loader = new CloudClientLoader("822747:gvDZGAF6xjYkpJ9bSeqP78IWncQEsBfz", "C://workspace//wurfl-cloud-client-java-master//examples//src//main//resources//wurflcloud.properties");
manager = loader.getClientManager();
AbstractDevice device = manager.getDeviceFromUserAgent(user_agent);

System.out.println("is_wireless_device: " + device.get("is_wireless_device"));
} catch (Exception e) {
e.printStackTrace();
}
}
}


And this is the error I am getting:

com.scientiamobile.wurflcloud.exc.WURFLCloudClientException: No API key was provided
at com.scientiamobile.wurflcloud.CloudClient.checkHttpConnectionOrThrow(CloudClient.java:457)
at com.scientiamobile.wurflcloud.CloudClient.detectDevice(CloudClient.java:424)
at com.scientiamobile.wurflcloud.CloudClientManager.detectDevice(CloudClientManager.java:143)
at com.scientiamobile.wurflcloud.CloudClientManager.getDeviceFromUserAgent(CloudClientManager.java:159)
at Detect.main(Detect.java:19)


Am I not using the correct library?
I downloaded the cloud client from https://github.com/WURFL/wurfl-cloud-client-java

Strangely, the user agent you have provided works fine, no error. I see the above error when I use the user agent string that I have provided. Not sure if this is an issue with the cloud client library...
My API key is-822747:gvDZGAF6xjYkpJ9bSeqP78IWncQEsBfz if that helps:

Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Tue Nov 17, 2015 2:57 pm

Paramita,

I am having some difficulty replicating this on my end. Are you able to let me know what region you are testing in as well as provide me with the full debug log when running the code sample? I have pasted mine below (Please note, I have obfuscated the authorization headers and recommend the same on your end):

Code: Select all

14:52:31.322 [main] INFO  c.s.wurflcloud.CloudClientLoader - setting cache type to None
14:52:31.327 [main] INFO  c.s.wurflcloud.CloudClientLoader - Created cache WurflCloudCache_Null
14:52:31.327 [main] INFO  c.s.wurflcloud.CloudClientLoader - setting 'compression' to None
14:52:31.327 [main] INFO  c.s.wurflcloud.CloudClientLoader - setting 'autoPurge' to false
14:52:31.328 [main] DEBUG c.s.wurflcloud.CloudClientLoader - no capabilities in config, server will give back all authorized ones
14:52:31.328 [main] INFO  c.s.wurflcloud.CloudClientLoader - setting 'reportInterval' to 60
14:52:31.466 [main] INFO  c.s.wurflcloud.CloudClient - starting initialize
14:52:31.467 [main] INFO  c.s.wurflcloud.CloudClient - putting user-agent
14:52:31.467 [main] INFO  c.s.wurflcloud.CloudClient - user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
14:52:31.468 [main] DEBUG c.s.w.utils.AuthorizationUtils - user: 123456
14:52:31.468 [main] DEBUG c.s.w.utils.AuthorizationUtils - auth string: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
14:52:31.468 [main] INFO  c.s.wurflcloud.CloudClient - headers map at initialize end: {X-Cloud-Counters=hit:0,error:0,miss:0,age:1447789951, user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36, accept=*/*, X-Cloud-Client=WurflCloudClient/Java_1.0.4, Connection=Close, Authorization=Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
14:52:31.468 [main] INFO  c.s.wurflcloud.CloudClient - request: http://api.wurflcloud.com/v1/json/search:('')
14:52:31.471 [main] DEBUG c.s.wurflcloud.CloudClient - Setting connection timeout: 10000
14:52:31.471 [main] INFO  c.s.wurflcloud.CloudClient - Explicitly setting connection method to GET
14:52:31.471 [main] INFO  c.s.wurflcloud.CloudClient - sun.net.www.protocol.http.HttpURLConnection:http://api.wurflcloud.com/v1/json/search:('')
14:52:31.471 [main] INFO  c.s.wurflcloud.CloudClient - Incoming connection headers count: 6
14:52:31.471 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: X-Cloud-Counters=hit:0,error:0,miss:0,age:1447789951
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: accept=*/*
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: X-Cloud-Client=WurflCloudClient/Java_1.0.4
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: Connection=Close
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient -    adding entry: Authorization=Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgouing connection headers count: 5
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgoing Header: Connection -> [Close]
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Client -> [WurflCloudClient/Java_1.0.4]
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Counters -> [hit:0,error:0,miss:0,age:1447789951]
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgoing Header: accept -> [*/*]
14:52:31.472 [main] INFO  c.s.wurflcloud.CloudClient - Outgoing Header: user-agent -> [Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36]
14:52:31.558 [main] INFO  c.s.wurflcloud.CloudClient - URLConnection to cloud returned correctly
14:52:31.558 [main] INFO  c.s.wurflcloud.CloudClient - Trying to get InputStream from Connection...
14:52:31.558 [main] INFO  c.s.wurflcloud.CloudClient - InputStream received
14:52:31.559 [main] DEBUG c.s.wurflcloud.CloudClient - Trying to read 65536 bytes...
14:52:31.560 [main] DEBUG c.s.wurflcloud.CloudClient - 232 bytes received
14:52:31.560 [main] DEBUG c.s.wurflcloud.CloudClient - Trying to read 65536 bytes...
14:52:31.560 [main] INFO  c.s.wurflcloud.CloudClient - EOF received
14:52:31.560 [main] INFO  c.s.wurflcloud.CloudClient - message: {"apiVersion":"WurflCloud 1.5.0.2","mtime":1445531735,"id":"generic_web_browser","capabilities":{"brand_name":"generic web browser","is_smartphone":false,"is_tablet":false,"is_wireless_device":false,"gif_animated":true},"errors":{}}
14:52:31.612 [main] DEBUG c.s.wurflcloud.CloudClientManager - processEvent: Event: com.scientiamobile.wurflcloud.CloudClient@13a5fe33{mtime=1445531735, apiVersion='WurflCloud 1.5.0.2'}
14:52:31.612 [main] DEBUG c.s.w.cache.WurflCloudCache_Null - setting mtime to 1445531735
is_wireless_device: false
Thank you,

Elliot

paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

Re: WURFLCloudClientException: No API key was provided

Postby paramita » Tue Nov 17, 2015 6:50 pm

Hi Elliot,
pasted my debug logs below:

15:49:17.247 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting cache type to HashMap
15:49:17.255 [main] INFO c.s.w.cache.HashMapPremiumCloudCache - Created HashMap Cache with initial capacity: 40000 load factor: 0.75 concurrent writes: 16
15:49:17.256 [main] INFO c.s.wurflcloud.CloudClientLoader - Created cache HashMapPremiumCloudCache
15:49:17.256 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'compression' to true
15:49:17.256 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'autoPurge' to true
15:49:17.256 [main] DEBUG c.s.wurflcloud.CloudClientLoader - No capabilities listed in config, server will give back all authorized ones
15:49:17.256 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'reportInterval' to 15
15:49:17.429 [main] INFO c.s.wurflcloud.CloudClient - starting initialize
15:49:17.430 [main] INFO c.s.wurflcloud.CloudClient - putting user-agent
15:49:17.430 [main] INFO c.s.wurflcloud.CloudClient - user-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
15:49:17.432 [main] DEBUG c.s.w.utils.AuthorizationUtils - user: XXXXXX
15:49:17.432 [main] DEBUG c.s.w.utils.AuthorizationUtils - auth string: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
15:49:17.432 [main] INFO c.s.wurflcloud.CloudClient - Headers map at initialize end: {X-Cloud-Counters=age:1447804157,miss:0,hit:0,error:0, user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36, Accept-Encoding=gzip, accept=*/*, X-Cloud-Client=WurflCloudClient/Java_1.0.5, Connection=Close, Authorization=Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
15:49:17.433 [main] INFO c.s.wurflcloud.CloudClient - Request: http://api.wurflcloud.com/v1/json/search:('')
15:49:17.436 [main] DEBUG c.s.wurflcloud.CloudClient - Setting connection timeout: 5000 mSec
15:49:17.437 [main] DEBUG c.s.wurflcloud.CloudClient - Setting read timeout: 10000 mSec
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - Explicitly setting connection method to GET
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - sun.net.www.protocol.http.HttpURLConnection:http://api.wurflcloud.com/v1/json/search:('')
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - Incoming connection headers count: 7
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - adding entry: X-Cloud-Counters=age:1447804157,miss:0,hit:0,error:0
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - adding entry: user-agent=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Accept-Encoding=gzip
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - adding entry: accept=*/*
15:49:17.437 [main] INFO c.s.wurflcloud.CloudClient - adding entry: X-Cloud-Client=WurflCloudClient/Java_1.0.5
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Connection=Close
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Authorization=Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing connection headers count: 6
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: accept -> [*/*]
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: Accept-Encoding -> [gzip]
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Client -> [WurflCloudClient/Java_1.0.5]
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Counters -> [age:1447804157,miss:0,hit:0,error:0]
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: user-agent -> [Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36]
15:49:17.438 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: Connection -> [Close]
com.scientiamobile.wurflcloud.exc.WURFLCloudClientException: No API key was provided
at com.scientiamobile.wurflcloud.CloudClient.checkHttpConnectionOrThrow(CloudClient.java:457)
at com.scientiamobile.wurflcloud.CloudClient.detectDevice(CloudClient.java:424)
at com.scientiamobile.wurflcloud.CloudClientManager.detectDevice(CloudClientManager.java:143)
at com.scientiamobile.wurflcloud.CloudClientManager.getDeviceFromUserAgent(CloudClientManager.java:159)
at Detect.main(Detect.java:19)

Thanks
Paramita


******************************************************************************************************************************************************************************************

When I use your user agent string, the debug logs look ok , I am pasting that as well:

15:58:54.720 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting cache type to HashMap
15:58:54.720 [main] INFO c.s.w.cache.HashMapPremiumCloudCache - Created HashMap Cache with initial capacity: 40000 load factor: 0.75 concurrent writes: 16
15:58:54.720 [main] INFO c.s.wurflcloud.CloudClientLoader - Created cache HashMapPremiumCloudCache
15:58:54.720 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'compression' to true
15:58:54.720 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'autoPurge' to true
15:58:54.720 [main] DEBUG c.s.wurflcloud.CloudClientLoader - No capabilities listed in config, server will give back all authorized ones
15:58:54.720 [main] INFO c.s.wurflcloud.CloudClientLoader - Setting 'reportInterval' to 15
15:58:54.884 [main] INFO c.s.wurflcloud.CloudClient - starting initialize
15:58:54.884 [main] INFO c.s.wurflcloud.CloudClient - putting user-agent
15:58:54.884 [main] INFO c.s.wurflcloud.CloudClient - user-agent: Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
15:58:54.899 [main] DEBUG c.s.w.utils.AuthorizationUtils - user: 123456
15:58:54.899 [main] DEBUG c.s.w.utils.AuthorizationUtils - auth string: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Headers map at initialize end: {X-Cloud-Counters=age:1447804734,miss:0,hit:0,error:0, user-agent=Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30, Accept-Encoding=gzip, accept=*/*, X-Cloud-Client=WurflCloudClient/Java_1.0.5, Connection=Close, Authorization=Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Request: http://api.wurflcloud.com/v1/json/search:('')
15:58:54.899 [main] DEBUG c.s.wurflcloud.CloudClient - Setting connection timeout: 5000 mSec
15:58:54.899 [main] DEBUG c.s.wurflcloud.CloudClient - Setting read timeout: 10000 mSec
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Explicitly setting connection method to GET
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - sun.net.www.protocol.http.HttpURLConnection:http://api.wurflcloud.com/v1/json/search:('')
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Incoming connection headers count: 7
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: X-Cloud-Counters=age:1447804734,miss:0,hit:0,error:0
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: user-agent=Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Accept-Encoding=gzip
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: accept=*/*
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: X-Cloud-Client=WurflCloudClient/Java_1.0.5
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Connection=Close
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - adding entry: Authorization=Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing connection headers count: 6
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: accept -> [*/*]
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: Accept-Encoding -> [gzip]
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Client -> [WurflCloudClient/Java_1.0.5]
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: X-Cloud-Counters -> [age:1447804734,miss:0,hit:0,error:0]
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: user-agent -> [Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30]
15:58:54.899 [main] INFO c.s.wurflcloud.CloudClient - Outgoing Header: Connection -> [Close]
15:58:55.102 [main] INFO c.s.wurflcloud.CloudClient - URLConnection to cloud returned correctly
15:58:55.102 [main] INFO c.s.wurflcloud.CloudClient - Trying to get InputStream from Connection...
15:58:55.102 [main] INFO c.s.wurflcloud.CloudClient - InputStream received
15:58:55.102 [main] DEBUG c.s.wurflcloud.CloudClient - Trying to read 65536 bytes...
15:58:55.102 [main] DEBUG c.s.wurflcloud.CloudClient - 208 bytes received
15:58:55.102 [main] DEBUG c.s.wurflcloud.CloudClient - Trying to read 65536 bytes...
15:58:55.102 [main] INFO c.s.wurflcloud.CloudClient - EOF received
15:58:55.102 [main] INFO c.s.wurflcloud.CloudClient - message: {"apiVersion":"WurflCloud 1.5.0.2","mtime":1445532038,"id":"lg_l160l_ver1","capabilities":{"brand_name":"LG","is_smartphone":true,"is_tablet":false,"is_wireless_device":true,"gif_animated":false},"errors":{}}
15:58:55.164 [main] DEBUG c.s.wurflcloud.CloudClientManager - processEvent: Event: com.scientiamobile.wurflcloud.CloudClient@d8f459{mtime=1445532038, apiVersion='WurflCloud 1.5.0.2'}
15:58:55.164 [main] DEBUG c.s.w.cache.HashMapPremiumCloudCache - setting mtime to 1445532038
is_wireless_device: true
gif_animated: false
is_tablet: false
is_smartphone: true
brand_name: LG

Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Fri Nov 20, 2015 9:35 am

Paramita,

For some reason, I am having a very difficult time replicating the same results you are seeing using the same code and region that you are in. Are you able to try using cURL directly and let me know if you see any errors there?

Code: Select all

$ curl -u 123456:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -A 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36' 'http://api.wurflcloud.com/v1/json/search:(is_wireless_device)' 
Thank you,

Elliot

paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

Re: WURFLCloudClientException: No API key was provided

Postby paramita » Fri Nov 20, 2015 6:56 pm

Hello Elliot,

Yes the curl command works.

thanks
paramita

Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Wed Nov 25, 2015 1:42 pm

Paramita,

Are you able to share your wurflcloud.properties file as well? I have been unable to find where this may be occuring in the cloud client itself so far. It appears that the API key is not being passed to the WURFL Cloud service for the failing requests, which happens to be for the particular User Agent you have provided. Are you able to let me know if it is working intermittingly or if other User Agents are working for you?

Thank you,

Elliot

paramita
Posts: 6
Joined: Fri Nov 13, 2015 1:25 pm

Re: WURFLCloudClientException: No API key was provided

Postby paramita » Fri Nov 27, 2015 2:37 pm

Hi Elliot

The call via cloud java client consistently failed for my user agent. But it worked for yours. The issue is consistent.

Let me attach my wurfl properties file.

thanks
Paramita


This site did not allow me to upload the properties, so I paste the entire file content here:

#
# Copyright (c) Copyright (c) 2015 ScientiaMobile Inc.
#
# The WURFL Cloud Client is intended to be used in both open-source and
# commercial environments. To allow its use in as many situations as possible,
# the WURFL Cloud Client is dual-licensed. You may choose to use the WURFL
# Cloud Client under either the GNU GENERAL PUBLIC LICENSE, Version 2.0, or
# the MIT License.
#
# Refer to the COPYING.txt file distributed with this package.
#

#### Java Cloud Client Configuration File example ####

######################################################
#### Generic Client Configuration Properties ####
######################################################

# Here you can specify your API Key
wurflcloud.key=822747:gvDZGAF6xjYkpJ9bSeqP78IWncQEsBfz

# Choose if gzip compressed response support should be enabled, for network performance
wurflcloud.compression=true

# Possible values are: None, HashMap, Ehcache, Cookie
# Note that Ehcache looks for a ehcache.xml configuration file in classpath root
wurflcloud.cache=HashMap

# If you chose HashMap, you can customize this
wurflcloud.cache.HashMap.initialCapacity=40000
wurflcloud.cache.HashMap.loadFactor=0.75
wurflcloud.cache.HashMap.concurrentWrites=16

# Seconds between two cache performance reports ( 0 = no report )
wurflcloud.cache.reportInterval=15

# Auto-purging cache when WURFL is updated (default is true)
wurflcloud.cache.autoPurge=true

####### Connection configuration #######

# Timeout on opening connection to server
# default is 5000 mSec
#wurflcloud.connTimeout=5000

# Timeout on read over connection
# default is 10000 mSec
#wurflcloud.readTimeout=10000

####### Proxy configuration #######

# Proxy URL or IP address
#wurflcloud.proxy.url=192.168.1.1

# Proxy port
#wurflcloud.proxy.port=8080

# Proxy type; valid options are DIRECT, HTTP, SOCKS
# (see java.net.Proxy.Type for reference)
#wurflcloud.proxy.type=HTTP

######################################################
#### Premium specific Configuration Properties ####
######################################################

# Here you can specify a specific subset of capabilities you're authorized to query.
# Note that the prefix "wurflcloud.capability." is required (including the trailing dot) when specifying the subset.
#wurflcloud.capability.0=is_wireless_device
#wurflcloud.capability.1=brand_name
#wurflcloud.capability.2=model_name
#wurflcloud.capability.3=resolution_height
#wurflcloud.capability.4=resolution_width
#wurflcloud.capability.5=device_os
#wurflcloud.capability.6=device_os_version
#wurflcloud.capability.7=is_tablet
#wurflcloud.capability.8=pointing_method
#wurflcloud.capability.9=preferred_markup
#wurflcloud.capability.10=ux_full_desktop
#wurflcloud.capability.11=xhtml_support_level
#wurflcloud.capability.12=is_smarttv
#wurflcloud.capability.13=can_assign_phone_number
#wurflcloud.capability.14=marketing_name

Elliotfehr

Re: WURFLCloudClientException: No API key was provided

Postby Elliotfehr » Thu Dec 03, 2015 2:53 pm

Paramita,

I am still having some difficulty replicating this on my end. Looking through our logs I do notice that your device is sending the `X-Bluecoat-Via` header and am wondering if this proxy in between the cloud client and our cloud servers may be altering the headers and therefore causing this error to appear?

Are you able to try making a request outside of any proxy and see if this persists?

Thank you,

Elliot


Who is online

Users browsing this forum: No registered users and 16 guests