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

CF2016 JDBC SQL Server 2016 SSL Connections work around

$
0
0

Hello Community.

 

Recently my team tackled a POC using CF2016 on RHEL 7 connecting to SQL Server 2016 running on Server 2016 and ran into a curious problem.

 

The problem was this nasty error when setting up the Macromedia JDBC DSNs pointed at SQL Server 2016 with EncryptionMethod=SSL in the connection string :

 

Connection verification failed for data source: MyTestDatabaseDSN

java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]SSL handshake failed: Unsupported curveId: 29

The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]SSL handshake failed: Unsupported curveId: 29

 

 

Our server Specs:

RHEL 7

CF2016 2016.0.05.303689

Java 1.8.0_144

Tomcat 8.5.11.0

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy 8 files

 

The DSNs worked fine without SSL enabled.

 

Has anyone else experienced this?  It sure seems like a bug in the shipped JDBC driver.

 

 

Our work around currently is to use the Microsoft JDBC 6.2 driver : https://www.microsoft.com/en-us/download/details.aspx?id=55539

 

The process for implementing it is really straight forward, I hope this comes in handy for someone else running into this:

 

Step 1. wget https://download.microsoft.com/download/3/F/7/3F74A9B9-C5F0-43EA-A721-07DA590FD186/sqljdbc _6.2.1.0_enu.tar.gz

 

Step 2. tar -xvf sqljdbc_6.2.1.0_enu.tar.gz

 

Step 3. sudo cp sqljdbc_6.2/enu/mssql-jdbc-6.2.1.jre8.jar /opt/coldfusion2016/cfusion/lib/

 

Step 4. confirm proper ownership and permissions after copying jar to lib and restart the instance

 

Step 5. login to CFAdmin and create a new DSN, choose Other for the Driver and use the following example for entry values :

 

JDBC URL

jdbc:sqlserver://<serverIP>:1433;databaseName=YourDatabase;selectMethod=direct;sendStringP arametersAsUnicode=true

 

Driver Class

com.microsoft.sqlserver.jdbc.SQLServerDriver

 

Driver Name

Microsoft JDBC Driver 6.2 for SQL Server

 

Connection String

EncryptionMethod=SSL;ValidateServerCertificate=false;


How can I customize the toolbar to show undo button??

$
0
0

Is there a DW equivilent to the "standard toolbar" in CFB2, because I am looking for a way to put the most basic editing commands of Undo/Redo/Copy/Paste and do not see a way to add these to a visible toolbar.  All I see is I have to click the Edit menu, then select the command I want.  I will be really disappointed if I cannot include basic commands like this on a toolbar.  Please don't tell me about keyboard shortcuts, I know they are there but I like to have the visual buttons up on my toolbar, too.  Save All and Word Wrap would be another command I current have on a DW toolbar but can't see how to customize this in CFB2.  Am I missing something?

Session timeout when multiple windows are open

$
0
0

Hello community, in the company I work for we had a problem with the server and needed to be formatted and CF11 was reinstalled.

One of the things that users were able to do was to have multiple tabs open running the application, same session.

So let's say I had Tab 1 working on something and then opening a link from Tab 1 into a new tab.

Now, after the reinstall, if I am working in Tab 1 for more than 20 minutes (session timeout settings) and don't do anything in Tab 2, the session will timeout and I will have to sign back in.

 

Is there anything in the CF11 admin that I need to modify in order to keep the session alive when I am working with 1 tab for more than 20 minutes while other tabs from the same application are open?

 

Thank you in advance!

dynamic name

$
0
0

Hi,
I have the form is displayed with several text boxes.  The checkbox is displayed beside each field which has it own ID.  If i check three checkboxes then hit next, i'd like to see it passed three diffrent IDs' passed to next.cfm page.  Can someone please help how to pass value with dynamic name?


<!---form.cfm--->
<cfform name="update" method="post" action="next">
    <cfloop query="q_cat">
    ......
    <cfinput type="checkbox" id="cat" name="update_#id#" value="#id#">
    <cfinput type="submit" name="next" value="Next">
    </cfloop>
</cfform>

 

<!---next.cfm--->
  <cfoutput>
  #evaluate("update.#id#")#
  </cfoutput>

 

thank you

ColdFusion license doesn't allow for SaaS solution?

$
0
0

I've been told that under Standard and Enterprise ColdFusion  is it prohibited to deploy a SaaS application:

license point:

2.6.4 Prohibited Use ...c) providing use of the software in a computer service business, third party outsourcing facility or service, service bureau agreement, time sharing basis, or as a part of a hosted service

 

The only way to use ColdFusion for a SaaS application (meaning charging a license fee for each customer using the same application), the only way is to negotiate a Coldfusion Hosting Agreement based likely on a percentage of your business profit.

 

Is this true? does anyone have experience with this?

This is a serious issue that could change a lot a startup financial situation and forecast.

 

Thank you for your input on this

Strange behaviour cfinclude with CF11 and Yosemite

$
0
0

Hello,

 

I have a strange problem with my includes, if i save my file with changes, CF can't find them anymore.

 

Example:

 

<cfincludetemplate="views/file.cfm">

 

Is working fine, when i change something and save file.cfm, I receive the following error 'Could not find the included template views/file.cfm.' which is strange, because the filename and location did not change.

 

Changing the the cfinclude and the filename into 'file1.cfm' does work. Which made me think it had something to do with caching, but clearing the cache and restarting CF did not work.

 

Do anyone have an idea?

 

Thanks,

G.

 

Running

OSX 10.10

CF 11 Upd 2. Dev

The tag handler query does not have a setter...

$
0
0

I receive this error message intermittendly

"The tag handler query does not have a setter for the attribute ormOptions specified in the Tag Library Descriptor."

 

I run daily tasks and all works fine. Then it stops working from one day to the other. I used another server to run it in the meantime. Then it starts working all of a sudden for a few weeks then stops.

 

Server is a CF 9.0.2 64bit version, on Win 2008, AMD64 bit engine, 8 GB RAM

 

 

I looked through the web and all I found were unanswered questions

 

Thanks for any hint

Rob

Using javax.mail.internet.MimeMessage etc. to create EML file

$
0
0

Hi,

 

I have email messages stored in a MySQL database and their attachments stored as base64-encoded text.  I'm trying to loop through a query and write out a properly formatted .EML file for each message.  I started from some borrowed code that was used to send IMAP messages, and I had no prior experience with Java, but I've since worked through some tutorials and I now know how to write and compile a simple class. But I'm still having trouble (lots!) instantiating the correct Java objects in the correct way and order in ColdFusion.

 

Here's what sort of works, with problems I'll detail below:

 

<cfscript>
    clsSession = createObject("Java", "javax.mail.Session");
    objProperties = createObject("Java", "java.util.Properties");


    msg = CreateObject("Java", "javax.mail.internet.MimeMessage");
    mmp = CreateObject("Java", "javax.mail.internet.MimeMultipart");
    mbp = CreateObject("Java", "javax.mail.internet.MimeBodyPart");
    objRecipientType = CreateObject("Java", "javax.mail.Message$RecipientType");


    fds = CreateObject("Java", "javax.activation.FileDataSource");


    fos = CreateObject("Java", "java.io.FileOutputStream");
    oos = CreateObject("Java", "java.io.ObjectOutputStream");

</cfscript>

 

<cfloop query="getAllMessages">

<!--- Here I also do a query "qGetMsgAtts" to get all attachments by getAllMessages.msg_id ,

      and use valueList(qGetMsgAtts.attIndex) to create "msgAttachmentsList" --->

 

<!--- initialize a java MimeMessage object --->

<cfscript>
    objProperties.init();

//  (I was actually setting properties here, but I never retrieved them and code works w/o them)

 

    objSession = clssession.getInstance(objProperties);


// Message
    msg.init(objSession);
    msg.addFrom(add.parse(getAllMessages.msgFrom, false));
    msg.setReplyTo(add.parse(getAllMessages.msgFrom, false));
    msg.addRecipients(objRecipientType.TO, add.parse(getAllMessages.msgTo, false));

// ETC... no problems setting msg properties
    loopCount = loopCount + 1;


// file name
    thisFileName = '#userId#_#myFun.doCountToken(loopCount)#.eml'; // my doCountToken(integer) function simply pads with zeros.


// Message body parts
    mbp.init();
    if (not msgIsHTML)

    {
        mbp.setText(msgBody);
    }
    else
    {
        mbp.setContent(msgBody, "text/html");
    }
    mmp.addBodyPart(mbp);
    msg.setContent(mmp);


    if (len (msgAttachmentsList)) // message has attachments
    try // TRY TO ATTACH FILES
    {
      { // qGetMsgAtts.colnames: msg_Id, attIndex, fileName, fileMIMEType, fileMacCreator, fileMacType, fileContents
          writeOutput('Has attachments ' & msgAttachmentsList & '<br />');
          for (i=1; i is listLen(msgAttachmentsList); i++)
          {

              fds.init(qGetMsgAtts.fileContents); // WORKS

 

              mbp.init();

              mbp.setDataHandler(dh.init(fds)); // WORKS

              mbp.setFileName(qGetMsgAtts.fileName[i]); // WORKS

              mbp.setContent(qGetMsgAtts.fileContents[i],qGetMsgAtts.fileMIMEType[i]); // WORKS

              mmp.addBodyPart(mbp);          

          }
          msg.setContent(mmp);
      }
    }
    catch(Any excpt) {
            writeOutput("#excpt.Type# error attaching content. #excpt.Message# #excpt.Detail#<br>");
    }


    aFile = thisFilePath & thisFileName;  // PATH AND FILE NAME
    fos.init(aFile); //
    oos.init(fos); //


try// WRITE THE FILE TO DISK

{
    msg.writeTo(oos); // WORKS ONLY IF MIME TYPE IS text/plain or text/html
    oos.flush(); 
    oos.close();
    fos.close();
}
catch (Any excpt) {
    writeOutput("#excpt.Type# error attaching content. #excpt.Message# #excpt.Detail#<br>");
    oos.flush();
    oos.close();
}

</cfscript>

</cfloop>

 

Although that writes the correct number of files with the correct file names, there are 2 major problems at this point:

 

  1. the contents of the file on disk appears to contain all the messages. I'm doing msg.init() atop every loop so I don't understand why. (Also the part boundary appears to be the same in every part in every message.)
  2. I get an error like the following for any MIME type other than text/plain or text/html :
    javax.activation.UnsupportedDataTypeException error attaching content. no object DCH for MIME type application/pdf no object DCH for MIME type application/pdf

 

I Googled that and I understand that I probably need to use something like
    bads = createObject("java","javax.mail.util.ByteArrayDataSource");
    baos = createObject("Java", "java.io.ByteArrayOutputStream");

...somewhere in the mix, but all my attempts to instantiate such objects have so far failed, usually with "Method Not Found" or "Constructor not found".

 

I hope that explanation makes sense. Anyone ever write EML files using ColdFusion? I'll be forever grateful for any suggestions or snippets.

 

Richard

York U CA


How to create a Java array for use with jsoup addAttributes() ?

$
0
0

Hi. Has anyone used jsoup for cleaning up user-submitted HTML?

 

When I ask jsoup to add some extra attributes to its whitelist I get this error: "The addAttributes method was not found."

 

The addAttributes() method requires an array. I tried using a CF array, a Java array, and even a string, but nothing worked.

 

I'm using CF8. My test code is:

 

<cfset jsoup = createObject("java","org.jsoup.Jsoup")>
<cfset whitelist = CreateObject("java", "org.jsoup.safety.Whitelist")>
<cfset html="<div style='font-size:24pt;'>This is BIG text</div>. This is an unwanted script: <script>alert('Boo!')</script>.<br>">
<cfset myAttribsArray=[":all","style"]>
<cfset myAttribsArray=javacast("string[]", myAttribsArray)>
<cfset sanitized = jsoup.clean(html, Whitelist.relaxed().addAttributes(myAttribsArray))>
<cfoutput>
<textarea rows="10" cols="60"> #HtmlEditFormat(sanitized)#</textarea>
</cfoutput>

 

The code works if I don't bother with addAttributes(), but I need to add the style attribute to the whitelist. Can anyone help please? Thanks.

 

The API reference for addAttributes() is here:
http://jsoup.org/apidocs/org/jsoup/safety/Whitelist.html#addAttributes

Does CF 2018 ent support access databases?

$
0
0

I have ColdFusion 2018 Enterprise (64bit) on Windows server 2016. I can no longer to connect my access databases (*.mdb) through ODBC. The CF 2018 does not support access database? Thanks.

 

William

Custom number format function does not work to return 0's as decimals

$
0
0

Hi

My custom number formatting function does not work. It was working fine when the site had a standard client server architecture. However, when we changed to using REST API with javascript and HTML5 the function works for most parts except cases when I need it to display 0's for decimals.

Basically, the function takes arguments a number and number of decimals and, returns the number rounded to the number of decimals passed. Below, I stripped the function to bare minimum, same as I was testing.

 

<cffunction name="dispCostPeriod" access="remote" returntype="string" output="false" hint="Displays costs for a given period to user">

     <cfargument name="in_decCost" type="numeric" required="yes" />

     <cfargument name="in_iRound" type="numeric" required="yes" />

  

     <cfset decRoundedNum = NumberFormat(in_decCost, "_." & RepeatString("9",in_iRound))>

     <cfreturn decRoundedNum />

</cffunction>

 

When I pass 55.00089 and 3, the function returns 55.001.

When I pass 55 or 55.000000 or 55.0000089 and 3, the function returns 55. And, I need 55.000.

I tried both to returntype "string" and "numeric", various masks like _.999, _.000, _.___.

I tried straight return NumberFormat(in_decCost,"_.000").

Nothing works.

I am using CF10 on Windows Server 2008.

Any help greatly appreciated.

Thanks,

Gena

Coma at the end of each eanswer of my checkbox

$
0
0

I have a simple query for a list using checkbox :

 

<cfloop query="getlist">

#thingstodo# : <input type="checkbox" name="thingstodo" value="<br/>#thingstodo#"> <p>

</cfloop>

 

So it will apear like this :

 

Some list of things to do 1 : <input type="checkbox" name="thingstodo" value="<br/>Some list of things to do 1"> <p>

Some list of things to do 2 : <input type="checkbox" name="thingstodo" value="<br/>Some list of things to do 2"> <p>

Some list of things to do 3 : <input type="checkbox" name="thingstodo" value="<br/>Some list of things to do 3"> <p>

Some list of things to do 4 : <input type="checkbox" name="thingstodo" value="<br/>Some list of things to do 4"> <p>

 

 

My problem is it adds a coma at the end and this is how it looks in the database :

 

<br/>Some list of things to do 1,<br/>

 

Some list of things to do 2,<br/>

 

Some list of things to do 3,<br/>

 

Some list of things to do 4,<br/>

 

Some list of things to do 5,<br/>

 

I tryed using replace before i send it in the databse but i think i'm doing it wrong plus some of the text in the list might have a coma in it so this might not be the answer:

 

<cfset thingstodo = Replace(thingstodo, ",","","ALL")>

 

Thanks for your help

Coldfusion 11 Oracle support

$
0
0

Hi

 

I'm trying to find out what versions of Oracle will work with ColdFusion 11.  We're looking to upgrade Oracle 10g to Oracle 12.1, 12.2 or 18c.

I couldn't find anything in the specifications about whether later versions of Oracle will work.  Upgrading CF is not an option at the moment.

 

Thanks

 

Karl

CF 2018 Enterprise Update 2 - cflayout not working

$
0
0

Hello,

 

i've juste updated my CF 2018 Enterprise server with the update build 2.

BUT there's a problem now with the "cflayout" and "cflayoutarea"

 

when you take the example on ColdFusion Help | cflayoutarea

copy into a blanc page and test it, you will see the problem.

 

the TAB's are not shown but only scroll bars vertical and horizontal

tabsCF2.png

Can anyone help me?

CF11 u18 cffeed issue

$
0
0

Howdy!

 

Just wanted to share in case this could be of use to anyone else.

 

After installing Update 18 onto a ColdFusion 11 server, calling cffeed causes an error. This did not happen before update 18. Sandbox Security is enabled. No errors during install of update 18, at least according to the install log.

 

I use the tag in this manner

<cffeed action="create" name="theFeedName" overwrite="yes" escapeChars="true" outputFile="theRssFile.xml">

 

The error message contains "Access is denied" and "Unable to create"

 

We do not use cffeed that often, so it took me a while to realize it was not working. The only workaround I have found so far is to not use cffeed.


CF11 u18 cfhtmltopdf issue

$
0
0

Howdy!

 

Just wanted to share in case this could be of use to anyone else.

 

After installing Update 18 onto a ColdFusion 11 server, any page that called cfhtmltopdf would error. This did not happen before update 18. Sandbox Security is enabled. No errors during install of update 18, at least according to the install log.

 

