Anyone came across this cfdump issue?

Tagged Under :

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.

Validate IP Address Natively with Coldfusion

Tagged Under :

I have been looking for these little gems recently and everytime I happen to find something new. Although, I dont blog about everything I find, this one is worth it I think.

Normally in order to validate an IP address, we would use some kind of regular expression but Coldfusion has an inbuilt class for validating IP addresses. Both the v4 and v6 addresses. Not an IP expert, have a look here for an explanation of what they exactly mean. So, here is the code :- More »

corrupt table null errors with Coldfusion

Tagged Under : ,

I was asked this question last night by someone who had recently upgraded from CF5 to CF8. Coldfusion suddenly started throwing these errors on almost all the websites on the server.

“corrupt table null”

There was no consistency in how the errors were being thrown, in a way that refresh the page and error is gone and refresh the page and there it is again. A restart of CF would help for a few hours but then the error would come again. More »

Colored Code with Coldfusion

Tagged Under :

Just found this little thingy which according to me is quite impressive.

Now what that does is takes a file from your local folder and applies colored coding to it. Not the best colored code but a lot better than the heavy Regular expression.

Try it out !

CFQuery and the underlying Java Objects

Tagged Under : ,

Everything that Coldfusion does, is bascially Java under the hood, this is something almost everyone using Coldfusion would know. I have always been curious to find out more about this (basically to find out what more we can do by making use of this). Recently, I read some blog posts on how we can use Java Reflection to find out more about what Java object, each CF object is mapped to under the hood. So, I decided to do some of this as well and I choose cfquery. More »

Getting System Info with Coldfusion 8 and .NET

Tagged Under :

This is yet another example of how native .NET objects can be easily consumed from Coldfusion 8. Recently, I have been spending some of my time on this particular aspect of Coldfusion 8, as is obvious from some of my posts. For those who are not aware, Coldfusion 8 supports calling .NET objects simply by using the CFOBJECT tag or the CreateObject() method. You need to pass in the .NET assembly (ideally a .dll file) and the class of that assembly, as parameters to the CFOBJECT tag. By default, mscorlib (which is a .NET core assembly) is always included so there is no need to specify that if the class you are using happens to be one of the classes from this assembly.

More »

Help Needed : How to export your CF server settings?

 I need some help with this particular problem I have. How do you migrate over all your datasources/mappings/scheduled tasks etc from one Coldfusion server to another. I know you can do it by exporting the .car file but thats only if you have a enterprise edition of CF. Also, how to do this from Coldfusion 5 to Coldfusion 8?

I have done my search on this and havent been able to find anything. I have already started writing a little import/export tool to do exactly the same but I was wondering if anyone else has something I could use ? I am particularly interested in doing this from CF5 to CF8.

Thanks in advance for everyone who responds.

Different ways of making a Thread Sleep

Tagged Under : ,

There are several occasions when we need to stop processing the page for a period of time. Before the release of Coldfusion 8, we could use Java’s sleep function to do that. The purpose of this post is to list the ways available to make a thread sleep in server side code.

Here is the first one, the most common one :-

With the release of Coldfusion 8, we can now also use the native .NET objects from within Coldfusion, here is how this can be done using .NET objects.

And last but not the least, Coldfusion 8 supports this via the CFTHREAD tag as well.

And we can do it via the Sleep function as well

Choose SQL Server Instance in CF Administrator

Tagged Under :

Radek has written a nice tool using which you can add a custom button to your Coldfusion administrator which will let you choose a running Sql Server instance while adding a Sql Server datasource. Pretty slick I must say.

Directory Listing using Coldfusion 8 and .NET

Tagged Under :

After doing my first example with CF8 and .NET, I got a little excited and wanted to do more with it. I am not really a .NET guy and have very little know-how of how it works. However, I have been trying to do something rather useful with it and I thought it might be a good idea to actually try to mimick the CFDirectory functionality using .NET objects. I have done that previously in Java as well but this time around its .NET .

For those, who are not aware, the mscorlib assembly is always included by default whenever .NET objects are created using Coldfusion. Therefore, we dont need to specify explicitly the “Assembly” attribute in the CFOBJECT or CreateObject call. Because my example uses System.IO.DirectoryInfo which is a part of mscorlib, so I dont need to specify an assembly here.

More »