Page 1 of 1

java.lang.StringIndexOutOfBoundsException:

Posted: Tue Nov 22, 2011 5:49 pm
by karraar
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.

Re: java.lang.StringIndexOutOfBoundsException:

Posted: Tue Nov 22, 2011 8:35 pm
by luca.passani
Can you provide exact info about the API Version, WURFL version and any other info needed to reproduce your configuration?

Our Java engineer will look at this issue.

Thanks

Luca

Re: java.lang.StringIndexOutOfBoundsException:

Posted: Mon Nov 28, 2011 9:47 am
by ermanno
You can try with the new API version 1.3.5-SNAPSHOT.
Simply change the version in your Maven POM:

Code: Select all

  <dependency>
        <groupId>net.sourceforge.wurfl</groupId>
        <artifactId>wurfl</artifactId>
        <version>1.3.5-SNAPSHOT</version>
  </dependency>
With our test it gives

Code: Select all

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
matched by:
Nokia2630/2.0 (05.61) Profile/MIDP-2.1 Configuration/CLDC-1.1
got nokia_2630_ver1_sub1_0561

Re: java.lang.StringIndexOutOfBoundsException:

Posted: Wed Nov 30, 2011 4:23 am
by ermanno
As pointed out in http://www.scientiamobile.com/forum/vie ... =8&t=3#p38,
you must show the snapshot repository, in your pom

Code: Select all

<repository>
<id>scientiamobile.public.snapshot</id>
<name>Scientia Mobile Public Snapshots repository</name>

<url>http://dev.scientiamobile.com/nexus/content/repositories/public-snapshot/</url>

</repository>