In order to get cfhtmltopdf working again I had to add the following two items to the ColdFusion sandbox (to the Files/Dirs area for the website's sandbox).

     {cf.root}/cfusion/lib/jetty.xml => read

     {cf.root}/cfusion/lib/configure_9_0.dtd => read

 

Before I did this the first calling of cfhtmltopdf would give the following error message:access denied ("java.io.FilePermission" "{cf.root}\cfusion\lib\jetty.xml" "read")

 

Any subsequent callings of cfhtmltopdf would give the following error message: Could not initialize class coldfusion.document.webkit.PDFgRequestUtil

 

After adding {cf.root}/cfusion/lib/jetty.xml to the sandbox (and restarting ColdFusion), I tried calling cfhtmltopdf again.

 

The first calling of cfhtmltopdf would give the following error message: access denied ("java.io.FilePermission" "{cf.root}\cfusion\lib\configure_9_0.dtd" "read")

 

Any subsequent callings of cfhtmltopdf would give the following error message: Could not initialize class coldfusion.document.webkit.PDFgRequestUtil

 

After adding {cf.root}/cfusion/lib/configure_9_0.dtd to the sandbox (and restarting ColdFuison), I tried calling cfhtmltopdf again. It worked. No errors.

 

Note: I would only get the first error messages (the java.io.FilePermission ones) immediately after a ColdFusion server restart. I was getting them in the browser. I had ColdFusion set to spit up all over itself when it was unhappy.

Help with date query needed

$
0
0

Hi,

 

We have a database with dates stored as day, month and year fields and need to build a query that returns a recordset for only those dates that fall within the current date. For some reason the query returns records that are always a day too late or a day too early. Has anyone got a better way of writing this query? We are on MSSQL 2008r2. The query we have so far is:

 

    select * from mydatabase where

    DATEADD( day, -1, CAST(CAST(DateFromYYYY AS varchar) + '-' + CAST(DateFromMM AS varchar) + '-' + CAST(DateFromDD + 1 AS varchar) AS DATETIME) ) <= GETDATE() AND

    DATEADD( day, -1, CAST(CAST(DateToYYYY   AS varchar) + '-' + CAST(DateToMM   AS varchar) + '-' + CAST(DateToDD AS varchar) AS DATETIME) ) >= GETDATE()

 

The fields we have are DateFromYYYY, DateFromMM amd DateFromDD and DateToYYYY, DateToMM amd DateToDD and they are varchars. We can't change the fields in the database as this is a legacy system. Basically we build each date string on-the-fly and then compare to see if it falls within the current date using GETDATE(). Our results are never accurate unfortunately. Any help appreciated.

 

MS Access Datasources - CF 2016

$
0
0

Configuration: Coldfusion 2016 Standard 64-bit on Windows Server 2012 R2 Standard - 64bit, Java 1.8.

 

We need to create datasources to several Access databases. (Comments regarding Access not helpful; we do not control this). We do see that Access is not listed on the Systems Support Matrix, however the April 2016 post referenced below seems to indicate that connections can still be made.

 

We have successfully created such connections in ColdFusion 11 Standard (Server 2012 R2 Standard), but so far cannot create them in Coldfusion 2016 Standard.   The error is 'The specified data source is not defined'.

 

Have followed to the letter the solution mentioned in this post, to no avail.  Have compared the registry values for both Software/ODBC/ODBC.INI/[datasource] and Wow6432Node/ODBC/ODBC.INI/[datasource] in CF 2016 to those in CF11, no differences.

 

Have successfully installed Ucanaccess  (jdbc driver for Access) and can connect to databases.  However, driver does not properly interpret our robust queries, dates and more.

 

We need to connect to these databases:  via ODBC, JDBC - doesn't really matter.  If you've managed to do this using our same configuration, we'd be very grateful to know how.

 

Thanks in advance,

Sarah

OT: NOW what's happening with the forums??

$
0
0

I swear, I've disliked the Jive platform since day one, and now I'm even less happy with it.

 

Ever since day one, if I do not close my browser I remain logged in.

 

For the last couple of days, if I go to lunch or something else takes me away for an hour or more, when I return instead of seeing my profile icon, I see "Sign In".  If I click the Sign In link, the page basically refreshes and shows my profile icon, again.

 

Is this life-shattering?  No.

 

Is this going to ruin my day?  No.

 

Is it really annoying?  Yes.

 

V/r,

 

^ _ ^

FCKEDITOR + CF 11 not working with IE 11 after update of windows/internet explorer

$
0
0

When toolbar="Default" doesn´t show the option input text.

With toolbar="Basic" is make. Look the image.

 

 

Viewing all 14291 articles
Browse latest View live


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