Posts

Showing posts with the label coldfusion

*FIXED* Setting you Railo / Lucee server to use TLS 1.2 by setting to use Java 1.8 instead of Java 1.7.

Image
TLS 1.0 support is being dropped by more and more platforms. If you are using your Railo / Lucee server to communicate with the service that have dropped the support using TLS 1.0, the request will not be honored. Here are the steps to have your Railo/Lucee server to use Java 1.8 instead of 1.7 and avoid this error. First verify the version of Java that your Railo Server is using. Go to Server Admin and check the version of Java used by Railo server. Instead of the 1.8.xx as show in the screenshot it will be 1.7.xx So, we need to install JDK 1.8 if not yet installed in the machine. Install JDK 1.8. 32/64 bit according to your server OS. Open Railo-Tomcat Service Control. Stop Railo. In the Java tab, give the jvm of the newly installed JDK. Something like C:\Program Files\Java\jdk1.8.0_121\jre\bin\server\jvm.dll. Restart Railo. Check the version of Java used in Railo Server Admin, it will be 1.8. Now your requests to the server will be TLS 1.2 and they will be ...

*SOLVED* Submitting Form with more than 100 fields shows blank page in ColdFusion9, 10

ColdFusion 9 & 10 by default have a setting to allow maximum 100 fields to be submitted. If the number exceeds you will simply get a blank page with no error information. To fix this, you need to change a setting in Adobe CF 9 and 10. ColdFusion 9 Go to {ColdFusion-Home}/lib for Server Installation OR:  {ColdFusion-Home}/WEB-INF/cfusion/lib for  Multiserver or J2EE installation . Open file  neo-runtime.xml After the line:  <var name='postSizeLimit'><number>100.0</number></var> Add the line  <var name='postParametersLimit'><number>100.0</number></var> and change the number 100 to the required value. ColdFusion 10 Go to Server Settings -> Settings then the to Request Size Limits section. There is a setting called Maximum number of POST request parameters. Change this value as required. Source:  https://www.obidostech.com/knowledgebase/solved-submitting-form-with-more-than-100-fields-...

*FIXED* QuickBooks Integration Error - EDGE-CR-ERR-8090 - Auth ID does not exist

Integration with QuickBooks is easy if you know the OAuth flow. QuickBooks uses the OAuth 1.0 specification. They provide libraries for PHP, Java and other popular languages. For ColdFusion/Railo, you can use the OAuth implementation from  http://oauth.riaforge.org/ .  Usually the error messages from QB are self-explanatory and are mostly related with Signature or the Access token/secret. This one particular error left us a bit embarrassed as there were no help available. But we quickly found it was a data issue.  The error while trying to retrieve data from QB is as follows:

*SOLVED* Adobe ColdFusion Scheduled Task and PDF fail/error/not running - June 2016

The Adobe ColdFusion servers on Windows Servers and having SSL could develop and issue with Scheduled Tasks not able to run after June 2016. We have experienced this issue with one of our servers. The only information we receive when saving the output of a scheduled task to a file is "Connection Failure". Along with that while PDF is generated, it is missing the styles and image.

ColdFusion CFHTTP analogous to CURL

* This is a continuously updated post on the corresponding  CFHTTP  syntax for  CURL . If you need help, send me a message and I will try to help. I have been trying to integrate different APIs with ColdFusion/Railo recently and the difficult part is of course to understand the way the API is expecting data. Mostly they 3rd party will provide library or code for PHP and .NET, but not for ColdFusion. In some cases they provide the CURL syntax. I thought I will scribble my findings here so that it is useful for someone to write CFHTTP by seeing the CURL syntax. File Upload   e.g.:  to post a file to the folder /upload to the server. The URL is http://app.prasanthkumars.com/upload the API uses Basic Authorization File name is test.png CURL curl -f file=@test.png "http://username:password@app.prasanthkumars.com/upload" CFHTTP <cfset credentials = tobase64("#username#:#password#")> <cfhttp method="POST" url="htt...

Railo error - java.lang.UnsatisfiedLinkError - when using C++ based CFX tags.

