1 Reply Latest reply on May 18, 2006 5:11 PM by CPT

    CFMX 7 java class loading bug?

      We're running into problems with existing custom java classes as we move to MX7. It appears that the MX7 java class loader does not behave as expected - it certainly behaves differently than in MX6.

      Symptom: When calling some custom java class methods the browser displays and error message: 500 java/package/name and a java.lang.NoClassDefFoundError is generated in the exception.log file.

      To reproduce the error, place a custom java classes in the WEB-INF/classes directory or a custom jar file in the WEB-INF/lib directory and invoke using a cf wrapper. If you look at the exception log, you will see a java.lang.NoClassDefFoundError, which indicates that the class was not correctly or fully loaded. The class loader appears to load the class - no Object Instantiation exception occurs - yet it throws the NoClassDefFoundError exception when invoking _some_ methods. The problem is difficult to isolate because _some_ class methods work while others do not.

      The CFMX 7 release notes for J2EE servers mention new class loading. Specifically, the context-param items in the web.xml file. These are the cf.lib.path and the cf.class.path. I'm not sure how this applies to CFMX servers not loaded on a J2EE server ...

      Anyway, the workaround I have found is placing the jar file in WEB-INF/cfform/jars or in the CFusionMX7/lib directory and restarting the server. This is an obvious problem for development as the these are not dynamic class loading directories and any changes made to classes therein require a server restart to be effectuated. We also used to add the following code to the jrun-web.xml file in order to facilitate dynamic class loading:


      But this has no effect in CFMX7.

      So, these are the issues:
      1. Classes located in WEB-INF/classes or jars located in WEB-INF/lib are not loaded as expected and can throw java.lang.NoClassDefFoundError. This seems to go against the J2EE spec, but it's been a while since I've actually read it ;-)

      2. Dynamic loading of java classes does not appear to be enabled in the server.

      Occurs on both boxes and all JVMs:
      OS: Windows 2003 Server and XP Pro
      Web Server: IIS and built in dev
      JVMs: 1.4.2_05, 1.4.2_06, 1.4.2_11

      Adobe, any help is appreciated resolving these issues.