Local Instance Issue With Mach-II - coldfusion

I'm running mach-ii v1.8 on my local machine with CF10 installed on Win7. I copied a site down from production (which works) and is throwing an error of which I am unable to search for much help on.
Expected structure key - received .; StructGet cannot be executed.
The error occurred in /web/frameworks/mach_1_8/caching/strategies/TimeSpanCache.cfc: line 413
Called from /web/frameworks/mach_1_8/caching/strategies/TimeSpanCache.cfc: line 233
411: <cffunction name="getStorage" access="private" returntype="struct" output="false"
412 : hint="Gets a reference to the cache data storage.">
413 : <cfreturn StructGet(getScope() & "." & getScopeKey()) />
414 : </cffunction>
The best source I found was this thread, but my MACHII_APP_KEY has no punctuation in it. Ideas?
<cfparam name="MACHII_APP_KEY" type="string" default="expoadmin" />

Related

Using ColdFusion to consume a webservice

Per recommendations below I now only have the following:
<cfscript>
ws = CreateObject("webservice","http://demo2.mvrs.com/StiConnect/StiConnectWebService.svc?wsdl");
</cfscript>
<cfdump var="#ws#">
And the java error is back:
You've Thrown an Application Error
java.util.NoSuchElementException
Application
Caught an exception, type = Application
The contents of the tag stack are:
array
1
struct
COLUMN 0
ID CF_CFPAGE
LINE 3
RAW_TRACE at cfstTest2ecfm154367281.runPage(D:\Webs\dev\Criminal\Intranet\Web\dev\stTest.cfm:3)
TEMPLATE D:\Webs\dev\Criminal\Intranet\Web\dev\stTest.cfm
TYPE CFML
Below is the follow "Robust" error reporting from the page.
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Invalid construct: Either argument or name is missing.
When using named parameters to a function, each parameter must have a name.
The CFML compiler was processing:
An expression beginning with ws.OrderInteractive, on line 6, column 14.This message is usually caused by a problem in the expressions structure.
A script statement beginning with xlatstring on line 6, column 1.
A cfscript tag beginning on line 3, column 2.
A cfscript tag beginning on line 3, column 2.
The error occurred in /Intranet/Web/dev/stTest.cfm: line 6
4 : ws = CreateObject("webservice",
5 : "http://demo2.mvrs.com/StiConnect/StiConnectWebService.svc?singleWsdl");
6 : xlatstring = ws.OrderInteractive(MVRMODE="MVRUSA", PROCESS="NEWREQ", Cuser="01", Cpass="Abcd.1234", Ccode"K1433", CustomOutPutType="06", OrderState="OH", DPPACode="09", Clicense1="RR653845", cSocial1="286760936", CPOLICY1="TEST_CDLIS");
7 : writeoutput(xlatstring);
8 : </cfscript>
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36
Remote Address 172.16.0.224
Referrer
Date/Time 29-Jan-16 01:20 PM
Stack Trace
coldfusion.compiler.CFMLParserBase$MissingNameException: Invalid construct: Either argument or name is missing.
at coldfusion.compiler.cfml40.FunctionParameters(cfml40.java:6265)
at coldfusion.compiler.cfml40.ComplexReference(cfml40.java:6142)
at coldfusion.compiler.cfml40.VariableReference(cfml40.java:6061)
at coldfusion.compiler.cfml40.PrimaryExpression(cfml40.java:5866)
at coldfusion.compiler.cfml40.UnaryExpression(cfml40.java:5716)
at coldfusion.compiler.cfml40.ExponentialExpression(cfml40.java:5673)
at coldfusion.compiler.cfml40.MultiplyDivisionExpression(cfml40.java:5626)
at coldfusion.compiler.cfml40.IntegerDivisionExpression(cfml40.java:5607)
at coldfusion.compiler.cfml40.ModExpression(cfml40.java:5588)
at coldfusion.compiler.cfml40.AdditionExpression(cfml40.java:5541)
at coldfusion.compiler.cfml40.ConcatExpression(cfml40.java:5522)
at coldfusion.compiler.cfml40.ComparisonExpression(cfml40.java:5375)
at coldfusion.compiler.cfml40.NotExpression(cfml40.java:5325)
at coldfusion.compiler.cfml40.AndExpression(cfml40.java:5297)
at coldfusion.compiler.cfml40.OrExpression(cfml40.java:5278)
at coldfusion.compiler.cfml40.XorExpression(cfml40.java:5259)
at coldfusion.compiler.cfml40.EqvExpression(cfml40.java:5240)
at coldfusion.compiler.cfml40.ImpExpression(cfml40.java:5221)
at coldfusion.compiler.cfml40.HookExpression(cfml40.java:5176)
at coldfusion.compiler.cfml40.expr(cfml40.java:5160)
at coldfusion.compiler.cfml40.cfScriptExpression(cfml40.java:2446)
at coldfusion.compiler.cfml40.SimpleStatement(cfml40.java:612)
at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1542)
at coldfusion.compiler.cfml40.cfscript(cfml40.java:1404)
at coldfusion.compiler.cfml40.cfml(cfml40.java:4342)
at coldfusion.compiler.cfml40.cftry(cfml40.java:1147)
at coldfusion.compiler.cfml40.cfml(cfml40.java:4336)
at coldfusion.compiler.cfml40.start(cfml40.java:4768)
at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:694)
at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:675)
at coldfusion.compiler.NeoTranslator.parseAndTransform(NeoTranslator.java:428)
at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:370)
at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:147)
at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(TemplateClassLoader.java:436)
at coldfusion.util.LruCache.get(LruCache.java:180)
at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:362)
at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)
at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)
at coldfusion.util.SoftCache.get(SoftCache.java:81)
at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:609)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:83)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
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.CfmServlet.service(CfmServlet.java:201)
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:286)
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)
I have also updated the way I am consuming the webservice using the createobject now (below you can see the way I original tried):
<cfscript>
ws = CreateObject("webservice",
"http://demo2.mvrs.com/StiConnect/StiConnectWebService.svc?singleWsdl");
xlatstring = ws.OrderInteractive(MVRMODE="MVRUSA", PROCESS="NEWREQ", Cuser="01", Cpass="xxx.xxx", Ccode"xxxx", CustomOutPutType="06", OrderState="OH", DPPACode="xx", Clicense1="xxxxxx", cSocial1="xxxxxxxxxx", CPOLICY1="TEST_CDLIS");
writeoutput(xlatstring);
</cfscript>
Below was the old way i was trying to connect and got my first error.
<cftry>
<cfinvoke
webservice="http://demo2.mvrs.com/StiConnect/StiConnectWebService.svc?singleWsdl"
method="OrderInteractive"
returnvariable="OrderInteractiveResponse">
<cfinvokeargument name="MVRMODE" value="xxxxx"/>
<cfinvokeargument name="Cuser" value="xxx"/>
<cfinvokeargument name="Cpass" value="xxxx"/>
<cfinvokeargument name="CustomOutPutType" value="6"/>
<cfinvokeargument name="OrderState" value="GA"/>
<cfinvokeargument name="DPPACode" value="xx"/>
<cfinvokeargument name="Clicense1" value="201099999"/>
</cfinvoke>
<cfoutput>This is the reported data #OrderInteractiveResponse#</cfoutput>
<cfcatch type="application">
<h3>You've Thrown an Application <b>Error</b></h3>
<cfoutput>
<!--- The diagnostic message from ColdFusion. --->
<p>#cfcatch.message#</p>
<p>Caught an exception, type = #CFCATCH.TYPE#</p>
<p>The contents of the tag stack are:</p>
<cfdump var="#cfcatch.tagcontext#">
</cfoutput>
</cfcatch>
...
<cfcatch type="Any">
<!--- Add exception processing code appropriate for all other
exceptions here ... --->
</cfcatch>
</cftry>
You should be able to look at the wsdl file and see all of the methods. Not sure what to try next. Any ideas what this error could mean?

ColdFusion file operation rejected with an exception error

I'm still using coldfusion 8 and the file operation I wrote works for one application but when I reuse the codes for another application I got an exception error.
I'm just simply need to copy, rename and move uploaded file from one directory to another.That's all I need. And this is for Oracle bcp from csv file.
All the permissions have been checked and allowed, all of the paths have been checked and correct. Both application reside at the same coldfusion server (unix based).
Here is what I'm trying to do:
I'm calling my comp:
<CFSET DestinationLoc = "/space/users/www/data/temp/Archives/#Trim(session.usergroup)#/">
<CFSET SourceLoc = "/space/users/www/data/temp/#Trim(session.usergroup)#">
<CFSET FileName = "#Trim(CFFILE.ServerFile)#">
<CFSET CopyRenameObjObj = createObject("component", "cfcomponents.ParentComp.Copy_and_Rename").init()>
<CFSET CopyRenameObjObj.Copy_and_Rename(DestinationLoc,SourceLoc,FileName)>
I created a copy and rename cfc:
<CFCOMPONENT>
<CFFUNCTION name="Init" access="public" returntype="any" output="false" hint="Returns an initialized component instance.">
<cfreturn THIS />
</CFFUNCTION>
<CFFUNCTION name="Copy_and_Rename">
<cfargument name="destinationPath" type="String" required="TRUE">
<cfargument name="SourcePath" type="String" required="TRUE">
<cfargument name="FileName" type="String" required="TRUE">
<!--- First copy the file from source location to destination location --->
<cffile action = "copy" destination = "#Trim(arguments.destinationPath)#"
source = "#Trim(arguments.SourcePath)#/#Trim(arguments.FileName)#"/>
<!--- Then move the file from the source to detination 2 --->
<cffile action = "move" destination = "/opt/coldfusion8/runtime/bin/"
source = "#Trim(arguments.SourcePath)#/#Trim(arguments.FileName)#"/>
<cffile action = "rename" destination = "/opt/coldfusion8/runtime/bin/#Trim(session.usergroup)#_PARENTLOADFeed.txt"
source = "/opt/coldfusion8/runtime/bin/#Trim(arguments.FileName)#"/>
</CFFUNCTION>
</CFCOMPONENT>
The error I'm getting is:
Despite of this error, the directory is there, the file is renamed, moved successfully but the process stop due to this error!
An exception occurred when performing a file operation copy on files
/space/users/www/data/temp/BC/BC_Smallfile.TXT and
/space/users/www/data /temp/Archives/BC/.
The cause of this
exception was: java.io.FileNotFoundException: /space
/users/www/data/temp/BC/BC_Smallfile.TXT (No such file or directory).
The error occurred in /space/users/www/webdocsec/cfcomponents /ParentComp/Copy_and_Rename.cfc: line 23
Problem code:
<!--- Source : /space/users/www/data/temp/BC/BC_testfile.TXT --->
<cffile action = "copy" destination =
"#Trim(arguments.destinationPath)#"
source = "#Trim(arguments.SourcePath)#/#Trim(arguments.FileName)#"/>

