Quantcast
Channel: Adobe Community : Popular Discussions - ColdFusion
Viewing all 14291 articles
Browse latest View live

Insert into DB from the coldfusion query recordset

$
0
0
Hi,

I need to insert to the DB from CF query recordset.
The simplest way to do is using cfloop on the query and the INSERT INTO TABLENAME within the loop.
It is working, but it's creating multiple insert SQL statements and it is very match slow. Some times, if the records are more then thousands, it giving the query timeout error.
How else I can accommodate this task to make it faster?

Thanks in advance
Ed

PKIX path building failed: java.security.cert.CertPathBuilderException: Could not build a validated path

$
0
0

On my HTTP request, I kept getting this error.

 

handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: java.security.cert.CertPathBuilderException: Could not build a validated path.

Sep 16, 2016 10:26:14 AM Error [ajp-bio-8013-exec-2] - ERROR: failed to read from https://myapps.example.com/units.json. Response code: 'Connection Failure.  Status code unavailable.' Error details: 'I/O Exception: sun.security.validator.ValidatorException: PKIX path building failed: java.security.cert.CertPathBuilderException: Could not build a validated path.'

 

I found this page, https://www.hass.de/content/coldfusion-java-pkix-path-building-failed-javasecuritycertcert pathbuilderexception-could-not , that talks about the same exact error that I have. However, it didn't resolve my issue even though I verified that the certificate is already exist in my cacerts file.

Peer not authenticated - Connecting to 3rd party API over SSL

$
0
0

(CF8.01 server with Windows 2008 Server R2 - Java installed in C:\Program Files\Java\jre6)

 

I have no problems connecting with CFHTTP from a local dev box to one of our domains on a server with SSL. I also have a domain that uses a PayPal API over SSL which appears to be working still. However I've recently tried to integrate with another 3rd party and I can't get it to connect

 

I receive a peer not authenticating error, as detailed in the link below

Diagnosing a CFHTTP issue - peer not authenticated · Raymond Camden

 

I tried the fix at the top of Raymonds page but it would not work, it just throw errors. I've been through the thread which at one point led me to an instructional page here Naveen Chhabra's Blog | Just another WordPress.com site  which suggested that you take the certificate from the third party server and install it on the CF server. However I struggled with that because it was asking for a keystore password, which I don't know and can't seem to figure out how to set.

 

The more I read the more complex this appears to get.This page from Oracle gave me a headache keytool-Key and Certificate Management Tool

 

It's odd how I'm able to use PayPal, and also connect to my other domains on SSL from the dev box, and yet this particular third party won't work.

 

I'm also concerned that if I install their certificate that once it expires that the function will then fail.

 

I've read the previous forum posts and can't seem to find a solution, I also seem to be the only person with this issue on CF8, the other reports are CF9 or CF10

 

Can anybody please help me resolve this issue

 

Thanks

 

Mark

404 - File or directory not found for second coldfusion site in IIS

$
0
0

Hi,

 

I've installed coldfusion 2018 on windows server 2016 and added 2 websites in IIS one is loading coldfusion page fine and second one is throwing 404 error physical path of both IIS websites is same C:\inetpub\wwwroot\ Any idea what would be going wrong ? Hosting server is AWS EC2 windows instance.

 

Thanks !

Sikander

Problem integrating Google reCaptcha v2 into a simple form

$
0
0

I am at my wits' end attempting to integrate Google's recaptcha v2 with a simple HTML form. I hope someone can help.

 

In the <head> of the form page I have

 

    <script src="https://www.google.com/recaptcha/api.js" async defer></script>

 

as directed by Google.

 

Within the form I have

 

    <div class="g-recaptcha" data-sitekey="xxxxxxxxxxx"></div>

 

where xxxxxxxxxxx is the sitekey provided by Google. When the form is displayed, this is properly creating the recaptcha widget.

 

On the target page that processes the form submission, I have this:

 

    <cfset form.RecaptchaResponse = "">

    <cfif StructKeyExists(form, "g-recaptcha-response")>

           <cfset form.RecaptchaResponse = form["g-recaptcha-response"]>

    </cfif>

 

    <cfhttp url="https://www.google.com/recaptcha/api/siteverify" method="post" result="captchaResult">

      <cfhttpparam type="formfield" name="secret" value="zzzzzzzz">

      <cfhttpparam type="formfield" name="response" value="#form.RecaptchaResponse#">

      <cfhttpparam type="formfield" name="remoteip" value="#cgi.remote_addr#">

    </cfhttp>

 

    <cfset result = "#deserializeJSON(StructFind(variables.captchaResult, 'FileContent'))#">

    <cfif result.success is "false">

        <cflocation addtoken="no" URL="/">

    </cfif>

 

     ...start processing the submission.

 

where zzzzzzzz is the secret key provided by Google.

 

First I intentionally submit the form without responding to the captcha. I dump the variable captchaResult (a structure). Its 'FileContent' key is a JSON string, and in that string, 'Success' is 'false'. This submission redirects to the site's home page -- exactly as desired.

 

Next I submit the form correctly, including responding to the captcha. Dumping captchaResult and then aborting, I see that 'Success' is 'true'. In other words, Google is definitely passing this submission.

 

So now I reload everything and resubmit correctly, including responding to the captcha. ColdFusion replies with this on my target page:

 

   We're sorry...

 

    Element G is undefined in FORM.

    The error occurred on line 1.

 

What the #$% is going on?? Any suggestions will be gratefully and humbly accepted.

 

Message was edited by: Jordan Backler Forgot to include that I am using CF 10

Filemaker Error Code?

$
0
0

Hi everyone,

 

Its been stumping me for a few days and I thought I'd ask the experts out here.

HelpHere.PNG

 

Basically, its not recognizing my variable, although it has been set already.

 

Am I using the wrong syntax?

 

I'm using ColdFusion 10 and using Filemaker Pro Advanced 15.

Convert Javascript variable to coldfusion variable

$
0
0

Hi,

 

Can anybody assist me how to convert a javascript variable to Coldfusion variable.

 

What i m trying is,

 

<script>
var manasa = "hello world";
</script>

 

<cfset myVar = assign above js variable value here>

<cfoutput>#myVar#</cfoutput>

 

Thanks in advance,

 

Regards,

Manoz

CF10 Framework Vulnerability Question

$
0
0

Received information that a vulnerability (CVE-2018-11776) has been identified for web-based applications with the Tomcat, Apache and Coyote frameworks. We are currently using ColdFusion 10,283111 and I am not sure how to verify if we are at risk or not.  Anyone know how I could get that information or find out if that vulnerability is applicable to CF10?

 

More info on the CVE:

CVE-2018-11776 is a remote code execution flaw that allows an attacker to gain control over Struts-based web applications.


Affiliate sites - sub domains

$
0
0
Situation:
We have a number of self employed agents who promote our properties while we provide the support/properties/etc.. We provide a web site for them to use that can display their details or our as required. The settings are determined by a simple URL variable in the link to the site:
e.g. http://www.globalpropertylink.com/?intId=151

This is not ideal and I would like to use dynamic sub domains for the sites:
e.g. http://AGENT_COMPANY_NAME.globalpropertylink.com

I simply do not know how this is done? Does this involve URL rewriting software or is there some way to do it in CF?

Please can someone give me some pointers and topics to research.

I have looked at : http://mkruger.cfwebtools.com/index.cfm?mode=entry&entry=8F4658E4-0763-5FB7-67D23B839AB740 05

but I need the sub domain part to be kept in the URL so I don't think it will work.

Thanks.

Separating a string from a form box into individual Characters and display

$
0
0

Good morning,

 

i am using CF2016 on a window PC.

 

At my job i  have the role of adding new hires into our card reader box so that new employees can enter into our office. I often can get up to 10 new employee request per day. I devised a rather complicated way of converting each character of their last name into a number format so that i can quickly punch their name info into nine-digit keypad of the card reader box. The letter arrangement of the key pad is similar a touch-tone phone.

 

I currently have two Cf pages to do what i need. The first page is a basic form with 6 text boxes that will only allow 1 character per box for the person last name. the second page is a series of conditional statements that will assign a numerical value to each character.

 

What i want to accomplish is to have one text box that i can enter the entire last name of the new employee and then have Coldfusion separate each character from the input box of the previous page and assign then display the same numerical values. Below is an abbreviated version of my current code for each page. i have enter last name of "Nelson" into each individual box.

 

Is there a simpler way to do this?

 

<!---First Page. The Form--->

<form class="form-inline"action="fob_assign1.cfm"enctype="application/x-www-form-urlencoded"nam e="form1"method="post">

<form class="form-inline">

 

  <input type="text"name="box1" maxlength="1"tabindex=1 size="4">

  <input type="text"name="box2" maxlength="1"tabindex=2 size="4">

  <input type="text"name="box3" maxlength="1"tabindex=3 size="4"> 

  <input type="text"name="box4" maxlength="1"tabindex=4 size="4"> 

  <input type="text"name="box5" maxlength="1"tabindex=5 size="4"> 

  <input type="text"name="box6" maxlength="1"tabindex=6 size="4"> 

 

<div class="form-group">

<button  class="btn btn-primary btn-lg btn-block" type="submit" value="Submit">Submit</button>

</div>

 

</form>

 

 

 

<!---Second Page. Condition Statements--->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

</head>

 

<body>

<cfif '#form.box1#' EQ "A">2#

<cfelseif '#form.box1#' EQ "B">22#

<cfelseif '#form.box1#' EQ "C">222#

<cfelseif '#form.box1#' EQ "D">3#

<cfelseif '#form.box1#' EQ "E">33#

<cfelseif '#form.box1#' EQ "F">333#

<cfelseif '#form.box1#' EQ "G">4#

<cfelseif '#form.box1#' EQ "H">44#

<cfelseif '#form.box1#' EQ "I">444#

<cfelseif '#form.box1#' EQ "J">5#

<cfelseif '#form.box1#' EQ "K">55#

<cfelseif '#form.box1#' EQ "L">555#

<cfelseif '#form.box1#' EQ "M">6#

<cfelseif '#form.box1#' EQ "N">66#

<cfelseif '#form.box1#' EQ "O">666#

<cfelseif '#form.box1#' EQ "P">7#

<cfelseif '#form.box1#' EQ "Q">77#

<cfelseif '#form.box1#' EQ "R">777#

<cfelseif '#form.box1#' EQ "S">7777#

<cfelseif '#form.box1#' EQ "T">8#

<cfelseif '#form.box1#' EQ "U">88#

<cfelseif '#form.box1#' EQ "V">888#

<cfelseif '#form.box1#' EQ "W">9#

<cfelseif '#form.box1#' EQ "X">99#

<cfelseif '#form.box1#' EQ "Y">999#

<cfelseif '#form.box1#' EQ "Z">9999#

</cfif><br>

 

 

<cfif '#form.box2#' EQ "A">2#

<cfelseif '#form.box2#' EQ "B">22#

<cfelseif '#form.box2#' EQ "C">222#

<cfelseif '#form.box2#' EQ "D">3#

<cfelseif '#form.box2#' EQ "E">33#

<cfelseif '#form.box2#' EQ "F">333#

<cfelseif '#form.box2#' EQ "G">4#

<cfelseif '#form.box2#' EQ "H">44#

<cfelseif '#form.box2#' EQ "I">444#

<cfelseif '#form.box2#' EQ "J">5#

<cfelseif '#form.box2#' EQ "K">55#

<cfelseif '#form.box2#' EQ "L">555#

<cfelseif '#form.box2#' EQ "M">6#

<cfelseif '#form.box2#' EQ "N">66#

<cfelseif '#form.box2#' EQ "O">666#

<cfelseif '#form.box2#' EQ "P">7#

<cfelseif '#form.box2#' EQ "Q">77#

<cfelseif '#form.box2#' EQ "R">777#

<cfelseif '#form.box2#' EQ "S">7777#

<cfelseif '#form.box2#' EQ "T">8#

<cfelseif '#form.box2#' EQ "U">88#

<cfelseif '#form.box2#' EQ "V">888#

<cfelseif '#form.box2#' EQ "W">9#

<cfelseif '#form.box2#' EQ "X">99#

<cfelseif '#form.box2#' EQ "Y">999#

<cfelseif '#form.box2#' EQ "Z">9999#

</cfif><br>

 

....... this continues on until the 12th box </cfif>

 

<!---Final Display--->

Below are the numbers on the key pad that i will enter for the last name "Nelson" is as follows

 

N = 66#

E = 33#

L = 555#

S = 7777#

O = 666#

N = 66#

上海哪家医院做试管代孕提供卵子188.9876.1005电

$
0
0

My editor freezes on me every day, at least once, and sometimes a lot more. Today it's happened 4 times. I never know when it's going to happen, but it seems to happen more often when I'm working on large files with a mix of cfscript, cftags and html syntax. To get back to work, I have to close the eclipse window, sometimes clicking the close box 2 or 3 times, then force quit the eclipse process from the task manager, and then I can restart eclipse.

 

I'm running Windows 7 (x64), eclipse 3.5.1 build M20090917-0800  (x32) and ColdFusion Builder 1.0.0.263215

 

I cannot start without errors that show up in my log, even after I clear it.

 

I attached my log file.

Random Net connection call failed errors

$
0
0

Hi All,

 

I've built a Flex application which is calling coldfusion CFC through remote objects in order to retrieve data.

 

2 days ago, I've updated the server with coldfusion 9 and my issue is that I have sometime those kind of error messages :

 

[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Failed"]

 

[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Status 503"]

 

[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Status 500"]

 

[RPC Fault faultString="error" faultCode="Channel.Call.Failed" faultDetail="NetConnection.Call.Failed: HTTP: Status 504"]

 

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://servername/flex2gateway/'"]

 

It was also happening on Coldfusion 8 and even on one other sever with another application.

(but same logic  Flex -> remote Objects -> CFC -> sql2005).

 

When we were still running CF8 I added this <add-no-cache-headers>false</add-no-cache-headers> to the service-config.xml file but with no success.

 

I do not know if it's related to this but I also sometimes have this error message :

[RPC Fault faultString="Channel disconnected" faultCode="Client.Error.DeliveryInDoubt" faultDetail="Channel disconnected before an acknowledgement was received"]

 

Most if time the application is running fine, but I want to avoid this errors.

For example yesterday I recieved +- 50 times the NetConnection.Call.Failed error and 20 times Channel disconnected error.

 

Do not hesitate to ask if I need to post CF9 settings summary or something else.

 

Thank you for your help.

 

Aubry

Cold Fusion (Frame et fenêtre modale)

$
0
0

I have to display a modal window with bootstrap to display my error or warning messages, the modal page is inserted on each of my pages, The problem is that by doing my tests, I just found a page which contains 3 frames, each of which has a part of the form. My modal page then inserts on each of them but when displaying a message it remains prisoner of the frame, does not put on top either.

Someone has a solution?

thank you so much

 

IOException caught while copying on CFFTP

$
0
0
Hi all,

I have an application that transfers PDF files via FTP over a VPN links from different servers. Occasionally, the CFFTP will error with the message: An exception occurred when performing the FTP getfile operation. The cause of this exception was that: IOException caught while copying.

The problem occurs about 30 seconds into the transfer where it suddenly stops transferring, another 30 seconds later the error is thrown. If the file is small enough to transfer in 30 seconds or so, there is no error.

Active/passive doesn't seem to make a difference. There are no errors on the remote, nothing unusual in the IIS configuration.

CFMX7 7.0.2.142559 with Java version 1.4.2_09.

Does anyone have any thoughts on where it could be going wrong?

Thanks in advance,

Ian

Preventing search engines from spidering sections of your site

$
0
0

Hello, all,

 

I just recently learned that DISA (Defense Information Systems Administration) considers a robots.txt file as a vulnerability finding Category II.

 

https://vaulted.io/library/disa-stigs-srgs/apache_site_22_for_windows/V-2260

 

So, I will be forced to remove the robots.txt file from our public site.  Does anyone know of another way to prevent search engines from spidering certain sections of your website?  I just want to keep spiders out of our components folders.

 

V/r,

 

^ _ ^


Sending XML formatted text to web service

$
0
0

I have a series of forms that send information to various web services.

 

One is a login form, which consists of a username/password combo, and some other credentials specified in the code.  My CF code looks like this:

 

<cfinvoke    webservice="https://my.web.service.url/login?wsdl"    method="userLookupBySession"    returnvariable="appauth">        <cfinvokeargument name="applicationName" value="MYAPP" />        <cfinvokeargument name="accessCode" value="123456" />        <cfinvokeargument name="sessionId" value="#session.appid#" />        <cfinvokeargument name="endUserIPAddress" value="#CGI.REMOTE_ADDR#" /></cfinvoke>

 

And that works quite well.

 

Another form is a registration form.  Like the one above, it accepts four arguments.

  • Application name
  • Access code
  • User data, formatted as XML
  • User's IP address.

 

Here's my code:

 

<cfxml variable="userData"><cfoutput><USER xmlns:xsi="_http://www.w3.org/2001/XMLSchema-instance">    <ROW NUM="1">        <LOGIN_ID>#htmleditformat(userid)#</LOGIN_ID>        <PASSWORD>#htmleditformat(FORM.password)#</PASSWORD>        <NAME_LAST>#htmleditformat(FORM.name_last)#</NAME_LAST>        <NAME_FIRST>#htmleditformat(FORM.name_first)#</NAME_FIRST>        <NAME_MI></NAME_MI>        <EMAIL>#htmleditformat(FORM.email)#</EMAIL>        <OFFICE_PHONE>#htmleditformat(FORM.office_phone)#</OFFICE_PHONE>        <OFFICE_EXT>#htmleditformat(FORM.office_ext)#</OFFICE_EXT>        <OFFICE_FAX></OFFICE_FAX>        <OFFICE_STREET1>#htmleditformat(FORM.office_street1)#</OFFICE_STREET1>        <OFFICE_STREET2>#htmleditformat(FORM.office_street2)#</OFFICE_STREET2>        <OFFICE_CITY>#htmleditformat(FORM.office_city)#</OFFICE_CITY>        <OFFICE_STATE>#htmleditformat(FORM.office_state)#</OFFICE_STATE>        <OFFICE_ZIP>#htmleditformat(FORM.office_zip)#</OFFICE_ZIP>        <ORG_TYPE>#htmleditformat(FORM.org_type)#</ORG_TYPE>        <ORG_NAME>#htmleditformat(FORM.org_name)#</ORG_NAME>        <USER_TYPE>J</USER_TYPE>    </ROW></USER></cfoutput></cfxml>

And:

 

<cfinvoke    webservice="https://my.web.service.url/register?wsdl"    method="registerRequest"    returnvariable="regged">        <cfinvokeargument name="applicationName" value="MYAPP" />        <cfinvokeargument name="accessCode" value="123456" />        <cfinvokeargument name="userData" value="#userData#" />        <cfinvokeargument name="endUserIPAddress" value="#CGI.REMOTE_ADDR#" /></cfinvoke>

 

For some reason this fails, but if I have one of the server guys use the raw XML data, it works fine, so there's something wrong with my cfinvoke.

 

Has anyone else passed XML data to a web service?  Is there any special thing you need to do to format it?

CF licensing model

$
0
0

I recently spoke to an agent from technical support about CF licensing and he said he will connect me to someone from sales team but I never got a call back so I will try to get an answer here.

I don’t know which edition of CF I need to buy, standard or enterprise. I was informed licenses are issued on a Core basis. So if I’m using 2 VMs with 4 cores each, which edition do I need? And how many licenses? Can you send me a full description on how the licensing works? I can’t seem to find anything that helps on the website.

Why do I need to run the Web Configuration Tool?

$
0
0

While working through my migration from Windows Server 2008 to Windows Server 2016 (clean install) I came across a problem, none of my CFM files would load, I just got a 404 error.

 

I was running IIS, my root was the default innetpub/wwwroot for the CF2016 install, but my web sites are in another directory.

 

When I installed my 2008 server some time ago everything went fine. I did recently notice the two mappings for CF_scripts and Jakarta, and wondered where they came from. I'm pretty sure CF was installed and then I went to IIS to add my sites.

 

This time things were different, after pulling my hair out for an hour or two I realized that those mappings were not present. I ran the Web Site Configuration Tool, removing the ALL setting and then putting it back, and all of the mappings were now present and the sites were now working fine.

 

The question I have is, why am I now having to run this when I didn't have to do it before and does this mean I'll need to run it every time I add a new site?

 

Is there anything I can/should do when installing the IIS or ColdFusion so I can forget about this issue in the future and make it work when I just add a site in IIS?

 

Thanks

 

Mark

CFPOP

$
0
0

Hello, all,

 

Has anyone used CFPOP for retrieving email from a gateway?

 

I've been tasked with researching this.  I've never used CFPOP for anything.  Does it retrieve only new emails?  Or does it get every email, read and un-read?

 

V/r,

 

^ _ ^

Call a function within the same CFC component

$
0
0
Hi,
/* Niewbie Question */
I've got a strange problem. When I try to call a function from another in the same CFC component, I get an Error named :« Entity has incorrect type for being called as a function.»
I've looked on many forums and searched in Google Groups. I haven't still found a workaround for that problem.
I thought I've paid attention not o use two times the same name...
Can anyone tell me what error I made ?

My sample code to reproduce this error is included

The complete error message is :
Entity has incorrect type for being called as a function.
The symbol you provided superfunction is not the name of a function.

The error occurred in C:\ColdFusion8\wwwroot\admin\_components\test.cfc: line 6

4 : <cfinvoke
5 : method = "superfunction"
6 : returnVariable = "myReturn">
7 : </cfinvoke>
8 : <cfset some_text = myReturn>
Viewing all 14291 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>