#414 BeansWrapper.isJavaRebelAvailable() causes eclipse to suspend in debug mode

2.3.21
closed-fixed
nobody
None
5
2014-10-12
2014-04-23
Alex Foran
No
```
private static boolean isJavaRebelAvailable() {
    try {
        JavaRebelIntegration.testAvailability();
        return true;
    }
    catch(NoClassDefFoundError e) {
        return false;
    }
}
```

Loading JavaRebelIntegration throws a ClassNotFoundException (default classloader), which Eclipse (Kepler) by default suspends on. This makes working with freemarker very annoying.

Discussion

  • Dániel Dékány

    Well, disable suspension on that exception... A lot of other libraries detect availability of other classes like this, and I believe there's no better way of doing that. Or is there?

    (BTW, I used to debug FreeMarker sometimes, but for me Eclipse doesn't suspend on it.)

     
  • Dániel Dékány

    • status: open --> closed-invalid
    • Group: --> 2.3.21
     
  • deadlycheese

    deadlycheese - 2014-06-26

    For anyone else experiencing this problem, here is a simple workaround:

        protected Configuration getFreemarkerConfiguration() throws ClassNotFoundException
        {
            return new Configuration();
            // the bug: http://sourceforge.net/p/freemarker/bugs/414/ means that
            // we have to wrap a "throws ClassNotFoundException" around this API ...  
        }
    

    Then, you can call the method and swallow the ClassNotFoundException:

            Configuration configure = null;
            try
            {
                configure = getFreemarkerConfiguration();
            }
            catch (ClassNotFoundException cnfe)
            {
            }
            // continue normal processing ...
    
     
  • Dániel Dékány

    It only meant to throw NoClassDefFoundError, not ClassNotFoundException. Does it throw ClassNotFoundException for you? Can you paste the stack trace?

     
  • Dániel Dékány

    OK, my bad. JRebel was still in my classpath. Without that Eclipse debug has suspended execution for me too, and so I could find a way with which it doesn't do that.

     
  • Dániel Dékány

    • status: closed-invalid --> open-fixed
    • Group: v2.3.21 --> 2.3.21
     
  • Dániel Dékány

    • status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks