-1

One of my ColdFusion 8 templates that uses CFObject can't find a class file that's sitting in the same folder. Anyone have an idea what the trouble is?

UPDATE:

  • OS: CentOS5
  • CF Version: 8

My class file is located here: /foler1/folder2/folder2/MyClass.class

When I try and use <createobject class="MyClass" ...> from a script in the same directory, I get the error message:

Object Instantiation Exception. Class not found: MyClass

Leigh
  • 28,765
  • 10
  • 55
  • 103
HugeBob
  • 467
  • 1
  • 5
  • 14
  • 5
    Put more relevant information, like error message, log from server, etc. – Jorge Campos Nov 20 '13 at 14:19
  • 5
    .. Also [you cannot just place class files anywhere](http://stackoverflow.com/questions/12304479/coldfusion-about-using-custom-own-written-java-classes/12304757#12304757). They must be in the CF class path (see item #3). – Leigh Nov 20 '13 at 14:39
  • 3
    Added to what @JorgeCampos says, posting rather than simply describing the code always helps. THat said, Leigh has answered your question, really. – Adam Cameron Nov 20 '13 at 14:53
  • 4
    *posting rather than simply describing the code always helps* .. And not just by helping us to answer your question. [Including more context/details](http://stackoverflow.com/posts/20098299/edit) (hint, hint ;) also helps the next guy searching for an answer to the same problem. – Leigh Nov 20 '13 at 14:58

1 Answers1

3

Thanks for your replies. I solved the problem by placing the folder the class file is in, in the ColdFusion Class path in the CF Administrator under Server Settings > Java and JVM. So, if the class file is MyClass.class is under /foler1/folder2/folder2, I put that folder in that entry. I then restarted CF. This did the trick.

Leigh
  • 28,765
  • 10
  • 55
  • 103
HugeBob
  • 467
  • 1
  • 5
  • 14