I am using XML styling to draw 2 lines on my cfchart. For some unknown reason, the lines are not showing up. I have done this before with different charts and never had this problem. Please help!
The code:
<cfset xmlStyle = '<?xml version="1.0" encoding="UTF-8"?><frameChart is3D="false">
<frame type="none" isHStripVisible="true" stripColor="##F0F9FF" outline="black"/>
<elements drawOutline="false" drawShadow="true">
<series index="0">
<paint color="##00AEEF"/>
</series>
</elements>
<paint paint="Plain"/>
<xAxis>
<labelStyle orientation="Slanted"/>
</xAxis>
<insets left="5" top="5" right="5" bottom="5"/>
<legend isVisible="false"></legend>
<yAxis>
<limits index="1" min="75" max="76" color="red"/>
<limits index="2" min="50" max="51" color="yellow"/>
</yAxis>
</frameChart>'>
<cfchart format="flash" chartwidth="875" chartheight="400" scalefrom="0" scaleto="100" style="#xmlStyle#" xaxistitle="Date" yaxistitle="Score">
<cfchartseries type="line" query="myQyery" itemcolumn="myDate" valuecolumn="myScore" seriescolor="00AEEF"/>
</cfchart>
For some inexplicable reason, when the following was removed from the frame tag the lines showed up.
isHStripVisible="true" stripColor="##F0F9FF"
If anyone can shed some light on this strange behavior I'd appreciate it!
Related
I have a WCF service I want to trace. I have set the next lines int the Web.Config file:
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Critical, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "C:\Logs\MyCriticalTraces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
As you can see I just want CRITICAL messages but the File is extremely large (40 Mb every 5 minutes). It keeps getting larger and larger in a few minutes.
If I look into the file I see many messages but none seem to be Critical.
I just want to trace the Critical errors, otherwise the file would be impossible to move or open.
Any idea about this?
Sorry, I just copied-pasted that tracing code from some forum without knowing what I was doing. Then I realized that the option switchValue was wrong. I mean, I don't need the ActivityTracing log. So the line
switchValue="Critical, ActivityTracing"
Should be:
switchValue="Critical"
So the result is this:
<system.diagnostics>
<sources>
<source name="System.ServiceModel"
switchValue="Critical"
propagateActivity="true">
<listeners>
<add name="traceListener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "C:\Logs\MyCriticalTraces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
I am trying to loop over a 2-D array whose dimensions are 12000 * 20 and I am continuously getting java.lang.OutOfMemoryError.
Initially I thought this might be because of heap size so I increased my heap size but I was still getting the same error. So I ran a garbage collector like this:
<cflock name="checkMemory" type="exclusive" timeout="1" throwontimeout="yes">
<cfset objSystem = CreateObject( "java", "java.lang.System" )>
<cfset objSystem.gc()>
</cflock>
and I dumped the free memory which was around 850MB:
<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime()>
<cfset freeMemory = runtime.freeMemory()>
<cfdump var="#freeMemory#" label="free">
Here I am trying to create a XML variable and while looping I am getting heap error:
<cfxml variable="variables.XML">
<cfoutput>
<ROWS>
<cfloop from="3" to="#arrayLen(local.array)#" index="i" step="1">
<ROW>
<cfloop from="1" to="#arrayLen(local.array[2])#" index="j" step="1">
<#ucase(local.array[2][j])#>
<![CDATA[#trim(local.array[i][j])#]]>
</#ucase(local.array[2][j])#>
</cfloop>
</ROW>
</cfloop>
</ROWS>
</cfoutput>
</cfxml>
This is the stack trace:
java.lang.OutOfMemoryError at
java.io.WinNTFileSystem.getBooleanAttributes(Native Method) at
java.io.File.exists(File.java:733) at
coldfusion.xml.XmlProcessor.getSourceURL(XmlProcessor.java:246) at
coldfusion.xml.XmlProcessor.parse(XmlProcessor.java:155) at
coldfusion.tagext.lang.XmlTag.doEndTag(XmlTag.java:85) at
cffeeds2ecfc1003675922$funcDEMO1._factor8(C:\component\abc.cfc:1235)
at
cffeeds2ecfc1003675922$funcDEMO1.runFunction(C:\component\abc.cfc:1192)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cffeeds2ecfc1003675922$funcDEMO.runFunction(\component\abc.cfc:935) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:188) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:374)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) 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.xml.rpc.CFCServlet.invoke(CFCServlet.java:139) at
coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:290) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
com.intergral.fusionreactor.filter.FusionReactorFilter.i(FusionReactorFilter.java:566)
at
com.intergral.fusionreactor.filter.FusionReactorFilter.c(FusionReactorFilter.java:258)
at
com.intergral.fusionreactor.filter.FusionReactorFilter.doFilter(FusionReactorFilter.java:164)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) 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)
Is there any better solution to avoid looping like this or to resolve this error?
I created a cfm page locally and added some variables in it like this:
<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime()>
<cfset freeMemory = runtime.freeMemory()>
<cfset totalMemory = runtime.totalMemory()>
<cfset maxMemory = runtime.maxMemory()>
<cfdump var="#freeMemory#" label="free">
<cfdump var="#totalMemory#" label="total">
<cfdump var="#maxMemory#" label="max">
Every time I was refreshing this page the free memory size was decreasing until I ran the GC. I am still trying to figure out why this is happening. Any suggestions in this regard?
Please help.
Thanks in advance.
After suggestions from Adam Cameron, Dan Bracuk and James Moberg, I have done the following and I am not getting the heap error now. I suspect that it was because of CFXML tag but not sure.
Converting all element of array[2] to uppercase:
<cfloop from="1" to="#arrayLen(local.array[2])#" index="i" step="1">
<cfset local.array[2][i] = ucase(local.array[2][i])>
</cfloop>
Then using cfsavecontent to generate the xml string:
<cfsavecontent variable="local.xmlString">
<?xml version="1.0" encoding="UTF-8"?>
<ROWS>
<cfoutput>
<cfloop from="3" to="#arrayLen(local.array)#" index="local.currentRow" step="1">
<ROW>
<cfloop from="1" to="#arrayLen(local.array[2])#" index="local.currentColumn" step="1">
<#local.array[2][local.currentColumn]#>
<![CDATA[#trim(local.array[local.currentRow][local.currentColumn])#]]>
</#local.array[2][local.currentColumn]#>
</cfloop>
</ROW>
</cfloop>
</cfoutput>
</ROWS>
</cfsavecontent>
<cfset local.xml = xmlParse(local.xmlString)>
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#" />
%yaourt -Qi ocaml-ocsigenserver
name : ocaml-ocsigenserver
version : 2.0.2-1
URL : http://ocsigen.org/
%cat ocsigen.conf.qachina
...
<ocsigen>
<server>
<port>8000</port>
<logdir>/media/E/RnD/ocaml/test/log/</logdir>
<datadir>/media/E/RnD/ocaml/test/data</datadir>
<user>***</user>
<group>***</group>
<charset>utf-8</charset>
<findlib path="/usr/lib/ocaml"/>
<extension findlib-package="ocsigenserver.ext.staticmod"/>
<extension findlib-package="ocsigenserver.ext.cgimod">
<cgitimeout value="30"/>
</extension>
<host charset="utf-8" hostfilter="*">
<site path="ocsigenstuff">
<static dir="/srv/ocsigenserver/ocsigenstuff" />
</site>
<site path="qachina">
<cgi regexp="cgi-bin/([^/]*)" dir="/media/E/www/qachina/cgi-bin/" script="\1" />
<static dir="/media/E/www/qachina" />
</site>
<static dir="/srv/ocsigenserver" />
</host>
</server>
</ocsigen>
%ocsigen -c ocsigen.conf.qachina
When visiting http://127.0.0.1:8000, it works great! However, no matter visiting http://127.0.0.1:8000/ocsigenstuff or http://127.0.0.1:8000/qachina, it reports 404 error!
Any suggestion is appreciated!
There is nothing wrong with your config file. Ocsigen is looking for "index.html" in the directory, but you provided "index.htm", so it returns a "page not found" error.
As Stéphane pointed out, such a problem can be discovered by running ocsigen using the -V option.
Can someone please tell me why my build script (nant) doesn't display the unit test details in the command prompt window? I have verbose set to true, but it doesn't want to display any details about my unit tests. Here's the target:
<target name="run-unit-tests" depends="compile, move.assemblies.for.tests, rebuildDatabase">
<mkdir dir="${tests.output.dir}" />
<nunit2 haltonfailure="true" failonerror="true" verbose="true">
<formatter type="Xml" extension=".xml" outputdir="${tests.output.dir}" usefile="true" />
<test assemblyname="${test.assembly.file}" />
</nunit2>
<echo message="Unit Testing Done!" />
</target>
The command prompt window just displays this:
[mkdir] Creating directory 'C:\Projects\TestProject\build\artifacts\UnitTestOutput'.
[echo] Unit Testing Done!
build:
BUILD SUCCEEDED
Am I missing something here?
Thanks!
I found the answer. I looked at the source for CodeCampServer and saw a line
<formatter type="Plain" />
and added it to my build script so it looks like this:
<nunit2 haltonfailure="true" failonerror="true" verbose="true">
<formatter type="Xml" extension=".xml" outputdir="${tests.output.dir}" usefile="true" />
<formatter type="Plain" />
<test assemblyname="${test.assembly.file}" />
</nunit2>
and now it displays the details.
Sorry to ask the question prematurely on here, but at least it might help someone in the future if they have a similar problem.
Is there a log file in ${tests.output.dir} ? If so, what if you set usefile to false and type to "Plain"?