Seeing a pile of DeviceNotFoundException

4INFO Development
Posts: 2
Joined: Thu Jan 07, 2016 10:01 pm

Seeing a pile of DeviceNotFoundException

Postby 4INFO Development » Thu Jan 07, 2016 10:14 pm

After upgrading to the 1.6.4.1 java API, we're seeing a pile of DeviceNotFoundException type errors:

Code: Select all

net.sourceforge.wurfl.core.exc.DeviceNotDefinedException: Device: apple_iphone_ver9_subhw6s is not defined in WURFL
net.sourceforge.wurfl.core.exc.DeviceNotDefinedException: Device: edge_13 is not defined in WURFL
etcetera
Do all lookup failures raise exceptions now?
Is there any way to configure this to just return a null?

We're subscribed for a weekly pull of the WURFL.xml file, so our data is up to date.

Thanks, and best regards
Tom Shulruff
Senior Software Engineer
4INFO, inc.
4info.com

Elliotfehr

Re: Seeing a pile of DeviceNotFoundException

Postby Elliotfehr » Thu Jan 07, 2016 11:01 pm

Tom,

Is it possible to provide a sample set of User Agents that are causing these exceptions along with a full stack trace of the error? I am also wondering if you are able to provide the version string of the wurfl.xml file that is being loaded (found in the <ver> tags of the file)?

This exception is typically thrown when the version of the API is newer than the wurfl.xml that is being loaded. Are you also able to provide a code sample for how your wurfl.xml file is getting updated and reloaded?

Thank you,

Elliot

4INFO Development
Posts: 2
Joined: Thu Jan 07, 2016 10:01 pm

Re: Seeing a pile of DeviceNotFoundException

Postby 4INFO Development » Mon Jan 11, 2016 1:50 pm

Ah. Thanks Elliot. The wurfl.xml out is of date. This is easily fixed.

We have a build process that automatically downloads the latest wurfl.xml and builds it into a support library. So when we release every two weeks, the latest is built into the system. The library got changed out from under the build system. The build system is being updated and the problem will likely go away.

In the mean time, why is the Java API raising exceptions on device not found? Exception handling is much more expensive than just returning a null pointer or a Device object populated with an error code.

API Bean:

Code: Select all

<bean id="wurflEngine" class="net.sourceforge.wurfl.core.GeneralWURFLEngine">
  <constructor-arg index="0" value="classpath:/com/rhino/deviceUtils/config/wurfl.zip" />
  <property name="engineTarget" value="accuracy" />
  <!-- Big ol' capabilityFilter cut for ease of reading -->
</bean>
API call:

Code: Select all

WURFLEngine wurflEngine = (WURFLEngine) DeviceUtilsSpringConfig.getApplicationContext().getBean("wurflEngine");
Device wurflDevice = wurflEngine.getDeviceForRequest(userAgent);
Thanks again and best regards,
Tom

Elliotfehr

Re: Seeing a pile of DeviceNotFoundException

Postby Elliotfehr » Mon Jan 11, 2016 2:46 pm

Tom,

I do understand your concern here, however an exception is thrown in this case as it is considered to be a fatal error for the library. While all wurfl.xml files are backwards compatible with the API, the inverse is not true and the API is unable to load a wurfl.xml that is older than the API itself as it depends on many device IDs to be present. I have notified the engineering team of this and we are looking into the best solution at the moment. It is likely that we will prevent the wurfl.xml to be loaded if it is missing any of the device IDs going forward.

Thank you,

Elliot


Who is online

Users browsing this forum: No registered users and 17 guests