Error while Running a .exe file using coldfusion schedule task

I need to run a exe file on app server using coldfusion schedule task. I wrote code inside cfm file with cfexecute command below.
But the executable doesn't run with/without timeout clause in cfexecute. Can anyone point out what I'm doing wrong.
<cfsetting enableCFOutputOnly="false" requestTimeout="9600" />
<!--- Call executable --->
<cftry>
**<cfexecute name= "C:\npp.exe" />**
<cfcatch type="Any">
<cfoutput>(Cal): Error - #cfcatch.message#</cfoutput>
<!--- TO DO:Log error --->
<cflog application="true" log="application" type="Error"
text=" Error - #cfcatch.message#" />
</cfcatch>
</cftry>
<cflog application="true" log="application" type="Information" text=" executable called" />

Using binary data as a source in Railo's cfpdf tag

So I am saving PDF blob in a database and trying to retrieve it and display it on a page. When i run the code on Coldfusion 10 it runs as expected. However, when i move the same exact code over to Railo 4.2.1.0 I get an error.
I'm curious if it is possible to pass binary data into CFPDF Source tag in Railo. If not does anyone know of a good workaround?
When i run a dump the pdfBinary data does have the correct binary information inside of it.
Thanks
Code:
<cfset tcpInformation = dataPopulatorController.getTCPInformation(session.requestID, session.personID) />
<cfset pdfBinary = tcpInformation.file_content[1]>
<cfpdf action="read" source="pdfBinary" name="TCPDocument">
<cfheader name="Content-Disposition" value="filename=TCP.pdf" />
<cfcontent type="application/pdf" variable="#toBinary(TCPDocument)#" />
Error I get on Railo:
The Error Occurred in
/****/tcpviewer.cfm: line 7
5:
6:
7:
8:
9:
Java Stacktrace file or directory pdfBinary not exist
at railo.commons.io.res.util.ResourceUtil.toResourceExisting(ResourceUtil.java:199):199
at railo.commons.io.res.util.ResourceUtil.toResourceExisting(ResourceUtil.java:164):164
at railo.runtime.tag.PDF.toPDFDocument(PDF.java:1207):1207
at railo.runtime.tag.PDF.doActionRead(PDF.java:1033):1033
at railo.runtime.tag.PDF.doEndTag(PDF.java:568):568
at onboarding.views.tcpviewer_cfm$cf.call(/onboarding/views/tcpviewer.cfm:7):7
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:913):913
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:865):865
at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:206):206
at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2218):2218
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2185):2185
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:332):332
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472):472
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947):947
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408):408
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200):200
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source):-1
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1
at java.lang.Thread.run(Unknown Source):-1
When reading from a binary variable source in Railo it seems you need to wrap it with #s:
<cfpdf action="read" source="#pdfBinary#" name="TCPDocument">
But as Leigh says, there's no need to re-read the variable using CFPDF to output the content to the browser:
<cfset tcpInformation = dataPopulatorController.getTCPInformation(session.requestID, session.personID) />
<cfset pdfBinary = tcpInformation.file_content[1]>
<cfheader name="Content-Disposition" value="filename=TCP.pdf" />
<cfcontent type="application/pdf" variable="#pdfBinary#" />

