java.lang.StringIndexOutOfBoundsException:

karraar
Posts: 1
Joined: Tue Nov 22, 2011 5:42 pm

java.lang.StringIndexOutOfBoundsException:

Postby karraar » 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.

luca.passani
Posts: 65
Joined: Thu May 19, 2011 2:49 pm

Re: java.lang.StringIndexOutOfBoundsException:

Postby luca.passani » Tue Nov 22, 2011 8:35 pm

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

ermanno
Posts: 11
Joined: Fri Jul 08, 2011 12:19 pm

Re: java.lang.StringIndexOutOfBoundsException:

Postby ermanno » Mon Nov 28, 2011 9:47 am

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

ermanno
Posts: 11
Joined: Fri Jul 08, 2011 12:19 pm

Re: java.lang.StringIndexOutOfBoundsException:

Postby ermanno » Wed Nov 30, 2011 4:23 am

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>


Who is online

Users browsing this forum: No registered users and 55 guests