Hello Andy,
Thanks for reporting this bug. I've created an issue for it:

http://issues.tmatesoft.com/issue/SVNKIT-358

While we're resolving it, as a quick workaround: use the new SVNKit API.
Since 1.7.x SVNKit has 2 API: SVNClientManager-based (the old one, wc.*) and 
SvnOperationFactory-
based (the new one, wc2.*).

Currenlty the old API is implemented via the new API, and the problem occurs on 
translation of 
objects between these APIs. If you use the new SVNKit API directly, the objects 
won't be translated, 
so this error won't occur.

To commit using new API use the following code:

            final SvnOperationFactory svnOperationFactory = new 
SvnOperationFactory();
            svnOperationFactory.setAuthenticationManager(...); //optional 
authentication manager
            try {
                final SvnCommit commit = svnOperationFactory.createCommit();
                commit.addTarget(SvnTarget.fromFile(file1)); //or just 
commit.setSingleTarget(...);
                commit.addTarget(SvnTarget.fromFile(file2));
                ...
                commit.addTarget(SvnTarget.fromFile(fileN));
                commit.setKeepLocks(keepLocks);
                commit.setCommitMessage("Commit message");
                final SVNCommitInfo commitInfo = commit.run();
                if (commitInfo != null) {
                    System.out.println("Committed revision " + 
commitInfo.getNewRevision());
                }
            } finally {
                svnOperationFactory.dispose();
            }

In general prefer the new API rather than the old one.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> I've recently upgraded to SVNkit 1.7.8, and I'm getting this error when I
> commit:
> 
> java.lang.ClassCastException: org.tmatesoft.svn.core.wc.SVNCommitPacket
> cannot be cast to
> org.tmatesoft.svn.core.internal.wc2.compat.SvnCodec$SVNCommitPacketWrapper
> at
> org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:85
> 1) at
> org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:75
> 9) at
> org.tmatesoft.svn.core.wc.SVNCommitClient.doCommit(SVNCommitClient.java:71
> 6)
> 
> Here's my code that invokes SVNCommitClient.doCommit():
> 
>    SVNCommitInfo commitInfo
>       = svnCommitClient.doCommit
>           (commitPacket,
>            false,  // keepLocks
>            commitComment);
> 
> While poking around, trying to figure out how to solve this problem, I've
> noticed that there seems to be a parallel between
> org.tmatesoft.svn.core.wc and org.tmatesoft.svn.core.wc2. That is, the
> first package has something called an "SVNCommitClient", while the second
> package has something called an "SvnCommit". Should I be migrating my code
> from the "wc" stuff to the "wc2" stuff, or am I barking up the wrong tree?
> 
> Thanks for any help,
> 
>     Andy
> 
> Andy Cohen
> Principal Software Engineer
> Product Development
> Innovative Interfaces, Inc.
> 5850 Shellmound Way
> Emeryville, CA 94608
> 
> [letter-t]  510-655-6200 Ext 4221
> [letter-e]  aco...@iii.com
> 
> [INNOIcon]<http://www.iii.com/>     [TwritterIcon]
> <https://twitter.com/iii_Innovative>      [FacebookIcon]
> <https://www.facebook.com/InnovativeInterfaces>

Reply via email to