java.lang.StringIndexOutOfBoundsException:
Posted: Tue Nov 22, 2011 5:49 pm
Hi,
I'm trying WURFL in a standalone fashion and it seems to be working great, there is one scenario in which the API's throw an exception though:
The UserAgent:
Nokia2630/2.0 (05.20) Profile/MIDP-2.1 Configuration/CLDC-1.1 BlackBerry9700/5.0.0.862 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/331 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0
The Exception that is thrown:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at java.lang.String.substring(String.java:1904)
at net.sourceforge.wurfl.core.utils.StringUtils.indexOfAnyOrLength(StringUtils.java:201)
at net.sourceforge.wurfl.core.matchers.NokiaMatcher.lookForMatchingUserAgent(NokiaMatcher.java:49)
at net.sourceforge.wurfl.core.matchers.AbstractMatcher.applyConclusiveMatch(AbstractMatcher.java:129)
at net.sourceforge.wurfl.core.matchers.AbstractMatcher.match(AbstractMatcher.java:91)
at net.sourceforge.wurfl.core.matchers.MatcherChain.match(MatcherChain.java:75)
at net.sourceforge.wurfl.core.matchers.MatcherManager.matchRequest(MatcherManager.java:92)
at net.sourceforge.wurfl.core.DefaultWURFLService.getDeviceForRequest(DefaultWURFLService.java:112)
at net.sourceforge.wurfl.core.DefaultWURFLManager.getDeviceForRequest(DefaultWURFLManager.java:86)
at net.sourceforge.wurfl.core.DefaultWURFLManager.getDeviceForRequest(DefaultWURFLManager.java:102)
at T.main(T.java:19)
Any help you can offer would be greatly appreciated.
I'm trying WURFL in a standalone fashion and it seems to be working great, there is one scenario in which the API's throw an exception though:
The UserAgent:
Nokia2630/2.0 (05.20) Profile/MIDP-2.1 Configuration/CLDC-1.1 BlackBerry9700/5.0.0.862 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/331 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0
The Exception that is thrown:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at java.lang.String.substring(String.java:1904)
at net.sourceforge.wurfl.core.utils.StringUtils.indexOfAnyOrLength(StringUtils.java:201)
at net.sourceforge.wurfl.core.matchers.NokiaMatcher.lookForMatchingUserAgent(NokiaMatcher.java:49)
at net.sourceforge.wurfl.core.matchers.AbstractMatcher.applyConclusiveMatch(AbstractMatcher.java:129)
at net.sourceforge.wurfl.core.matchers.AbstractMatcher.match(AbstractMatcher.java:91)
at net.sourceforge.wurfl.core.matchers.MatcherChain.match(MatcherChain.java:75)
at net.sourceforge.wurfl.core.matchers.MatcherManager.matchRequest(MatcherManager.java:92)
at net.sourceforge.wurfl.core.DefaultWURFLService.getDeviceForRequest(DefaultWURFLService.java:112)
at net.sourceforge.wurfl.core.DefaultWURFLManager.getDeviceForRequest(DefaultWURFLManager.java:86)
at net.sourceforge.wurfl.core.DefaultWURFLManager.getDeviceForRequest(DefaultWURFLManager.java:102)
at T.main(T.java:19)
Any help you can offer would be greatly appreciated.