Skip to main content
August 8, 2006
Question

Loading Resource from Java CLASSPATH break with MX 7.0.2 Enterprise

  • August 8, 2006
  • 3 replies
  • 401 views
I have a couple ColdFusion applications which call Java classes which load files (images, etc) found in the Java CLASSPATH. This worked fine with ColdFusion 7.0 and 7.0.1 but fails unable to find the files with ColdFusion MX 7.0.2 Enterprise. I have tried these applications with the same result on both Windows and Unix installations. Back out to version 7.0.1 and the applications work again.

The problem only happens on the Enterprise edition. Upgrading the Developer edition on my PC to 7.0.2 did not cause my applications to break. However, every server running Enterprise edition upgraded to 7.0.2 is no longer able to use Java classes that call Class.class.getResourceAsStream(path);

Has anyone else encountered this or can suggest a good work around that would allow resource files to be laoded without hard coding paths since the application may run on multiple platforms or be moved around.

The following code segments output the contents of a text file. The text file is located in a directory included in the Java classpath. This code example works on any version of the developer edition of ColdFusion and version 7.0 and 7.0.1 of the Enterprise edition. It fails on Enterprise edition 7.0.2. I tested this on both Windows 2000 and Solaris 9 servers.

-----------------------------------
    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    December 28, 2006
    In each server running Enterprise Edition 7.0.2, create a mapping for all the relevant paths.

    Participant
    December 28, 2006
    When you say fails on Enterprise edition 7.0.2 can you please tell what is the error/exception you got?
    Did you manage to fix it somehow? I seem to be facing similar problems!
    Inspiring
    August 8, 2006
    I have no ideas, but did think to ask one question. Is it possible the
    Java class path is different on the 7.02 enterprise system then the others?

    HisDivineShadow wrote:
    > I have a couple ColdFusion applications which call Java classes which load
    > files (images, etc) found in the Java CLASSPATH. This worked fine with
    > ColdFusion 7.0 and 7.0.1 but fails unable to find the files with ColdFusion MX
    > 7.0.2 Enterprise. I have tried these applications with the same result on both
    > Windows and Unix installations. Back out to version 7.0.1 and the applications
    > work again.
    >
    > The problem only happens on the Enterprise edition. Upgrading the Developer
    > edition on my PC to 7.0.2 did not cause my applications to break. However,
    > every server running Enterprise edition upgraded to 7.0.2 is no longer able to
    > use Java classes that call Class.class.getResourceAsStream(path);
    >
    > Has anyone else encountered this or can suggest a good work around that would
    > allow resource files to be laoded without hard coding paths since the
    > application may run on multiple platforms or be moved around.
    >
    > The following code segments output the contents of a text file. The text file
    > is located in a directory included in the Java classpath. This code example
    > works on any version of the developer edition of ColdFusion and version 7.0 and
    > 7.0.1 of the Enterprise edition. It fails on Enterprise edition 7.0.2. I
    > tested this on both Windows 2000 and Solaris 9 servers.
    >
    > -----------------------------------
    August 9, 2006
    All the ColdFusion servers I work with I install and configure myself. I did think maybe the patch altered the classpath on my but after checking the "System Information" in ColdFusion administrator the necessary paths were still listed as a "Server Classpath."

    It also is not just one server. I get the same thing on a Windows 2000 Server and a Solaris 9 server. With 7.02 they don't work, with 7.01 they do.