CFExecute not working for imagemagick's command

I am running the following command using ColdFusion's cfexecute: composite -geometry +2+2 "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\316\resized.png" "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\templateImages\isubscribe\blank.png" "C:\Inetpub\wwwroot\isubscribe_uk\diomedes\www\images\newsletter\316\part1.png"
<cffunction name="executeWrap" returntype="string">
<cfargument name="commandToRun" type="string" required="Yes">
<cfargument name="cmdArg" type="string" required="Yes">
<cfset var result = "">
<cfexecute name="#arguments.commandToRun#" arguments="#arguments.cmdArg#"
variable="result" timeout="15" />
<!--- <cfdump var="#arguments#">
<cfdump var="#result#"> --->
<cfreturn result>
</cffunction>
For some reason the above thing does not work. Though when I run the command directly onto the command prompt then it works.
Any ideas please?
CFExecute ignores anything sent to standard error by the called process. To be able to see if there is any error output generated, add the "errorVariable" argument to your cfexecute call, then check if there is anything there and let your script react accordingly.
<cfexecute name="..command to run..."
arguments='.. your arguments...'
variable="results"
errorVariable="errorOuptut"
></cfexecute>
<cfif len(errorOuptut)>
<cfthrow message="#errorOuptut#" />
</cfif>
More info here:
http://www.raymondcamden.com/index.cfm/2008/4/9/ColdFusion-801-change-to-CFEXECUTE