Community
Participate
Working Groups
When I switch from version 2.1 to 3.0 M1 (M2 and M3 as well), two of my projects stopped running from within Eclipse. Versiosn 2.1 and 2.1.1 still work fine however. This is the error I'm getting, and it's got something to do with static initialization, I think. Seems like the order that things are initialized might be different (why I can't fathom). Error message when executing: <<< java.lang.IllegalStateException: Class not found in enumLookup class com.aaw.common.enum.ProductType at com.aaw.common.enum.infrastructure.EnumBean.getEnums(EnumBean.java:77) at com.aaw.producttool.ProductTool.main(ProductTool.java:23) Exception in thread "main" >>> I can't pinpoint the problem exactly. I stripped down my two projects to the smallest set of code I could find that still reproduced the problem (and also work using 2.1.1). I've placed a zip on a public server containing the two projects, as well as my preferences file. The file can be found at: http://www.slac.com/cnelson/eclipse-bug.zip There are two projects, one called aaw_common and another called aaw_product_tool (which depends on aaw_common). In the top-level of aaw_product_tool, my preferences and config details for 2.1.1 and 3.0 M3 can be found. Please let me know what I can do to help with this... I'm a bit stumped, but given some guidance, would like to help figure out what's going on exactly. Best regards, Christian
Created attachment 5915 [details] Code (and details) that fails to execute on 3.0. There are two projects... aaw_common and aaw_product_tool (depending on aaw_common). Under 3.0, ProductTool.main() throws an IllegalStateException when run, under 2.1.1 it runs fine. Preferences and configuration details may be found in the top-level aaw_product_tool directory. This file is also available at: http://www.slac.com/cnelson/eclipse-bug.zip
Problem reproduced. It comes from the fact the class literal is no longer supposed to initialize the referenced class, which your code relies upon. For instance, the following works fine: try { DefaultComboBoxModel cbm = new DefaultComboBoxModel (EnumBean.getEnums(Class.forName("com.aaw.common.enum.ProductType")).toArray()); } catch (ClassNotFoundException e) { } Also see bug 37565 for further details. *** This bug has been marked as a duplicate of 37565 ***