Related Categories: RIA, ColdFusion, Other
Related Categories: RIA, ColdFusion, Other
Related Categories: ColdFusion
We have a DB table with varchar values. To make it easy i've created it with a QueryNew:
<cfset getTMP = QueryNew("id, col1, col2")>
<cfset QueryAddRow(getTMP, 2)>
<cfset QuerySetCell(getTMP, "id", "1", 1)>
<cfset QuerySetCell(getTMP, "col1", "1212-77-01", 1)>
<cfset QuerySetCell(getTMP, "col2", "1212-77-01", 1)>
<cfset QuerySetCell(getTMP, "id", "2", 2)>
<cfset QuerySetCell(getTMP, "col1", "1212-77-01ewr", 2)>
<cfset QuerySetCell(getTMP, "col2", "1212-77-01qwe", 2)>And what is needed is to do the following query:
Select *
From getTMP
Where col1 = <cfqueryparam CFSQLTYPE="CF_SQL_VARCHAR" value="1212-77-01">
or col2 = <cfqueryparam CFSQLTYPE="CF_SQL_VARCHAR" value="1212-77-01"> What we will get is the following error:
It come that ColdFusion see the value of CFQUERYPARAM as a DATE and not as VARCHAR. Casting to varchar left and right sides of the equalities does not help at all.
Solution:
Use LIKEinstead of =in the query like this:
Select *
From getTMP
Where col1 like <cfqueryparam CFSQLTYPE="CF_SQL_VARCHAR" value="1212-77-01">
or col2 like <cfqueryparam CFSQLTYPE="CF_SQL_VARCHAR" value="1212-77-01">Related Categories: ColdFusion
1) an XML having the % sign in one of the values
example:
<?xml version='1.0' encoding='utf-8' ?>
<tst>
<details>
<somename>less than 50% </somename>
</details>
</tst>2) a script on a website (WS1) that submit that XML to other website (WS2) that is running CF8 (if the actual verion even matter)
The issue:
When submitting that XML with HTTP POST the following error is happening on WS2:
500
ROOT CAUSE:
java.lang.IllegalArgumentException
at coldfusion.filter.FormScope.parseName(FormScope.java:367)
at coldfusion.filter.FormScope.parseQueryString(FormScope.java:324)
at coldfusion.filter.FormScope.parsePostData(FormScope.java:293)
at coldfusion.filter.FormScope.fillForm(FormScope.java:243)
at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:430)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
javax.servlet.ServletException: ROOT CAUSE:
java.lang.IllegalArgumentException
at coldfusion.filter.FormScope.parseName(FormScope.java:367)
at coldfusion.filter.FormScope.parseQueryString(FormScope.java:324)
at coldfusion.filter.FormScope.parsePostData(FormScope.java:293)
at coldfusion.filter.FormScope.fillForm(FormScope.java:243)
at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:430)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
IF the % sign is taken off from the XML everything works fine and no error is generated.
NOTE 1:If the script doing the post is emulated on WS2 (so that the XML being submitted from WS2 to WS2), that "500" does not happen.
NOTE 2:The error seem to happen not on the application (because an test output followed by CFABORT just at the start of Application.cfm file does not change anything and the script on WS2 still get the error and not the test output).
NOTE 3:First the CF8 was on Java 1.5 . Then we reinstalled CF8, so it's on the default Java 6 now. But the error is still there.
ANY suggestions would be VERY appreciated!!!
Related Categories: ColdFusion
Here are the steps:
- Create a foloder that you will can access from your browser
- In that folder create an empty Application.cfc file
- Create a CFM file with
in it - Run that file from your browser
You will get a lot of info.. TOO much actually :)
Related Categories: ColdFusion, Other, Fun
So... how would you decipher the word COLDFUSION?
I would say it so:
Creativity, Operability, Longevity, Dignity, Flexibility, Usability, Simplicity, Intelligence, Optimality, Notoriety
Related Categories: ColdFusion, My Projects, 1ssBlog
Currently 1ssBlog have the following addons available:
- Social Tools
- Lyla Captcha
- Gravatars
- Entry Smiles
- Comment Smiles
- Related Entries
- Popularity Meter
- Rating System
- StatCounter
- Google Analytics
More to come with next updaters.
Related Categories: ColdFusion, My Projects, Other, Caching, 1ssBlog
"Smart Caching" is my try to make the caching process a little bit more inteligent and i've made it on the example of 1ssBlog. It allow the entries to be cached and de-cached automatically based on how often they are viewed.
How it work:
We set the period of time (1 day, 1 hour or 1 minute) and the number of unique views that should happen in that period of time in order the entry to get cached automatically.
So, if we set the period to 1 hour and the number of views to 30, then as soon as an entry will be viewd 30 times in a period of the specified length, the entry will get cached. But if after some time the entry will not get enough views in a period of specified length, the entry will de removed from the cache automaticaly.
Nice and easy, huh? But it make the caching process flexible.
I would like to hear of others think about it.



