Mantis - Resin
Viewing Issue Advanced Details
2187 trivial always 11-19-07 01:23 12-17-07 16:18
dibo  
ferg  
normal  
closed 3.1.3  
fixed  
none    
none 3.1.5  
0002187: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
While playing with a JAX-WS client on Resin Open Source 3.1.3 under Windows XP, I've encountered the following exception:

java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(String.java:558)
at java.util.regex.Matcher.appendReplacement(Matcher.java:696)
at java.util.regex.Matcher.replaceAll(Matcher.java:806)
at java.lang.String.replaceAll(String.java:2000)
at javax.xml.bind.FactoryLoader.getFactoryClass(FactoryLoader.java:113)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:144)
Having a look at source code of javax.xml.bind.FactoryLoader.getFactoryClass(FactoryLoader.java:113)
 
Line 113: String pkg = pkgs[i].replaceAll("\\.", File.separator);

I see that this code is platform dependant on unix based systems ( because on Windows ones File.separator unfolds to "\\" ).I've changed this to
 
Line 113: String pkg = pkgs[i].replaceAll("\\.", escapeSeparator(File.separator));

where escapeSeparator is defined as follows:
public static String escapeSeparator( String separator )
{
  if( "\\".equals( separator ) )
  {
    return "\\" + separator;
  }
  else
  {
    return separator;
  }
}

After having resin recompiled, the problem seems to be fixed.

There are no notes attached to this issue.