Image
Railo does have a hidden link to add C++ based CFX tags. To enable it, use the following link. http://localhost:8888/railo-context/admin/web.cfm?action=resources.cfx_tags&enable=cfxcpp Just add the tag name and path of DLL and you are good to go. We had to use a C++ based custom tag for our application and everything was fine on our development servers. But when we tried this on Live, we are presented with a Java error. The message is "com.naryx.tagfusion.cfx.CFXNativeLib.processRequest(Ljava/lang/String;Ljava/lang/String;Lcom/naryx/tagfusion/cfx/sessionRequest;Lcom/naryx/tagfusion/cfx/sessionResponse;Z)V" The error says "Railo 4.1.1.009 Error (java.lang.UnsatisfiedLinkError)" and we first thought it was an issue with the CFX tag compatibility with the version of windows. But on closely checking we can see that the Railo version on Live was 4.1.1.009 and that on development is  4.2.1.008. To confirm the error, we took the express editio...

Coldfusion - Using ListFind and Split to get empty elements in a list

I am working with a lot of data import modules in ColdFusion and there are a lot of issues to handle while doing the import process. The data uploaded will be of different format, different delimiters, empty or null values etc. etc. Here, I am describing a problem where the delimiter is tab and the first element is null. I had to check whether the first element is null. I tried using ListGetAt(stringVariable,1,Chr(9)). Now, what this returned was the first non-empty element and not possible to check whether the first element was null.

MySQL default value to integer fields with LOAD DATA from CSV file import with dynamic fields

I was confronted with a problem while loading data from file to the MySQL table. The table have some Integer and Varchar fields and the data is loaded from CSV. Normally the data loading process goes well, but in case the data does not exist for a Integer field, the import breaks and show error like :  Incorrect integer value: '' for column 'ID' at row 1 The fields are dynamic that I can determine the fields in run-time only.  So, I devised a solution for this. I have created the query such that for all the fields with Integer type, I add a '0' with it.  Here are the steps.

Macromedia still in the heart of Adobe ColdFusion

I have been using ColdFusion from version 7 MX. Now, in the ColdFusion 9 also, if you try to browse a cfm page without starting the ColdFusion service, you get this error. Server Error Either the Macromedia application server(s) are unreachable or none of them has a mapping to process this request. I am not sure why Adobe have not removed this reference. May be Adobe kept it as such so that others think it is Macromedia's fault, not Adobe's :-)

User types in the wrong address. Your site generates a 404 error, and calls your custom coldfusion 404 handler.

I found an interesting topic in Raymond Camden's blog. This is about "Better handling of missing files with your web application". Here is the link to the page http://bit.ly/ed8NOf .

CFContent is not creating Excel file

Image
I am facing a weird problem with my ColdFusion server. I cannot export data to Excel using the <cfheader> and <cfcontent> tags. If I create an Excel file, the content will have all the table, tr, td tags. It had been long time since I tried this so think I must have changed some settings in CFAdmin . I will try to fix this and post an update. If any of you have an idea on how to resolve this, please comment. ***** UPDATE  ***** This was actually not a problem with ColdFusion. The Open Office was the problem. It was not rendering the content correctly.

ColdFusion 8 Decrypt error with CFMX_COMPAT algorithm hotfix

I was trying with encryption and decryption in ColdFusion for a demo iPhone app using SOAP. Well, the problem was with the ColdFusion end. I tried with default (CFMX_COMPAT) algorithm. I was getting an error "The input and output encodings are not same" while decrypting. After trying to fix this for some time, I googled and found that it was the problem with ColdFusion 8 (bug ID : 75676) and need to apply the hotfix (Cumulative Hot Fix 3 for ColdFusion 8.0.1). I applied it to the server and the error was resolved. Hot fix can be obtained from here.   Cumulative Hot Fix 3 for ColdFusion 8.0.1

Adobe Flex launch event at Kochi (KADUG)

Image
I got the opportunity to attend the Adobe Flex launch event at Kochi, thanks to @Juwalbose , @Jerrydon and others. They made it happen. After the first meeting of GOD s a few months ago which I was not able to attend, they should have worked really hard to organize this event. I was really happy to see my ex-colleagues and of course, my friends at GODs and twitter. This was the first time I met them in person. I got new friends too from this event. It was nice meeting them. I reached a bit early for the event and got some time to chat with others. @Harish Sivaramakrishnan did the first presentation about Flex . Even though he reached a bit late due to a delay of his flight, the wait was worth. I was amazed to see the new capabilities of Flex builder . The developer does not even have to touch the code to achieve something, and that too like creating a full fledged video player !. Awesome. I had moved away from Flex development around 1 year ago, but seeing his presentation I...

