SVN indexing fails due to ClassCastException
Symptoms
Fisheye fails to index a SVN repository due to this error:
2013-06-04 15:57:57,319 DEBUG [SvnExecution300 ABC] fisheye SvnTask-run - Executing svn diff --summarize -r 32011:32012 https://my.example.com/svn/ABC@1234
2013-06-04 15:57:57,887 DEBUG [SvnExecution300 ABC] fisheye SvnTask-run - Executing svn proplist -r 32012 https://my.example.com/svn/ABC/path/to/file.bin@1234
2013-06-04 15:57:58,222 DEBUG [IncrementalPinger1 ABC] fisheye BaseRevisionCache-withDbWriteLock - Rolling back for priority 40
2013-06-04 15:57:58,253 ERROR [IncrementalPinger1 ABC] fisheye BaseRepositoryScanner-handleSlurpException - Problem processing revisions from repo ABC due to class com.cenqua.fisheye.rep.RepositoryClientException - java.lang.ClassCastException: java.lang.String cannot be cast to [B
com.cenqua.fisheye.rep.RepositoryClientException: java.lang.ClassCastException: java.lang.String cannot be cast to [B
at com.cenqua.fisheye.svn.SvnThrottledClient.executeNoThrottle(SvnThrottledClient.java:163)
at com.cenqua.fisheye.svn.SvnThrottledClient.execute(SvnThrottledClient.java:132)
at com.cenqua.fisheye.svn.SvnThrottledClient.properties(SvnThrottledClient.java:324)
at com.atlassian.fisheye.svn.Svn2Infill2Processor.getPathPropertiesFromSvn(Svn2Infill2Processor.java:578)
at com.atlassian.fisheye.svn.Svn2Infill2Processor.getPropertyChanges(Svn2Infill2Processor.java:555)
at com.atlassian.fisheye.svn.Svn2Infill2Processor.infillChangeSet(Svn2Infill2Processor.java:189)
at com.atlassian.fisheye.svn.Svn2Infill2Processor.access$100(Svn2Infill2Processor.java:76)
at com.atlassian.fisheye.svn.Svn2Infill2Processor$1.perform(Svn2Infill2Processor.java:119)
at com.atlassian.fisheye.svn.Svn2Infill2Processor$1.perform(Svn2Infill2Processor.java:108)
at com.cenqua.fisheye.cache.BaseRevisionCache.withDbWriteLock(BaseRevisionCache.java:967)
at com.atlassian.fisheye.svn.Svn2Infill2Processor.process(Svn2Infill2Processor.java:108)
at com.atlassian.fisheye.svn.Svn2Scanner.slurpRepository(Svn2Scanner.java:205)
at com.atlassian.fisheye.svn.Svn2Scanner.doSlurpTransaction(Svn2Scanner.java:172)
at com.cenqua.fisheye.rep.BaseRepositoryScanner.ping(BaseRepositoryScanner.java:85)
at com.cenqua.fisheye.rep.BaseRepositoryEngine.doSlurp(BaseRepositoryEngine.java:92)
at com.cenqua.fisheye.rep.RepositoryEngine.slurp(RepositoryEngine.java:408)
at com.cenqua.fisheye.rep.ping.IndexingPingRequest.doRequest(IndexingPingRequest.java:25)
at com.cenqua.fisheye.rep.ping.IncrementalPingRequest.doRequest(IncrementalPingRequest.java:30)
at com.cenqua.fisheye.rep.ping.PingRequest.process(PingRequest.java:58)
at com.cenqua.fisheye.rep.RepositoryHandle.processPingRequests(RepositoryHandle.java:228)
at com.cenqua.fisheye.rep.RepositoryHandle.access$100(RepositoryHandle.java:59)
at com.cenqua.fisheye.rep.RepositoryHandle$2.run(RepositoryHandle.java:185)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to [B
at com.atlassian.fisheye.svn.Svn2Infill2Processor$8.singlePath(Svn2Infill2Processor.java:583)
at org.tigris.subversion.javahl.SVNClient.properties(Native Method)
at com.cenqua.fisheye.svn.SvnThrottledClient$11.call(SvnThrottledClient.java:327)
at com.cenqua.fisheye.svn.SvnThrottledClient$11.call(SvnThrottledClient.java:324)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at com.cenqua.fisheye.svn.SvnTask.run(SvnTask.java:32)
... 3 more
Cause
Fisheye is configured to use a Native SVN Client instead of the bundled SVNKit client. See this explanation:
This is caused by an incompatible class change made to the ProlistCallback interface by the Subversion project. In the Subversion 1.6 version of the call back the interface is defined as:
public interface ProplistCallback { /** * the method will be called for every line in a file. * @param path the path. * @param properties the properties on the path. */ public void singlePath(String path, Map properties); }In Subversion 1.7, the org.apache.subversion package was introduced and the interface definition changed to
public interface ProplistCallback extends org.apache.subversion.javahl.callback.ProplistCallback { }This change is not backward compatible since the actual callback definition from the super interface in the new package is typed
public void singlePath(String path, Map<String, byte[]> properties);Older versions (1.6 and older) of the native javahl library making the call back do not pass a map containing byte[] values but a map containing Strings. When Fisheye iterates the map, there is an implicit cast to (byte[]) to re-introduce the type information from the map. Old native code calls will generate a ClassCastException as they are passing Strings.
Resolution
This issue has been reported and addressed in version 3.0.1:
FE-4679 - Getting issue details... STATUS