unable to access cvs

  • pedro

    pedro - 2010-02-05

    I'd like to pull down the source so I can build a local 0.97 release with a patch I made to JarClassLoader to fix a JPA/Hibernate classloading problem (similar to 1805547, but that fix doesn't solve my problem where the resource lookup is on 'lib/support.jar/' which has an extra '/' at the end and can be fixed by checking if resource.endsWith(".jar/") and removing the "/" before checking jarNames).

    I get a 'connection refused when attempting to download the source tree from Linux commandline as well as via Eclipse. I can browse the source tree via HTTP but downloading the entire tree via 'Save Page As…' is not what I really want to do…

    Any help appreciated!

  • P. Simon Tuffs

    P. Simon Tuffs - 2010-02-06

    Hi: I'm not sure why you're being denied: I was able to attach using both ssh and pserver authentication.  Please try this:



  • pedro

    pedro - 2010-02-06

    That's the info I was using. I tried it from a public internet access location and it worked fine - must be some firewall preventing me from accessing it on my work LAN.

    Do you want the mod sent back? Via this forum? or does the CVS server allow public check-ins?  (it's a few lines added to JarClassLoader.java)

    thanks much,

  • P. Simon Tuffs

    P. Simon Tuffs - 2010-02-06

    Thanks for figuring out the problem: firewalls to CVS are often a target for corporate sysadmins for some reason best know to them.  If you could make a patch (Eclipse preferred) and post that to the forum that will be sufficient.


  • pedro

    pedro - 2010-02-12

    not sure how to make the patch, so here's the code (note that I referenced sourceforge ticket for some impl details):

    public InputStream getByteStream(String resource) {

            InputStream result = null;
            // Look up without resolving first.  This allows jar-local resolution to take place.
            ByteCode bytecode = (ByteCode)byteCode.get(resource);
            if (bytecode == null) {
                // Try again with a resolved name.
                bytecode = (ByteCode)byteCode.get(resolve(resource));

            if (bytecode != null) result = new ByteArrayInputStream(bytecode.bytes);

            // <-- begin updated code here
            if (result == null) {
                  /* handle case where hibernate sends us 'somelibrary.jar/' */
                  if (resource.endsWith(".jar/")) {
                        resource = resource.substring(0, resource.length() - 1);
                  if (jarNames.contains(resource)) {
                        // resource wanted is an actual jar
                        result = super.getResourceAsStream(resource);
            // <-- end updated code

            // Special case: if we are a wrapping classloader, look up to our
            // parent codebase.  Logic is that the boot JarLoader will have
            // delegateToParent = false, the wrapping classloader will have
            // delegateToParent = true;
            if (result == null && delegateToParent) {
                result = ((JarClassLoader)getParent()).getByteStream(resource);
            VERBOSE("getByteStream(" + resource + ") -> " + result);
            return result;

  • P. Simon Tuffs

    P. Simon Tuffs - 2010-02-15

    OK, good enough for me to figure out what to do.  Stay tuned.

  • Niall Gallagher

    Niall Gallagher - 2010-02-15

    We were affected by this issue too, and we patched the code for an in-house release which fixed the issue for us.

    Actually our patch was slightly different, it was based on the discussion here:

    We didn't have that problem with a trailing slash, but maybe because our app is different. I don't know which patch would be better. Here is our code:

            if (result == null && delegateToParent) {
    -            result = ((JarClassLoader)getParent()).getByteStream(resource);
    +            ClassLoader parentClassLoader = getParent();
    +            if (parentClassLoader instanceof JarClassLoader) {
    +                result = ((JarClassLoader) parentClassLoader).getByteStream(resource);
    +            }
    +            else {
    +                result = parentClassLoader.getResourceAsStream(resource);
    +            }

    …I've added '-' for the one line we removed and '+' for the lines we added.


Log in to post a comment.