Adobe released ColdFusion builder.

Image
Adobe released ColdFusion builder. See the link  http://www.adobe.com/products/coldfusion/buy/#cfb It comes lot of facilities and support for ORM with ColdFusion 9. You will also get a complimentary copy of Flash Builder 4 Standard with this version.

View debug/log information inside Eclipse with NTail

Image
Implementing Debugging and Logging functionality in your application will help you a lot when tracing the details of an error - while developing and also after deployment. There are lot of libraries out there like log4j , which you can integrate with your app for easier log management. Log4j/log4net have the provision to either log the information to a file or send email . So, will it be helpful if you can directly see the logs in Eclipse that will get updated whenever the log file gets updated ? Using NTail, you can achieve this. The content of the log file will be shown in a window inside Eclipse which will automatically get updated. Steps:

Create a Zip file and make available for download using Coldfusion 8

Image
Coldfusion 8 has the tag CFZIP by which we can zip/unzip a folder in the server. For creating a file download, that is, the user will be prompted for saving the file, we can use CFHEADER tag. We can use CFCONTENT tag to deliver the content in an unpublished directory (not mapped to web server) to the user. Now, let us begin with cfzip. <cfzip action="zip" source="C:\myfiles\myphotos" file="c:\download\myphotos.zip">

Give footer for CFPresentation Slide

Image
You can create presentations using CFPresentation in ColdFusion 8 . It is very fast and gives the developer a lot of options like showing notes, outline and search. You can include text, Image and swf movies to a presentation. But, if you want to create a footer section, that is not readily available. To create a footer section, you can put a div inside the CFPresentationSlide and align such that the content is always displayed at the bottom. Use the code below to show the footer section in the presentation. <div style="position:absolute;top:70%"> <font style="font:verdana;font-size:8px;">© Prasanth Kumar.S</font> </div>

Generate Fibonacci series using recursion with ColdFusion

Image
Recursion is a method which has been popular from the earlier age of computing. In simple terms, recursion is the process in which a function/method calls itself again and again till a condition is satisfied. It is mainly used to generate or find the sum of series of numbers like Fibonacci series. I seldom had chance to implement the recursion in programming. Lately I had to create a dynamic menu structure using Ext JS and I found recursion was the answer. I was able to neatly create the menu dynamically to 'n' levels. As the creation of menu includes Ext JS and other dependencies, I will try to explain the concept with generating Fibonacci series numbers in ColdFusion . As noted before, recursion is the process of a function calling itself again and again. It is infinite, so we will restrict our demo to values till 50 . Let us first look what a fibonacci series is. The series propagates in a manner such that a number in the series is the sum of two preceeding numbers an...

Create shortcut for restarting ColdFusion 8 server

Image
     While developing applications in ColdFusion we may have to restart the CF server occasionally. We have to go to "Windows Services" and then restart the server. This can easily be achieved by creating a shortcut for the restarting process so that you can just click and restart the CF application server without going to the windows services window.      For this, you have to first find out the location of jrunsvc.exe. You can find this by going to Services window (by running services.msc) and open the ColdFusion 8 Application Server. Take the whole path from "Path to executable" along with quotes. Also take the "Service name" (this should be "ColdFusion 8 Application Server"). Now, open a notepad and enter two lines as below. <"Path to executable"> -stop <"Service name"> <"Path to executable"> -start <"Service name"> and save the file as a batch file with a name of your c...

Remove unnecessary blank lines from the ColdFusion output

ColdFusion outputs blank lines on the data sent to the browser which can sometimes get higher that it will be many times higher than actual output lines. In some cases this will eat into the bandwidth. To avoid this, check the 'Enable Whitespace Management' under 'Settings' in ColdFusion Administrator. This will remove many of the extra spaces, tabs, and carriage returns that ColdFusion might otherwise persist from the CFML source file. Enabling this could lead to a minor performance issue with the CF Server, but compare with the bandwidth gain and decide to use this feature.