Anyone came across this cfdump issue?

On March 9, 2008, in ColdFusion, by Anuj Gakhar

The issue is really weird. What’s happening is that whenever <cfdump> tag is used anywhere in the code, it throws an error like this.

Permission denied for creating Java object: coldfusion.util.DumpHelper. Access to Java objects in the ColdFusion package has been disabled by the administrator

The server is CF8 with access to internal Java Objects disabled. I have checked all the application.cfm files that can possibly be called and there are no Java objects being used anywhere. It might be worth mentioning that there is a CFC which is being used on the server which uses some Java objects but those Java objects are not the CF’s internal objects, so that should be fine and that CFC works just fine when called.

I have spent a few hours trying to figure this out and I am at a loss as to what’s going on with <cfdump> here. I have tried to reproduce the error to get to the bottom of it but there is no consistency in its behaviour. Here is what I did :-

  1. Keep the access to Java Objects disabled and restart CF.
  2. Create a Java Object that uses internal CF object and get a ‘Permissions denied’ error as expected.
  3. Now comment that line of code which uses the internal CF object, and use a simple <cfdump> tag that dumps any var.
  4. Unexpectedly, It would throw the error I stated above (not always though – it did this just once, the first time)
  5. Enable access to internal Java objects and the error is gone, as expected.
  6. Disable the access again and you might see the error again.
  7. Repeat the whole exercise and you might see the error thrown by cfdump at Step 4.

Anyone came across this issue ever? Any info would be appreciated. This is a very useful tag and is used all the time while coding and its a big issue when it doesn’t work.

Tagged with:  

9 Responses to Anyone came across this cfdump issue?

  1. Hmm, I can’t replicate this on CF8/Windows XP.

    I disabled internal objects, tried dumping with no error.

    Then tried accessing createObject(“java”,”coldfusion.runtime.SessionTracker”); with error as expected.

    Removed the call to that java object and had no error (with original dump).

    Very strange 🙁

  2. Nolan Erck says:

    cfdump makes an “internal” call to the same functions that CreateObject( “java” ) does (it might actually just call CreateObject() itself — I haven’t investigated it that far). If you’re on a shared hosting server, and they have CreateObject( “java” ) turned off, cfdump will bomb as well. I ran into this issue a while back; if CreateObject(‘java’) is disabled on your box, cfdump will throw that error.

    hth

  3. Anuj Gakhar says:

    @Michael, thanks for trying. As I said it is incosistent. I was able to reproduce it only on one of the 2 machines I tried.

    @Nolan, I realize cfdump makes an internal call but its nowhere documented that its a requirement to have access to java objects enabled to have cfdump working. I would call it a bug if thats the case.

  4. MrBuzzy says:

    Nolan’s right, I have experienced this error myself. My hosting has createobject(type=java) disabled in my sandbox.
    It’s pretty annoying, I coded my own cfdump like tag for this scenario. cfdump just needs additional internal error handling.

  5. Anuj Gakhar says:

    But isnt this a bug then ? I wonder why this was never reported to Adobe…

  6. Well the reason behind it is that CFDUMP was not originally a native CF tag, it was a 3rd party tag so was written in CFML. Adobe then decided to include it with CF being as it was such a popular and useful tag, but they never rewrote it, so it is still written in CFML rather than Java.

    The same applies to CFSAVECONTENT.

  7. Anuj Gakhar says:

    @Russ, I didnt know that. Thanks . But my question is still the same, why would it throw an error if access to Java objects is disabled. Surely, if it was written in CFML, it should have been written in a way that its not dependant on Java access permissions.

  8. It uses java, as this is the most efficient way to do it. The reason why is because Macromedia/Adobe never properly considered or tested for the shared hosting environment with any of their releases. They threw in a few features here and there with the sandboxing, but clearly never evaluiated the consequences of actually using sandboxes, I have documented many issues for them.

    You could do it in pure CFML and I believe there is an alternative tag floating around that does do that.

  9. Justin says:

    I had this issue with a mapping in application.cfc that pointed to “/”. It didn’t like it. I had it in there for testing purposes and forgot about it as it was really unnecessary. I know this post is old, but it is #1 for google result and thought I’d put my two cents here.

    THIS.mappings[“/”] = foo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 446 other subscribers

© 2011 Anuj Gakhar
%d bloggers like this: