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

Cannot create a session after the response has been committed

$
0
0

Windows 2016 Server

MSSQL Web Edition 2017

Coldfusion 2016 - 2016.0.05.303689, Tomcat - 8.5.11.0

IIS 10.0.14393.0

 

I randomly get an error emailed to me from multiple sites (see below) how can I resolve this?  No other information is provided to solve the problem.  We did check "Use J2EE session variables" because we need them for a project and then this started to happen.  A google search reveals that this could be the issue.  Anyone have a solution on how to keep this setting and not get this error?

 

Cannot create a session after the response has been committed

 

Type:java.lang.IllegalStateException

 

StackTrace:

java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2955) at org.apache.catalina.connector.Request.getSession(Request.java:2368) at org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedAction.run(RequestFacade. java:216) at org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedAction.run(RequestFacade. java:205) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:894) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:23 1) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:23 1) at coldfusion.runtime.AppHelper.setupJ2eeSessionScope(AppHelper.java:1042) at coldfusion.runtime.AppHelper.setupSessionScope(AppHelper.java:1141) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:415) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:153) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:151) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:549) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:170) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:224) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:46 ) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:148) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:144) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:549) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:190) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:46 ) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:148) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:144) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:549) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:190) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:46 ) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:148) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:144) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143) at com.seefusion.Filter.doFilter(Filter.java:92) at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:279) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:549) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:314) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:253) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:190) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:46 ) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:148) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:144) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:143) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at com.seefusion.SeeFusionValve.invoke(SeeFusionValve.java:52) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:363) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:507) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)


IIS/ cfm page / 404 Issue

$
0
0

I have a virtual website running off of IIS (looks like version 8.5,) and ColdFusion 11.

When I access a page as http://something.example.org/ which uses a ColdFusion template (index.cfm), the page correctly displays. However, when I request http://something.example.org/index.cfm it results in a 404.

All .cfm pages result in a 404

Other virtual websites on the same server behave correctly, returning successfully for both http://other.example.org and http://other.example.org/index.cfm

Since I just set up this new website, I'm wondering if there is an additional setting I'm just missing that prevents this error from occurring?

Pages with non .cfm extensions, like .htm & .pdf display properly.

cfhttp and setting the content-type for a request

$
0
0

Hi,

 

I am trying to set the content-type for a cfhttp request like this (on coldfusion 9):

 

<cfhttp redirect="no" method="get" timeout="120" url="http://10.0.0.1/test2.cfm">

    <cfhttpparam type="HEADER" name="Content-Type" value="application/json; charset=utf-8">

</cfhttp>

 

// coding on test2.cfm:

<cfset x = GetHttpRequestData()>

<cfdump var=#x#>

 

// Output on test2.cfm

 

content [empty string]
headers
struct
Accept-Encoding deflate, gzip, x-gzip, compress, x-compress
Connection TE
Host 10.0.0.1:80
Proxy-Connection close
TE trailers, deflate, gzip, compress
User-Agent ColdFusion
X-REWRITE-URLhttp://10.0.0.1:80/test2.cfm
method GET
protocol HTTP/1.1

 

As you can see no content-type is send through. I also tried the sniffer.exe:

 

GET http://10.0.0.1:80/test2.cfm HTTP/1.1

Host: 127.0.0.1

Proxy-Connection: close

Connection: TE

TE: trailers, deflate, gzip, compress

User-Agent: ColdFusion

Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress

 

Here you can also see that no content-type was passed through. The sniffer should report back

 

GET http://10.0.0.1:80/test2.cfm HTTP/1.1

Host: 127.0.0.1

Proxy-Connection: close

Connection: TE

TE: trailers, deflate, gzip, compress

User-Agent: ColdFusion

Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress

Content-Type: application/json; charset=utf-8

 

But is does not, what do i need todo to set the content-type in a cfhttp request.

 

Kind regards,

Nebu

How to open and read JSON file?

$
0
0

Is there a specific way to open and read a json file other than using cfhttp tag?

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.

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

Oracle LISTAGG causing query to run S L O W

$
0
0

Hello, all,

 

I've got a query that is giving me fits.

 

I'm trying to bring some code that my boss recently wrote into the 21st century.  One section that he wrote, he is using three queries to get base information, looping through one of the queries and running a query within that loop.  I hate this.  Every time I see code that runs a query within a loop, it makes my teeth itch.  So, I'm trying to run a single query using LEFT OUTER JOIN.

 

I've got it working, but for one thing.  I am trying to get our Oracle db to aggregate some data into a string using LISTAGG(), and that is causing this query to take 14 seconds to get the data (the way my boss wrote the code, it's almost instant.)  Of the two tables involved, one has ~2000 records, the other ~4000, and the query is retrieving 23.  If I take out the LISTAGG() portion, the query is almost instant.

 

I was hoping to get the db to do more of the heavy lifting.  Is there anything faster than LISTAGG() for aggregating data into a string in Oracle 12c?

 

SELECT m1.uuid, m1.title, m1.description,      (SELECT listagg(title,', ') within group (order by null) csv       FROM main       WHERE uuid in (SELECT role_uuid FROM assoc WHERE task_uuid = m1.uuid)) related_titles

FROM main m1

WHERE m1.uuid in (SELECT a1.task_uuid FROM assoc a1 WHERE a1.role_uuid = '{uuid}' AND task_uuid is not null)

ORDER BY m1.title

 

V/r,

 

^ _ ^

coldfusion 2018 datasource creation for MySQL database

$
0
0

Dear, I tried to create datasource using MySQL database and came up with the following error message:

 

Connection verification failed for data source: diadesorte

 

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

 

The root cause was that: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

 

What should I do to correct this error?


How to change temporary unable to service request page in CF 11

$
0
0

Hi

 

 

im currently tinkering around with Coldfusion 11, and ive noticed that if we turn the service off, any request to a .cfm page is greeted with an a tom cat error screen, I imagine that in production there will have cases of where the CF Service would need to be restarted, and Im wondering how I would change this to be a specific HTML page within the site.

 

The service is unavailable.

Service Temporarily Unavailable!

 

 

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

 

  Tomcat/ISAPI/isapi_redirector/1.2.41

 

 

Ive seen on some other sources that people have indicated that it should be altered via the wsconfig.properties file.

However I cant seem to decipher how I would set this within the following.

 

 

    #ColdFusion Web Server Configuration File

    #Wed Dec 23 15:15:08 EST 2015

    1=IIS,0,true,"",bitness64

    1.srv=localhost,cfusion

    2=IIS,0,true,"",bitness64

    2.srv=localhost,cfusion

 

 

I assume this cant be done via the application.cfc because the file isnt able to be run, and also cant be  done within IIS as its clearly displaying a totally different page.

 

Ideally I would like to display a static HTML file indicating the site will be back shortly with the files located in the website root but cant seem to figure out how to do it?

 

thanks in advance

How to kill a coldfusion cookie??

$
0
0

I set cookies like this:

 

<cfcookie name="ckwhatever" value="hello">

 

 

I try to kill the cookie like this:

 

<cfcookie name="ckwhatever" expires="now">

 

This does NOT work. the cookie remains.

 

I've tested on mozilla and IE

 

I don't get it.

What the heck is Adobe thinking?

$
0
0

I’ve been a long-time advocate for ColdFusion. There have been several threads prematurely referencing ColdFusion’s demise that I have chimed in. But now in dealing with our Adobe account management representative, I am left dumbfounded.

 

Background: We have purchased and are using 40+ Standard CF licenses. These license purchases and use started with CF5 when Allaire still owned CF and have been upgraded to mostly CF9 but just starting CF11 -- and then the wheels fell off.

Like idiots, we wanted to determine if Enterprise pricing might now work for us as were starting to incorporate a VM environment (from an all pizza box environment). In asking some simple questions our sales rep is now claiming that we are violating the acceptable usage portion of their license agreement:

 

2.6.4 Prohibited Use. Except as expressly authorized through a separate custom hosting agreement, Licensee is prohibited from: (a) using the Software on behalf of third parties; (b) renting, leasing, lending, or granting other rights in the Software including rights on a membership or subscription basis; (c) providing use of the Software in a computer service business, third party outsourcing facility or service, service bureau arrangement, time sharing basis, or as part of a hosted service; or (d) using any component, library, or other technology included with the Software other than solely in connection with its use of the Software. For more information about how to obtain a custom hosting agreement, please see: http://www.adobe.com/go/ColdFusion_Hosting_Agreement.

 

Apparently, since our customers are businesses, CF cannot be used -- any business that sells products or services to other businesses is considered a service bureau -- EVEN IF THEY ARE NOT A HOSTING PROVIDER. This requires a custom hosting provider agreement in place even if you don’t provided hosting services, and I’m assuming at additional “negotiated” fees -- but we have not got that far because we’re not a hosting provider.

 

Right now I’m actively researching ColdFusion alternatives which is very disappointing.

 

I’ll post updates if this thread does not get deleted but for now, CF users beware: If you sell to businesses you are probably in violation of the Adobe license agreement -- at least our sales rep’s view.

Sigh...

Adobe ColdFusion license bait and switch for SaaS companies

$
0
0

Checking in to see if anyone else out there is dealing with Adobe bait and switch based on having an application developed in CF that other businesses use?  We were sent a questionnaire earlier this year under the guise of getting a "better deal" for our existing 3 perpetual Enterprise licenses.  As a result of what was clearly a bait and switch tactic, Adobe is now claiming we are in violation of the EULA and requiring us to sign a custom agreement that is increasing our costs nearly 10-fold. If we don’t sign it, they are threatening to sue us for years of back-license fees.  Our solution does not provide coding access or delivery of ColdFusion itself. And it is not ColdFusion server dependent.  (It runs in open source environment like Lucee).  They say that ANY company using CF in any B2B capacity is a service bureau and subject to a custom agreement with annual auditing/repricing, using some arbitrary and unknown formula for determining the cost.  Clearly they are trying to convert their perpetual licensed customers to a special license where they’ll ultimately demand a portion of their revenues.  They are also bypassing their resellers by doing this.  If you have dealt with this I’d like to find out what your resolution was.  If you have not – just wait – they are coming for you.

date and datetime types with cfqueryparam

$
0
0

How do you get a date and a datetime type into a table with cfqueryparam ?

 

For date  I have tried <cfqueryparam value=#createodbcdate(thedate)# cfsqltype="CF_SQL_DATE" maxlength="23" null="yes"> and got NULL in the table.

For time I tried <cfqueryparam value=#now()# cfsqltype="CF_SQL_TIME" maxlength="23" null="yes"> but the date part of the datetime value was 1970-01-01.

 

In the table, types for these columns are datetime.

PDF CFCONTENT Display Issue

$
0
0

I have a cloud share drive recently assigned to my project, and I was able to copy a number of PDF files into it.   I can use Windows Explorer to navigate to that drive and bring up any PDF file with ease -- double click, view in Acrobat, no problem.

 

I can use CFDIRECTORY to list the contents of the directory, and I can use FileExists and CFFILE to test and grab a copy of the file, no sweat.

 

I put a text file in the directory, and I can pull that up with:

<cfheader name="Content-disposition" value="attachment;filename=filenamehere.txt">

<cfcontent reset="true" type="text/plain" file="file:///\\sharedDirectoryHere\filenamehere.txt">

 

I put a GIF in place and <image> displayed it easily.

 

I can use the following code pair to view PDF's on another project's share with no issue, PDF pops right up...

<cfheader name="Content-disposition" value="attachment;filename=filenamehere.pdf">

<cfcontent reset="true" type="application/pdf" file="file:///\\otherSharedDirectoryHere\filenamehere.pdf">

 

... but if I try to read and display a PDF on my shared directory, it tells me the file is missing or corrupt and will not display it.

 

Your thoughts, please?

Timeout to Web Services using via Proxy Server

$
0
0

Hello,

 

I'm wondering if anybody can help.

 

I have a couple of preset web services on the coldfusion web server. As far as I know these have never worked since it's original installation back in June 2011.

 

Whenever I attempt to refresh one of the web services using CF administrator I am seeing the following error message:

 

  • Unable to refresh webservice.
    Unable to read WSDL from URL: https://www.****.cfc?wsdl.
    Error: java.net.ConnectException: Connection timed out: connect.

 

The server does not have a direct connection to the internet as it is connected to the internal company network which uses a proxy server for internet connectivity.

I am suspecting that CF is attempting to connect to the internet without the knowledge of the proxy server.

 

I have looked high and low but unable to locate anything in CF admin to add a proxy server.

 

I'm hoping somebody can reply with a simple solution to fix the above.

 

Many Thanks,

 

Andy


coldfusion 11 error java.lang.OutOfMemoryError: Metaspace

$
0
0

a few times a day I am getting this error - how do I fix it?

Mail not sending from Coldfusion

$
0
0

Hi

I recently upgraded from CF8 to CF11 and now CF11 does not seem to be able to send emails.

 

In CFAdmin, I entered the mail server and settings to the point where, when I Verify Mail Server Connection I get a success message, "Connection Verification Successful", but no email gets sent.

 

When i view the Log files for Mail in CF I see this error repeatedly:

 

avax.mail.MessagingException: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 

Has anyone else encountered this error? I can post plenty of additional detail if needed, both from the CF server and the Exchange server, if needed.

 

Thanks in advance,

 

Rich

CFThread GC Overhead Limit Exceeded

$
0
0

I have an application that trades virtual items and have a single page which gets all my accounts and for each one creates a thread that firstly logs the account in and then searches and buys for items for as long as the session is active.  I should point out at this point that this is my first experience of using cfthread.

 

I'm having issues with it. Every 30 minutes (if not less) my ColdFusion server comes to a standstill and I have to restart the service. Upon restarting the service I check the logs and there are errors that say "GC Overhead Limit Exceeded".

 

I have looked extensively online but as much as cfthread is new to me, so is the JVM and how it operates. I'm running on CF10 Enterprise Edition and have loaded up the server monitor and surely enough I can see the JVM memory usage grow and grow until the limit has been reached (just now I have it set as 2gb as when I had it set higher the memory seemed to fill up quicker). Even when I select the Run GC option in the monitor it does not reduce the memory usage very much, if at all.

 

Is this more than likely something to do with my code? At the moment I have just under 50 threads being created but as I add more accounts to the application then the more threads that will be required.

 

Here is the code from the page...

 

<script>

  /* RELOAD PAGE EVERY 65 MINUTES */

  setTimeout(function(){

    window.location.reload(1);

  }, 3900000);

</script>

 

<!--- GET ACTIVE ACCOUNTS --->

<cfquery name="getLogins" datasource="myDB">

SELECT * FROM Logins WHERE active = 1

</cfquery>

 

<!--- LOOP THROUGH ACCOUNT --->

<cfloop query="getLogins">

 

  <!--- HAVE A SLEEP SO IP DOESN'T GET FLAGGED FOR SENDING TOO MANY REQUESTS AT ONCE --->

  <cfset Sleep(30000) />

 

  <!--- CREATE THREAD FOR ACCOUNT --->

  <cfthread

  name="#getLogins.accountName#"

  action="run"

  accountName="#Trim(getLogins.accountName)#"

  email="#Trim(getLogins.email)#"

  password="#Trim(getLogins.password)#"

  resourceId="#Trim(getLogins.resourceID)#">

 

  <!--- DEFAULT SESSION VARIABLES --->

  <cfset SESSION["#attributes.accountName#LoggedIn"] = 0 />

  <cfset SESSION["#attributes.accountName#LoginAttempts"] = 0 />

 

  <!--- WHILE ACCOUNT NOT LOGGED IN AND LESS THAN 8 LOGIN ATTEMPTS MADE --->

  <cfscript>

  while (SESSION['#attributes.accountName#LoggedIn'] EQ 0 AND SESSION['#attributes.accountName#LoginAttempts'] LT 8) {

 

  // ATTEMPT LOGIN

  THREAD.logInAccount = Application.cfcs.Login.logInAccount(attributes.email,attributes.password);

 

  // IF LOGIN ATTEMPT UNSUCCESSFUL

  if (THREAD.logInAccount EQ 0) {

  // INCREASE ATTEMPT COUNT

  SESSION['#attributes.accountName#LoginAttempts'] = SESSION['#attributes.accountName#LoginAttempts'] + 1;

  }

  // ELSE IF RETURNED VALUE IS 481 THEN ACCOUNT IS LOCKED

  else if (THREAD.logInAccount EQ 481) {

  // SET LOGIN ATTEMPT COUNT TO STOP LOOP

  SESSION['#attributes.accountName#LoginAttempts'] = 8;

  // UPDATE ACCOUNT TO MARK AS LOCKED

  THREAD.updLogin = Application.cfcs.Login.updLogin(attributes.email);

  }

  }

  </cfscript>

 

  <!--- IF ACCOUNT LOGGED IN --->

  <cfif SESSION['#attributes.accountName#LoggedIn'] EQ 1>

 

  <!--- SET ID FOR SEARCHING --->

  <cfset THREAD.definitionID = attributes.resourceID - 1610612736 />

 

  <!--- WHILE ACCOUNT LOGGED IN --->

  <cfloop condition="SESSION['#attributes.accountName#LoggedIn'] EQUALS 1">

 

  <!--- GET LATEST LOWEST BUY NOW PRICE --->

  <cfquery name="THREAD.getMinBIN" datasource="FUT" cachedWithin="#CreateTimeSpan(0,0,1,0)#">

  SELECT TOP 1 * FROM v_FUT14BINPrices WHERE resourceID = #attributes.resourceId# ORDER BY lastUpdated DESC

  </cfquery>

 

  <!--- INCLUDE FILE THAT CALCULATES BUYING AND SELLING PRICES --->

  <cfinclude template="sellingPrices.cfm" />

 

  <!--- IF BIDDING PRICE HAS BEEN SET --->

  <cfif StructKeyExists(THREAD,"biddingPrice")>

 

  <!--- MAKE SEARCH REQUEST, TIMING THE REQUEST --->

  <cfset THREAD.requestStart = GetTickCount() />

  <cfset THREAD.search = Application.cfcs.Search.dosearchOld(attributes.resourceId,THREAD.biddingPrice,0) />

  <cfset THREAD.requestDuration = GetTickCount() - THREAD.requestStart />

 

  <!--- IF SEARCH CONTAINS FILE CONTENT  --->

  <cfif StructKeyExists(THREAD.search,"FileContent")>

 

  <!--- DECLARE NUMBER OF RESULTS VARIABLE --->

  <cfset THREAD.numResults = 0 />

 

  <!--- IF JSON RETURNED --->

  <cfif IsJSON(THREAD.search.FileContent)>

 

  <!--- DESERIALIZE JSON --->

  <cfset THREAD.searchResults = DeserializeJSON(THREAD.search.FileContent) />

 

  <!---  IF PLAYER SEARCH RETURNS AUCTIONINFO STRUCT --->

  <cfif StructKeyExists(THREAD.searchResults,"auctionInfo")>

 

  <!--- SET NUMBER OF CARDS RETURNED FROM SEARCH --->

  <cfset THREAD.numResults = ArrayLen(THREAD.searchResults.auctionInfo) />

  <cfset THREAD.statusCode = "Successful" />

  <cfif THREAD.numResults EQ 0>

  <cfset THREAD.statusCode = "Successful - No Results" />

  </cfif>

 

  <!--- ELSE IF ERROR CODE RETURNED --->

  <cfelseif StructKeyExists(THREAD.searchResults,"code")>

 

  <cfset THREAD.statusCode = THREAD.searchResults.code />

 

  <!--- IF CODE 401 THEN SESSION HAS EXPIRED --->

  <cfif THREAD.statusCode EQ 401>

  <!--- SET SESSION AS LOGGED OUT AND ATTEMPT SESSION REFRESH --->

  <cfset SESSION['#attributes.accountName#LoggedIn'] = 0 />

  <cfset THREAD.logInAccount = Application.cfcs.Login.logInAccount(attributes.email,attributes.password) />

  </cfif>

 

  <!--- ELSE SOMETHING ELSE HAS HAPPENED --->

  <cfelse>

  <cfset THREAD.statusCode = "Something Else - " & THREAD.searchResults.code />

  </cfif>

 

  <!--- IF RESULTS RETURNED --->

  <cfif THREAD.numResults GT 0>

 

  <!--- LOOP ROUND RESULTS AND CHECK IF MATCH BUYING CRITERIA --->

  <cfloop index="i" from="1" to="#THREAD.numResults#">

 

  <!--- ***SAFETY CHECK*** - ENSURE ID OF CURRENT CARD IS SAME AS ONE SEARCHING FOR --->

  <cfif THREAD.searchResults.auctionInfo[i].itemData.resourceID EQ attributes.resourceId AND THREAD.getMinBIN.resourceID EQ attributes.resourceId>

 

  <!--- ENSURE BIN PRICE SET AND IS LESS THAN SET BUYING PRICE --->

  <cfif THREAD.searchResults.auctionInfo[i].buyNowPrice GT 0 AND THREAD.searchResults.auctionInfo[i].buyNowPrice LTE THREAD.biddingPrice>

 

  <!--- SET AUCTION END TIME --->

  <cfset THREAD.timeLeft = THREAD.searchResults.auctionInfo[i].expires />

  <cfset THREAD.auctionEnds = DateAdd("s",THREAD.timeLeft,Now()) />

  <!--- BUY CARD --->

  <cfset THREAD.buyCard = Application.cfcs.Bid.doBIN(THREAD.searchResults.auctionInfo[i].tradeID,THREAD.searchResul ts.auctionInfo[i].buyNowPrice,THREAD.searchResults.auctionInfo[i].startingBid,THREAD.searc hResults.auctionInfo[i].itemData.ID,THREAD.searchResults.auctionInfo[i].itemData.resourceI D,THREAD.startPrice,THREAD.binPrice,THREAD.lowestBIN,THREAD.searchResults.auctionInfo[i].i temData.discardValue,THREAD.auctionEnds,THREAD.requestStart,THREAD.requestDuration) />

 

</cfif>

 

  </cfif>

 

  </cfloop>

 

  </cfif>

 

  <cfelse>

  <cfset THREAD.statusCode = THREAD.search.FileContent />

  </cfif>

 

  <cfset THREAD.sleepDuration = 1000 - THREAD.requestDuration />

  <cfif THREAD.sleepDuration GT 0><cfset Sleep(THREAD.sleepDuration) /></cfif>

 

  </cfif>

 

  <!--- INSERT SEARCH RECORD --->

  <cfset THREAD.insSearchRecord = Application.cfcs.Search.insSearchRecord(THREAD.definitionID,THREAD.statusCode,THREAD.requ estDuration,THREAD.numResults,THREAD.biddingPrice) />

 

  </cfif>

 

  </cfloop>

 

  </cfif>

 

  </cfthread>

 

</cfloop>

 

 

I would have thought that the memory would have stayed around the same usage as each loop is performing the same set of actions so once the loop has went back to the start then I thought the previous loop would have been removed from memory (freeing up space) and then the same actions would be performed so the same memory total would then be used up but it seems almost as if each loop is being kept in memory and that is why it is growing.

 

Could someone please help me out and offer some guidance on how I could remedy this issue? If you need any more info then just let me know

 

Thanks in advance

jquery ajax get works but 500 error is thrown

$
0
0

Hi guys, I have this issue where I'm using Jquery to get a simple string from a cfc and although the string is returned correctly I also get a bunch of unwanted HTML code appended to the response. The HTML  code is CF's 500 error page.
It does not happen if I comment out the ajax call but as soon as I put it back it happens.  It's driving me nuts.  There are no errors listed in the logs.  The original application was not written by me and it uses application.cfm and onrequestend.cfm, I've commented out all code in onrequestend.cfm in case that's what's causing it but no change.   I've attached screenshots of the alert pop up where you can see that the response is there at the top.
Been browsing for a solution but cannot find it. Not sure where to start debugging it.  It must be something soo simple that I overlook. Any help would be much appreciated.
Here's my simple JS:

 

var thisEmail = $('#emailAddress').val();

 

$.ajax({

  type: "get",

  url:"cfcs/subscribe.cfc?returnformat=plain&email="+thisEmail,

  data: { method: "doSubscribe" },

  cache:false,

  normalizeJSON: true,

  success: function(data) {

 

  alert(data);

 

  });

 

Here's my simple CFC function:

 

<cffunction name="doSubscribe" access="remote" returntype="any" returnFormat="plain" output="no">

   

  <cfargument name="email" type="string" required="yes">

      

  <cfreturn "test response">

        

   

  </cffunction>

 

 

Capture.PNGCapture2.PNG

Where can I Download Cold Fusion Builder 3

$
0
0

I can see my license key in my account but i cant find anywhere i can download old products i have purchased?

Viewing all 14291 articles
Browse latest View live


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