Quantcast
Channel: Adobe Community : All Content - ColdFusion
Viewing all 5979 articles
Browse latest View live

How to check if a node exists in XML file?

$
0
0

  I have been asked to programme a method for importing data from xml files into our Coldfusion 8 website, I am new to using XML.

 

My method had been working however I encounted the following error:

 

Element NETWORKORDER.SECONDARYADDRESS.CONTACTNAME is undefined in MYDOC.

 

On investigation the node in the XML file was not present.

 

Is there a method I can use to resolve this error by checking if a node exists in the xml file,  that works with my current code below?

 

<!--- Read XML file --->
<cffile action="read" file="D:\website\XML\#FileName#" variable="myxml">
<cfset mydoc = XmlParse(myxml)>

<!--- Extract Data from NDS XML File --->
<cfset aPrimaryContactName=(#mydoc.NetworkOrder.PrimaryAddress.ContactName#)>
<cfset aPrimaryContactNumber=(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#)>
<cfset aPrimaryContactNumber= tostring(#mydoc.NetworkOrder.PrimaryAddress.ContactNumber#)>
<cfset aPrimaryContactAddressLine1=(#mydoc.NetworkOrder.PrimaryAddress.line1#)>
<cfset aPrimaryContactAddressLine2=(#mydoc.NetworkOrder.PrimaryAddress.line2#)>
<cfset aPrimaryContactAddressLine3=(#mydoc.NetworkOrder.PrimaryAddress.line3#)>
<cfset aPrimaryContactAddressLine4=(#mydoc.NetworkOrder.PrimaryAddress.line4#)>
<cfset aPrimaryContactAddressLine5=(#mydoc.NetworkOrder.PrimaryAddress.line5#)>
<cfset aPrimaryContactCity=(#mydoc.NetworkOrder.PrimaryAddress.City#)>
<cfset aPrimaryContactPostcode=(#mydoc.NetworkOrder.PrimaryAddress.PostalCode#)>
<cfset aPrimaryContactCounty=(#mydoc.NetworkOrder.PrimaryAddress.CountrySubdivision#)>
<cfset aPrimaryContactCountryCode=(#mydoc.NetworkOrder.PrimaryAddress.CountryCode#)>
<cfset aPrimaryContactCountry=(#mydoc.NetworkOrder.SecondaryAddress.Country#)>
<cfset aSecondaryContactName=(#mydoc.NetworkOrder.SecondaryAddress.ContactName#)>
<cfset aSecondaryAttentionOfName=(#mydoc.NetworkOrder.SecondaryAddress.AttentionOfName#)>
<cfset aSecondaryContactNumber=(#mydoc.NetworkOrder.SecondaryAddress.ContactNumber#)>
<cfset aSecondaryContactAddressLine1=(#mydoc.NetworkOrder.SecondaryAddress.line1#)>
<cfset aSecondaryContactAddressLine2=(#mydoc.NetworkOrder.SecondaryAddress.line2#)>
<cfset aSecondaryContactAddressLine3=(#mydoc.NetworkOrder.SecondaryAddress.line3#)>
<cfset aSecondaryContactAddressLine4=(#mydoc.NetworkOrder.SecondaryAddress.line4#)>
<cfset aSecondaryContactAddressLine5=(#mydoc.NetworkOrder.SecondaryAddress.line5#)>
<cfset aSecondaryContactCity=(#mydoc.NetworkOrder.SecondaryAddress.City#)>
<cfset aSecondaryContactPostcode=(#mydoc.NetworkOrder.SecondaryAddress.PostalCode#)>
<cfset aSecondaryContactCounty=(#mydoc.NetworkOrder.SecondaryAddress.CountrySubdivision#)>
<cfset aSecondaryContactCountryCode=(#mydoc.NetworkOrder.SecondaryAddress.CountryCode#)>
<cfset aSecondaryContactCountry=(#mydoc.NetworkOrder.SecondaryAddress.Country#)>


An error occurred accessing RDS server: A connection to the RDS Server could not be established because the webserver was unreachable

$
0
0

We are running CF11. I am using Cold Fusion Report Builder. When I open a report in Report Builder I am able to run and modify the query for about 5 minutes. Then I get the Error Occurred message. How can I stop the RDS server from dropping me?

Delete files after cfzip?

$
0
0

I've got a web app that allows users to save database results as a PDF file (I use cfdocument for this).  There's also an option for them to select up to 20 records to PDF and zip (I use cfzip for this) but with almost 6000 records in the database, I don't want PDFs to pile up. It's easy to make the script delete the zipfile after download, but I'm trying to figure out a way to clean up the PDFs.

 

One idea was to stick a unique identifier in the PDF filenames, then delete everything with a wildcard, but is there a better way?

CF 7 / IIS 6 - how to get cookies working with multiple websites

$
0
0

Running CF 7 on Windows 2003 Server with IIS 6.  Server is named usileng01.xyz.com.  It has one IP address 135.5.17.25 and three web sites defined in IIS.  All three are using the server's IP address on port 80.

1) Default Web Site - Home directory in IIS points to C:\Inetpub\wwwroot

2) itrac.web.xyz.com - has "Host header value" in IIS set to itrac.web.xyz.com.  Home directory points to E:\iTracDocumentRoot.  itrac.web.xyz.com is a DNS alias to usileng01.xyz.com.

3) itdata.web.xyz.com - has "Host header value" in IIS set to itdata.web.xyz.com.  Home directory points to E:\iTracDocumentRoot\IT. itdata.web.xyz.com is a DNS alias to usileng01.xyz.com

All three sites have anonymous access disabled and "Authenticated access" in IIS set to "Integrated Windows authentication" since PCs are logged into the AD domain.

 

When accessing the web server via a DNS name (either usileng01.xyz.com, itrac.web.xyz.com, or itdata.web.xyz.com), the CFID and JSESSIONID change on every access, so I'm unable to see the cookies.  I can set cookies fine and they appear in the PC's cookie file.

However, when accessing the web site via the server's IP address (e.g., http://135.5.17.25) the CFID and JSESSIONID remain the same and I can see the cookies.

 

I have tried all combinations of CFAPPLICATION's options sessionManagement, setDomainCookies, clientManagement, setClientCookies, and clientStorage.  Other than changing what's in the cookies, session, and client variables, nothing has worked.

 

Any idea why I can access cookies when using IP address but not DNS name?  And how to get them working with DNS names?

javascript error message

$
0
0

Hi. I have some javascript on my Add New Part page that has a form that says if a Part Number has a C and then a number behind it (like C1557), and the CN_Entry_Initials equal an "N", and the Validation_Qty is blank, make a Javascript error message display saying to enter a Validation Qty. I am trying to make this work on my Edit page also, but the error message does not display. I think it's because I have the input text box for the Part Number disabled. We don't want users to be able to update the part number once it's entered. If I just output the result of the Part Number, the javascript still doesn't work. How can I get the javascript to pop up an error message if the Part Number is C1557 (and the part number is just output to show the result), the CN_Entry_Initials equal an "N", and the Validation_Qty is blank? Below is the javascript I have and the form is below that. Thank you.

Andy

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

function verify() {

var PartNum=document.EditItem.Part_Number.value;

var regularExpression = new RegExp(/^[cC][0-9]/); //regular expression to check for a letter C followed by a number

 

if(regularExpression.test(PartNum)&& document.EditItem.CN_Entry_Initials.value == "N" && document.EditItem.Validation_Qty.value == "") { //this will return true if the input passes the regular expression

alert("Enter a Validation Quantity for this new Custom");

}

 

else

{

document.EditItem.submit();

}

 

}

//  End -->

</script>

 

 

<table width=900 cellpadding="0" cellspacing="4" border="0">

 

<cfform name="EditItem" method="post" action="edit_ec_number_action.cfm">

<CFOUTPUT QUERY="ShowItem" MAXROWS="1">

 

<tr>

<td class="edit" align="right">Change or new entry:</td>

<td>

 

 

<select name="CN_Entry_Initials">

   <option value="">Select</option>

   <cfloop query="ShowCNEntryInitials">

     <option value="#CN_Entry_Initials#"

<cfif #ShowCNEntryInitials.CN_Entry_Initials# EQ #ShowItem.CN_Entry#>selected</cfif>>#CN_Entry_Initials#

   </cfloop>

   </select>

</td>

 

<tr>

<td class="edit" align="right" valign="middle">Part Number:<br><h6>(Limit to 25 characters)</h6></td>

<td class="edit"><input type="hidden" name="#Part_Number#">#Part_Number#</td>

</tr>

 

<tr>

<td class="edit" align="right">Validation Quantity:</td>

<td>

<cfinput type="Text" name="Validation_Qty" size="12" value="#Trim(Validation_Qty)#" validate="integer">

</td>

</tr>

 

<tr>

<td>

<input type="button" value="Update"  onclick="verify();">

</td>

</tr>

 

</table>

create data source for microsoft access on 64 bit server and ColdFusion 16

$
0
0

Trying to migrate our Microsoft Access DB's to a new server running Microsoft Server 2012 and ColdFusion 16. I have been able to do this in the past using the 32 bit ODBC Data Source Administrator, but it doesn't seem to be working this time.

500 error, Coldfusion pages not loading

$
0
0

Not sure what happened,  but now all my domains don't load anymore.  I get this error.  I'm at a lost and not even sure where to start to troubleshoot.  Can someone please help?  This is what is showing on my page when it loads.

 

Thanks in advance.

 

Jimmy

 

at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

at coldfusion.CfmServlet.service(CfmServlet.java:219)

at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )

at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:437)

at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:197)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav a:625)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:722)

Hash

$
0
0

I'm doing hash for the global iris payment, need the sha1 hash,

 

coldfusion 9 has sha-1, I tried use this to do the hash, but they said the hash is wrong, I don't know what to do, can anyone help?

 

and how does the coldfusion do the hash, is there anyway I can see the sha-1 function code?


How to handle commas within a List on web form?

$
0
0

I have a web form, something like:

 

<form>

<input type="text" name="objectives" value="This is a test">

<input type="text" name="objectives" value="And another, if you know what I mean.">

<input type="text" name="objectives" value="And yet another.">

<input type="submit" name="btnGo" value="Do It">

</form>

 

And an action page that submits it to a db. The trouble is, the objectives will have commas in them, occasionally, and CF turns each comma into a list item, so my loop looks like:

  1. This is a test
  2. And another
  3. if you know what I mean
  4. And yet another

 

but I want:

  1. This is a test
  2. And another, if you know what I mean
  3. And yet another

 

What I want to do is loop through the objectives, retaining the commas within the elements. I've been struggling with this for days. I want to avoid having to write some replace method in JS if I can help it.

 

Thanks!

 

How I'm looping:

<cfset values = ListToArray(#FORM['objectives']#)>

<cfloop index="i" list="#FORM['objectives']#">

      x=#i#<br />

</cfloop>

Is there a way to enable Browser compatibility view for throughout application.

$
0
0

We are using java plugin for Crystal reports which supports up to Internet Explorer 10. So i have enabled IE compatibility view to run the reports in IE11. Is there a way to enable compatibility view for entire application.

 

Thanks

Exception log error when writing BLOB images to filesystem (CF2016)

$
0
0

I'm testing out CF2016 Enterprise as a possible upgrade for my existing CF9 application, and I'm running into a major issue with existing code that works fine in CF9 where I read a BLOB image from my Oracle database and write it out to my filesystem as a JPG. 

 

The code looks something like this (redacted for security):

... Query "GrabImage" reads image as "image_blob"...

<cfset newimage=ImageNew(GrabImage.image_blob)>

<cfimage action="WRITE" source="#newimage#" destination="/xxxxxxxx/images/cf/#imagefile#" overwrite="true">

 

The error showing up in my exception.log looks like this:

 

"Error","ajp-nio-8016-exec-10","04/13/16","15:15:08","",""

java.lang.NullPointerException

        at coldfusion.util.Utils.getFileFullPath(Utils.java:211)

        at coldfusion.image.Image.getInputStreamFromSource(Image.java:2802)

        at coldfusion.image.ExifMetaDataHelper.getOutputSet(ExifMetaDataHelper.java:152)

        at coldfusion.image.ImageWriter.writeImage(ImageWriter.java:311)

        at coldfusion.image.Image.write(Image.java:880)

        at coldfusion.tagext.io.ImageTag.performWrite(ImageTag.java:675)

        at coldfusion.tagext.io.ImageTag.writeTempImageFile(ImageTag.java:765)

        at coldfusion.tagext.io.ImageTag.writeImageToBrowser(ImageTag.java:637)

        at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:416)

        at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:3683)

        at cftest2ecfm785059209.runPage(/xxxxxxxx/htdocs/test.cfm:23)

 

This happens every time I do this action of writing the image file to the filesystem, but the ImageWrite call does work, and the image ends up on my filesystem and serves up perfectly.  I tried finding information online about the ExifMetaDataHelper thing, since that seems to be the root of the issue, and it sounds like BLOB images don't carry the EXIF metadata when read by cfimage, and so that would explain that error trying to write an image without it, though it's strange that it just errors in the background and still completes the action.

 

I tested out what would happen if I read the image FILE instead of the BLOB as my source, and when I do that (read the file and write it back), I don't get that error.  There's no actual EXIF metadata (a dump shows an empty structure), but it doesn't error.  So the BLOB source does seem to be the problem.

 

What's most troubling about this is that under load, this error seems to swamp the CF server.  Running a few of these at a time just errors into the exception log, but if I make too many near-simultaneous calls to this function, my server stops responding.  CF doesn't seem to be maxing out my Java heap or anything, but it just stops handling requests.  The exception.log starts rotating pretty quickly, but even that shouldn't make it unresponsive.  Requests start timing out and eventually the exception log stops logging most of that trace, just recording the "NullPointerException" line.

 

With 2016 being such a recent release, I can't find much related to known bugs.  Anybody seen anything like this?  The same error occurs if I do writetobrowser instead of just write, which isn't even an option since I need to maintain consistent URLs for those images.

DH handshake issue with web service using ColdFusion 7 and 8 after java 8 update

$
0
0

ColdFusion 7 and 8 are bundled with a variant of JRE1.6.

 

I have a script which has successfully consumed a web service for years.  Last week, the provider of the web service updated their version of Apache and Java on the server to java 1.8 (or java 8).

 

I could no longer consume the web service after the web service provider upgrade of Apache and Java and would receive the following DH keypair error each time I try to consume the service:

 

-----------------

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString: javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair

faultActor:

faultNode:

faultDetail:

{http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair

at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1591)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1554)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1537)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1130)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1107)

at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)

at org.apache.axis.transport.http.HTTPSender.getSocket(HTT... ''

-----------------

 

I asked the web service provider why this would stop working and how we can fix it.  They suggested I upgrade to the latest version of Java on my server running ColdFusion.  I did some research and found the problem to be with the amount of memory allocated to the variable containing the encryption key.

 

The big problem is when I tried to upgrade java on this particular server (Windows Server 2003), the install returned a messaged stating it couldn't run on the older OS and I would need to upgrade my OS in order to install java.

 

Does anyone have a workaround in ColdFusion 7 or 8 by which you can establish the DH handshake using Java 1.6 on your local server while consuming a web service on a server using Java 1.8?

showing 85%, 95% etc... when using cfsearch scoring instead of like .35154512, .254878 etc.

$
0
0

at the moment when using cfsearch it shows score as .35154512, .254878 etc. How can I show it like 95%,87% etc....

Using Stripe.com payment with Cold Fusion Forms

$
0
0

Hi. Does anyone know how to integrate a Cold Fusion form with the payment site stripe.com? I've tried taking their examples to see if I could just get money from the form into my test account on Stripe, but it doesn't work. I've updated the PublishableKey with the test key I have in my account. I'm not sure if I need to download something else to our site first in order for it to work. Has anyone used this site before to do payments with their cold fusion forms?

 

Andy

Coldfusion server stops serving pages when accessed over Chrome for Android

$
0
0

We have apache 2.4 running on a Windows Server 2012, everything works fine except one strange bug:

The server stops serving any pages to users after someone visits any page via Chrome for Android. The visitor on the Android device (only when using Chrome) gets an "connection reset" error, but all users after that are getting blank loading pages until Apache gets restarted. If an user is loading a page on any other device during a restart, the page finishes loading immediately.

It seems that i can't find anything specific in the Apache or CF errorlogs. The only error i'm able to find is in the coldfusion-out.log:

Apr 15, 2016 13:34:43 PM Error [ajp-nio-8016-exec-15] - The request has exceeded the allowable time limit Tag: cfhttp The specific sequence of files included or processed is: C:\projekte\removed\So-funktioniert-es-6.html, line: 98

It does mention a specific file here, but it happens no matter what file or page you try to open. It's a really strange bug and we can't find any solution to it, nor anyone else with the same problem. The server isn't overloaded at all.

Hopefully i was specific enough for someone to point us in the right direction.


Issues using IE10 or IE11 with Cold Fusion 11

$
0
0

Hi,

 

Some users of the application are using IE 10 or IE 11 and is working file.

 

Some users of the application using IE 10 or IE 11 the application is not working.

 

Running Cold Fusion 11 with Update 3 and IIS 7. The servers are Windows 2008, 32 bit.

 

Does anyone have any ideas?

 

 

Thanks,

 

Mike

Problem with cfhtmltopdf and special characters

$
0
0

How can I fix cfhtmltopdf showing "?" for special characters "1/2", "3/4", "•"? We have ColdFusion Server Standard 11,0,07,296330 installed.

Coldfusion datasource isolation level (tomcat resource?)

$
0
0

Hello all,

I'm hoping someone can help me with a problem I'm having.  I know some of the problems I'm having are due to poor application design, but this was all stuff done before I started working on the application and changing it is not likely any time soon.  That said... we are currently running ColdFusion 9 on a fairly large application.  We never upgraded to 10 because of a problem with being able to set the isolation level on datasource connections to the database.  Since CF 2016 released recently, I decided to play with this some again.  We are running an informix database and so have their jdbc drivers, and I have them added to the class path.  All of that works fine.

 

I can add the datasource directly in the coldfusion administrator, and it works, accept for the isolation level.  The way the application was designed and written it requires the default isolation level to be set to dirty read (read uncommitted) on some of the datasources.  In CF9 we can configure this in jrun-resources.xml by adding <isolation-level>READ_UNCOMMITTED</isolation-level> to the datasource.  There is no way to do this in the coldfusion administrator that I can find, and haven't found anyway to add it in the neo-datasources.xml file.

 

So I found out about Tomcat JNDI datasources. I was able to get a working datasource by adding a resource container in context.xml and a reference to it in web.xml, then add it through the coldfusion administrator as a J2EE datasource pointed at java:comp/env/jdbc/datasource.  It supports defaultTransactionIsolation="READ_UNCOMMITTED" as a paramter on the resource so it resolves that issue.  Initially this is fine, as long as I add the username and password to the Resource in context.xml.  This brings the 2nd problem, as much as I hate that this is done, our current set up does a user based authentication on every query.  So every cfquery tag has username  and password attributes, accept for a couple of datasources that do datasource based authentication.  The Tomcat JNDI datasource is apparently based on a BasicDataSource factory from Tomcat, which errors with the username and password being specified on the query tag (or even in coldfusions administrator).  It says that it's not supported by BasicDataSource.  I found another org.apache.jdbc.pool.DataSourceFactory, but if I try to specify that as the factory on the Resource, the coldfusion errors with unable to find the datasource when try to add or modify it through the administrator.

 

The last part of the problem is an IBM problem.  There is supposed to be an Informix environment setting IFX_ISOLATION_LEVEL, but it seems to ignore that environment variable if specified on the jdbc url.

 

Is there a way to do what we need to accomplish in CF10+ (have a datasource with a default isolation level specified and allow authentication from the query tags).

 

Any advice or help on ways to resolve this situation would be greatly appreciated.

, use them to query another multiple selects (4 related multiple selects)

$
0
0

Hi,

 

I have 4 related select controls in my form.  Each select control allows a user to select a single item to be passed and to query the values  to populate the 2nd select control and so on for the 3rd and 4th control using AJAX..  It was working  perfectly, until the user requested that they want to be able to select multiple items in each of the select controls.  In the select statement we can just add 'multiple" but my problem is how to read and pass multiple values to get the drop down list for the 2 or 3 or 4th select control.  I have been searching in the internet, found similar questions but unanswered.  I'm using Coldfusion 10 and new with jquery.  If anyone has solutions or sample code using AJAX/javascript that would be very helpful.  I can also learn the code in jquery if someone has a solution written in jquery.

 

Thanks in advance.

This is hideous

$
0
0

JIVE has always sucked.  Now, they suck even more (didn't think that was possible.)

 

Sadly, this is the only place to get decent CF support (although I just now remembered that I have a slash invite.. I should use it.)

 

Sigh.

Viewing all 5979 articles
Browse latest View live


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