fusioncharts: Line graph is giving errors - graph

Iam able to draw graphs like "Column2D, Column3D, Bar2D, Bar3D, Funnel etc, but Iam unable to draw graphs of "Line" and "MsLine". Following is my javascript code :
jQuery('#myChartContainer').insertFusionCharts({
swfPath: base_url+'resource/js/Charts/',
width : '400',
height: '500',
type: "MSLine",
chartRightMargin: '20',
data: "<graph caption='Monthly Sales Summary'
subcaption='For the year 2004'
xAxisName='Month'
yAxisMinValue='15000'
yAxisName='Sales'
numberPrefix='$'
showNames='1'
showValues='0'
rotateNames='0'
showColumnShadow='1'
animation='1'
showAlternateHGridColor='1'
AlternateHGridColor='ff5904'
divLineColor='ff5904'
divLineAlpha='20'
alternateHGridAlpha='5'
canvasBorderColor='666666'
baseFontColor='666666'>
<set name='Jan' value='17400' hoverText='January'/>
<set name='Feb' value='19800' hoverText='February'/>
<set name='Mar' value='21800' hoverText='March'/>
<set name='Apr' value='23800' hoverText='April'/>
<set name='May' value='29600' hoverText='May'/>
<set name='Jun' value='27600' hoverText='June'/>
<set name='Jul' value='31800' hoverText='July'/>
<set name='Aug' value='39700' hoverText='August'/>
<set name='Sep' value='37800' hoverText='September'/>
<set name='Oct' value='21900' hoverText='October'/>
<set name='Nov' value='32900' hoverText='November' />
<set name='Dec' value='39800' hoverText='December' />
</graph>",
dataFormat: "XMLData",
wMode: "transparent"
});
When I use, Line/MSLine graphs, I get following error in FIREBIG :
"uncaught exception: Chart Type Not Found!"
But when I check swf files on server, I can see LINE and MSLINE swfs, along with other graph swfs like COLUMNS2S, COLUMN3D, FUNNEL etc.
Can some one guide me where and what Iam doing wrong and how it can be rectified.
Thanks in advance

Have you been able to successfuly plot any charts?
I'm also not convinced your XML is valid. Please see the FusionCharts Support Forum for the relevant XSDs. I haven't created FusionCharts usign JavaScript before but the following is valid xml:
<chart>
<categories>
<category label='Jan'>
<category label='Feb'>
<category label='Mar'>
<category label='Apr'>
<category label='May'>
<category label='Jun'>
<category label='Jul'>
<category label='Aug'>
<category label='Sep'>
<category label='Oct'>
<category label='Nov'>
<category label='Dec'>
</categories>
<dataset>
<set value='17400' hoverText='January'/>
<set value='19800' hoverText='February'/>
<set value='21800' hoverText='March'/>
<set value='23800' hoverText='April'/>
<set value='29600' hoverText='May'/>
<set value='27600' hoverText='June'/>
<set value='31800' hoverText='July'/>
<set value='39700' hoverText='August'/>
<set value='37800' hoverText='September'/>
<set value='21900' hoverText='October'/>
<set value='32900' hoverText='November' />
<set value='39800' hoverText='December' />
</dataset>
</chart>

Please try once using the name line2d and msline2d.
Here is the list of acceptable chart types:
area2d
bar2d
bubble
candlestick
column2d
column3d
donut2d
donut3d
doughnut2d
doughnut3d
dragarea
dragcolumn2d
dragline
dragnode
drawingpad
errorbar2D
exportcomponent
funnel
gantt
horizontalbullet
inversearea2d
inversecolumn2d
inverseline2d
kagi
line2d
logcolumn2d
logline2d
msarea2d
msbar2d
msbar3d
mscolumn2d
mscolumn3d
mscolumn3dline
mscolumn3dlinedy
mscombi2d
mscombi3d
mscombidy2d
msline2d
msspline2d
mssplinearea2d
msstackedcolumn2d
msstackedcolumn2dlinedy
multiaxisline
multilevelpie
pie2d
pie3d
pyramid
radar
realtimeangular
realtimearea
realtimebulb
realtimecolumn
realtimecylinder
realtimehorizontalled
realtimehorizontallinear
realtimeline
realtimestackedarea
realtimestackedcolumn
realtimethermometer
realtimeverticalled
scatter
scrollarea2d
scrollcolumn2d
scrollcombi2d
scrollcombidy2d
scrollline2d
scrollstackedcolumn2d
selectscatter
sparkcolumn
sparkline
sparkwinloss
spline2d
splinearea2d
ssgrid
stackedarea2d
stackedbar2d
stackedbar3d
stackedcolumn2d
stackedcolumn3d
stackedcolumn3dlinedy
verticalbullet
waterfall

Related

Exception while evaluating Camunda DMN decision

I am trying to parse a sample decision table, but getting below exception
org.camunda.bpm.dmn.feel.impl.FeelException: FEEL/SCALA-01008 Error while evaluating expression: failed to evaluate expression ‘“Fall”’: no variable found for name ‘cellInput’
I have created dmn file using Camunda Modeler Version 4.12.0 and below is java code to parse the decision.
VariableMap variables = Variables
.putValue(“season”, “Spring”);
DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();
InputStream inputStream = DishDecider.class.getResourceAsStream("/dishTest.dmn");
DmnModelInstance dmnModelInstance = Dmn.readModelFromStream(inputStream);
List decisions = dmnEngine.parseDecisions(dmnModelInstance);
DmnDecision decision = decisions.get(0);
DmnDecisionTableResult result = dmnEngine.evaluateDecisionTable(decision, variables);
String desiredDish = result.getSingleResult().getSingleEntry();
System.out.println("Dish Decision:\n\tI would recommend to serve: " + desiredDish);
Below is dmn file created with Camunda modeler 4.12.0
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="decision" name="Dish" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="4.12.0">
<decision id="Decision_0iitlac" name="Dish">
<decisionTable id="DecisionTable_0gwyugh" hitPolicy="ANY">
<input id="Input_1" label="Season" camunda:inputVariable="season">
<inputExpression id="InputExpression_1" typeRef="string">
<text>season</text>
</inputExpression>
</input>
<output id="Output_1" label="Dish" name="desiredDish" typeRef="string" />
<rule id="DecisionRule_0oq0hav">
<description>-</description>
<inputEntry id="UnaryTests_0m9w26w">
<text>"Fall"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0ii151o">
<text>"Spareribs"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_1atwuts">
<description>-</description>
<inputEntry id="UnaryTests_1bnxqqw">
<text>"Winter"</text>
</inputEntry>
<outputEntry id="LiteralExpression_1bzzfsr">
<text>"RoastBeer"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_0kf4y0a">
<inputEntry id="UnaryTests_09pkbsv">
<text>"Spring"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0fx9hii">
<text>"Dry Aged steak"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_020pynb">
<description>Less Effort</description>
<inputEntry id="UnaryTests_10ydtir">
<text>"Fall","Winter","Spring"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0byu0h6">
<text>"Stew"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_19jjhib">
<description>Hey why not</description>
<inputEntry id="UnaryTests_03eg1qd">
<text>"Summer"</text>
</inputEntry>
<outputEntry id="LiteralExpression_0cx6p63">
<text>"Light Sald"</text>
</outputEntry>
</rule>
<rule id="DecisionRule_1cnr8kg">
<inputEntry id="UnaryTests_12w0ceb">
<text></text>
</inputEntry>
<outputEntry id="LiteralExpression_1g1nomo">
<text></text>
</outputEntry>
</rule>
</decisionTable>
</decision>
<dmndi:DMNDI>
<dmndi:DMNDiagram>
<dmndi:DMNShape dmnElementRef="Decision_0iitlac">
<dc:Bounds height="80" width="180" x="160" y="100" />
</dmndi:DMNShape>
</dmndi:DMNDiagram>
</dmndi:DMNDI>
</definitions>
Any help is appreciated.
Is there a reason you are writing java code to parse the DMN table yourself? The Camunda engine will parse and evaluate the table for you as part of running the process.
That being said, It does not appear that your Java code is complete as I cannot see where you are feeding in any variables. I assume that you should be providing an input variable cellInput to be evaluated.
dg
In the Season Column you are changing the default for the field 'Input Variable' from cellInput to season. Remove season from the Input variable field and make sure a value for the data season is passed in.

Embedded Jetty upgrade issues from 6.1.7 to 9.4.43

I have used jetty.xml for configuration in older jetty version which looks something like this:
<Configure id="Server" class="org.mortbay.jetty.Server">
<Set name="ThreadPool">
<New class="org.mortbay.thread.BoundedThreadPool">
<Set name="minThreads">10</Set>
<Set name="maxThreads">250</Set>
<Set name="lowThreads">25</Set>
</New>
</Set>
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="host">
<SystemProperty name="jetty.host"/>
</Set>
<Set name="port">
<SystemProperty name="jetty.port" default="9096"/>
</Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">5000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.mortbay.jetty.Handler">
<Item>
<New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
</Item>
<!-- Disabling this as it is a security risk (by exposing all contexts) in production-->
<!--Item>
<New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
</Item-->
<Item>
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
</Item>
</Array>
</Set>
</New>
</Set>
<Call name="addLifeCycle">
<Arg>
<New class="org.mortbay.jetty.deployer.ContextDeployer">
<Set name="contexts">
<Ref id="Contexts"/>
</Set>
<Set name="configurationDir">
<SystemProperty name="jetty.home" default="."/>/contexts</Set>
<Set name="scanInterval">1</Set>
</New>
</Arg>
</Call>
<New class="org.mortbay.jetty.servlet.Context">
<Arg>
<Ref id="Contexts"/>
</Arg>
<Arg>/cts/output</Arg>
<Set name="resourceBase">
<SystemProperty name="jetty.home" default="."/>/../cache/</Set>
<Call name="addServlet">
<Arg>com.myservlet.webservices.remote.FileProxyServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
<Ref id="RequestLog">
<Set name="requestLog">
<New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
<Set name="filename">
<SystemProperty name="jetty.logs" default="../logs"/>/ws.request_yyyy_mm_dd.log</Set>
<Set name="filenameDateFormat">yyyy_MM_dd</Set>
<Set name="retainDays">90</Set>
<Set name="append">true</Set>
<Set name="extended">true</Set>
<Set name="logCookies">false</Set>
<Set name="LogTimeZone">GMT</Set>
</New>
</Set>
</Ref>
<!-- =========================================================== -->
<!-- extra options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown">true</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">true</Set>
<Set name="gracefulShutdown">1000</Set>
</Configure>```
And to call this configuration following code has been written:
<Ref id="RequestLog">
<Set name="requestLog">
<New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
<Set name="filename">
<SystemProperty name="jetty.logs" default="../logs"/>/ws.request_yyyy_mm_dd.log</Set>
<Set name="filenameDateFormat">yyyy_MM_dd</Set>
<Set name="retainDays">90</Set>
<Set name="append">true</Set>
<Set name="extended">true</Set>
<Set name="logCookies">false</Set>
<Set name="LogTimeZone">GMT</Set>
</New>
</Set>
</Ref>
<!-- =========================================================== -->
<!-- extra options -->
<!-- =========================================================== -->
<Set name="stopAtShutdown">true</Set>
<Set name="sendServerVersion">true</Set>
<Set name="sendDateHeader">true</Set>
<Set name="gracefulShutdown">1000</Set>
</Configure>
Following code has been written to call this configuration:
Server myServer;
File theConfigFile = new File( "C://jetty//etc//jetty.xml" );
XmlConfiguration theXmlConfiguration = new XmlConfiguration( theConfigFile.toURL() );
theXmlConfiguration.configure( myServer );
myServer.start();
I was trying to create similar configuration using jetty 9.4.43:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="jetty" class="org.eclipse.jetty.server.Server">
<New id="threadPool" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
<Set name="minThreads" type="int"><Property name="jetty.threadPool.minThreads" deprecated="threads.min" default="10"/></Set>
<Set name="maxThreads" type="int"><Property name="jetty.threadPool.maxThreads" deprecated="threads.max" default="200"/></Set>
<Set name="reservedThreads" type="int"><Property name="jetty.threadPool.reservedThreads" default="25"/></Set>
<Set name="idleTimeout" type="int"><Property name="jetty.threadPool.idleTimeout" deprecated="threads.timeout" default="60000"/></Set>
<Set name="detailedDump" type="boolean"><Property name="jetty.threadPool.detailedDump" default="false"/></Set>
</New>
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.util.thread.ScheduledExecutorScheduler"/>
</Arg>
</Call>
<Set name="connectors">
<Array type="org.eclipse.jetty.server.Connector">
<Item>
<New class="org.eclipse.jetty.server.ServerConnector">
<Arg><Ref refid="jetty"/></Arg>
<Set name="port">
<Property name="jetty.http.port" default="9096" />
</Set>
</New>
</Item>
</Array>
</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.HandlerList">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="directoriesListed">true</Set>
<Set name="resourceBase">.</Set>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
<New class="org.eclipse.jetty.servlet.ServletContextHandler">
<Arg>
<Ref id="Contexts"/>
</Arg>
<Arg>/cts/output</Arg>
<Set name="resourceBase">
<SystemProperty name="jetty.home" default="."/>/../cache/</Set>
<Call name="addServlet">
<Arg>com.myservlet.webservices.remote.FileProxyServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
<Set name="stopAtShutdown"><Property name="jetty.server.stopAtShutdown" default="true"/></Set>
<Set name="stopTimeout"><Property name="jetty.server.stopTimeout" default="5000"/></Set>
<Set name="dumpAfterStart"><Property name="jetty.server.dumpAfterStart" deprecated="jetty.dump.start" default="true"/></Set>
<Set name="dumpBeforeStop"><Property name="jetty.server.dumpBeforeStop" deprecated="jetty.dump.stop" default="true"/></Set>
</Configure>
With new jetty.xml, port 9096 is exposed and all files available under that directory from where intelliJ is running is accessible but the FileProxyServlet url i.e localhost:9096/cts/output is not accessible(shows HTTP ERROR 404 Not Found).
This was not the case earlier instead only servlet was working fine.
Below is the console log on running with new jetty:
System Property [DEBUG] has been deprecated! (Use org.eclipse.jetty.LEVEL=DEBUG instead) 2021-10-16
13:56:48.162:INFO::main: Logging initialized #80050ms to
org.eclipse.jetty.util.log.StdErrLog [ShutdownMonitor] Not enabled
(port < 0): -1 2021-10-16 13:56:48.547:INFO:oejs.Server:Jetty Web
Server Start Thread: jetty-9.4.43.v20210629; built:
2021-06-30T11:07:22.254Z; git:
526006ecfa3af7f1a27ef3a288e2bef7ea9dd7e8; jvm 11.0.7+10-LTS 2021-10-16
13:56:48.650:INFO:oejs.AbstractConnector:Jetty Web Server Start
Thread: Started ServerConnector#70239ac0{HTTP/1.1,
(http/1.1)}{0.0.0.0:9096} Server#4db85c57{STARTING}[9.4.43.v20210629]
STARTING
+= QueuedThreadPool[qtp1589931229]#5ec46cdd{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor#16627f86{s=0/2,p=0}]
STARTED | +- org.eclipse.jetty.util.thread.ThreadPoolBudget#2d7c53b6 | +=
ReservedThreadExecutor#16627f86{s=0/2,p=0} - STARTED | +> threads
size=8 | +> qtp1589931229-31 RUNNABLE tid=31 prio=5 #
java.base#11.0.7/java.lang.invoke.InnerClassLambdaMetafactory.getParameterSize(InnerClassLambdaMetafactory.java:522)
| +> qtp1589931229-34 TIMED_WAITING tid=34 prio=5 IDLE | +>
qtp1589931229-29 TIMED_WAITING tid=29 prio=5 IDLE | +>
qtp1589931229-27 TIMED_WAITING tid=27 prio=5 IDLE | +>
qtp1589931229-32 TIMED_WAITING tid=32 prio=5 IDLE | +>
qtp1589931229-33 RUNNABLE tid=33 prio=5 SELECTING | +>
qtp1589931229-28 TIMED_WAITING tid=28 prio=5 IDLE | +>
qtp1589931229-30 TIMED_WAITING tid=30 prio=5 IDLE
+= ScheduledExecutorScheduler#1e20e272{STARTED} - STARTED
+= ServerConnector#70239ac0{HTTP/1.1, (http/1.1)}{0.0.0.0:9096} - STARTED | +~ Server#4db85c57{STARTING}[9.4.43.v20210629] - STARTING |
+~ QueuedThreadPool[qtp1589931229]#5ec46cdd{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor#16627f86{s=0/2,p=0}]
STARTED | +~ ScheduledExecutorScheduler#1e20e272{STARTED} - STARTED | +- org.eclipse.jetty.io.ArrayByteBufferPool#3a1e66f1 | +=
HttpConnectionFactory#dc1f9ce[HTTP/1.1] - STARTED | | +-
HttpConfiguration#1960af83{32768/8192,8192/8192,https://:0,[]} | |
+> customizers size=0 | | +> formEncodedMethods size=2 | | | +> POST | | | +> PUT | | +> outputBufferSize=32768 | | +> outputAggregationSize=8192 | | +> requestHeaderSize=8192 | | +> responseHeaderSize=8192 | | +> headerCacheSize=1024 | | +> secureScheme=https | | +> securePort=0 | | +> idleTimeout=-1 | | +> blockingTimeout=-1 | | +>
sendDateHeader=true | | +> sendServerVersion=true | | +>
sendXPoweredBy=false | | +> delayDispatchUntilContent=true | |
+> persistentConnectionsEnabled=true | | +> maxErrorDispatches=10 | | +> minRequestDataRate=0 | | +> minResponseDataRate=0 |
| +> cookieCompliance=RFC6265 | | +>
setRequestCookieCompliance=RFC6265 | | +>
notifyRemoteAsyncErrors=true | | +> relativeRedirectAllowed=false
| += SelectorManager#ServerConnector#70239ac0{HTTP/1.1,
(http/1.1)}{0.0.0.0:9096} - STARTED | | +=
ManagedSelector#6ade7db{STARTED} id=0 keys=0 selected=0 updates=0 -
STARTED | | +=
EatWhatYouKill#6c4eab86/SelectorProducer#550ad4bd/PRODUCING/p=false/QueuedThreadPool[qtp1589931229]#5ec46cdd{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor#16627f86{s=0/2,p=0}][pc=0,pic=0,pec=0,epc=0]#2021-10-16T13:56:48.6782212+05:30
STARTED | | | +- SelectorProducer#550ad4bd | | | +~ QueuedThreadPool[qtp1589931229]#5ec46cdd{STARTED,8<=8<=200,i=6,r=-1,q=0}[ReservedThreadExecutor#16627f86{s=0/2,p=0}]
STARTED | | +> updates # 2021-10-16T13:56:48.6732217+05:30 size=0 | | +> keys # 2021-10-16T13:56:48.674221+05:30 size=0 |
+- sun.nio.ch.ServerSocketChannelImpl[/0:0:0:0:0:0:0:0:9096] | +- qtp1589931229-31-acceptor-0#24c38c77-ServerConnector#70239ac0{HTTP/1.1,
(http/1.1)}{0.0.0.0:9096}
+= HandlerList#34d20482{STARTED} - STARTED | += ResourceHandler#28a68c0{STARTED} - STARTED
+= ErrorHandler#61ad62a3{STARTED} - STARTED
+> jdk.internal.loader.ClassLoaders$AppClassLoader#311d617d +> jdk.internal.loader.ClassLoaders$PlatformClassLoader#5e955596 key: +-
bean, += managed, +~ unmanaged, +? auto, +: iterable, +] array, +#
map, +> undefined 2021-10-16 13:56:48.679:INFO:oejs.Server:Jetty Web
Server Start Thread: Started #80567ms
I have been struggling on this from past few days, Can anyone please help me out?
Some changes I would recommend.
First, the ResourceHandler is doing nothing for you.
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="directoriesListed">true</Set>
<Set name="resourceBase">.</Set>
</New>
</Item>
</Array>
At best it sits there and does nothing. (as it has no context so no requests can reach it).
At worst, the way you have set it up you've now shared your entire drive via that ResourceHandler.
Remove it.
Next, the declaration of your ServletContext ...
<New class="org.eclipse.jetty.servlet.ServletContextHandler">
<Arg>
<Ref id="Contexts"/>
</Arg>
<Arg>/cts/output</Arg>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>/../cache/</Set>
<Call name="addServlet">
<Arg>com.myservlet.webservices.remote.FileProxyServlet</Arg>
<Arg>/</Arg>
</Call>
Things about this declaration ...
It doesn't end it </New> so it's a broken XML.
Fix your XML.
The first <Arg><Ref id="Contexts"/></Arg> is pointless and mangled as well. The first argument appears to be attempting to point to a Contexts reference somewhere else, but that reference doesn't exist anywhere, and your use of <Ref> element is wrong as well, you've declared the <Ref> itself with the id="Contexts" and are not referencing some other id, which would be <Ref refid="otherId"/>.
Remove that <Arg> entirely, it serves no purpose
The use of <Arg>/cts/output</Arg> to set the context-path is wrong in multiple ways.
Context Path rules are (Must start with / and cannot contain any other slash anywhere else, no nested context paths, that's what url-patterns are for)
Don't attempt to use the constructor to set the context-path, use the setter.
Remove this <Arg> as well, declare a valid context path, and then use the setter instead <Set name="contextPath">/foo</Set>
You add a servlet to / url-pattern, making the effort on resourceBase invalid.
Fix this url-pattern.
Your ServletContextHandler is not part of the server handler tree as well. I think you were trying to do that with the first <Arg>, but that's not how you add it to the handler tree.
If you are declaring it directly, just put the <New class="ServletContextHandler">... in the handler tree itself.
If you are loading / instantiating the ServletContextHandler later, then you have to use the DeploymentManager and WebAppProvider along with an existing ContextHandlerCollection that is present in the handler tree already for the deployment to add it to.
You have a weird and frankly broken mix of usages that not even Jetty 6 should have allowed.
You cannot have FileProxyServlet on the default url-pattern (which is /) AND have static resources served at the same time.
Suggestion, use Jetty properly (these suggestions also work in Jetty 6 and all the way back to Jetty 4 no less!)
Don't mix ServletContextHandler and ResourceHandler.
Use the ServletContextHandler only.
Make the ServletContextHandler contexPath only /ctx
Make the ServletContextHandler resourceBase point to the location (directory or jar:file:// url) where your static file content is.
Add the normal DefaultServlet to your ServletContextHandler (make sure it's named "default" and is the only servlet mapped to /).
Add your com.myservlet.webservices.remote.FileProxyServlet to the url-pattern /output.
Finally, add your ServletContextHandler to the server Handler tree.
Here's some more information from past answers that I encourage you to read.
Jetty: default servlet context path
Serving static files from alternate path in embedded Jetty
What is difference between ServletContextHandler.setResourceBase and ResourceHandler.setResourceBase when using Jetty embedded container?
Embedded Jetty handling urls to serve content
How to configure Jetty Handlers?
Serving static files from alternate path in embedded Jetty
Jetty: How to nest HandlerWrapper, HandlerList, and ContextHandlerCollection, and ContextHandler
Thing is, doing this entirely in a single XML file is just baffling (the use of a single XML file to configure Jetty was discouraged back when Jetty 6.0.0 was first released). Have you considered using the XML files that come with jetty-home already and just referencing them (in the correct order) in your own embedded-jetty startup?
That means you only have to define, by hand, the ServletContextHandler, and put it wherever you want your WebAppProvider to look for contexts to deploy.
Bonus is that your effort to upgrade Jetty versions becomes trivial.

WSO2 : Transforming response xml

I would like to turn this xml response into something more easily readable.
<?xml version="1.0" encoding="ISO-8859-1"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
<soap:Body>
<executeResponse xmlns="urn:GCE">
<BusinessViewServiceexecuteOut xmlns="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" xmlns:ns2="http://www.generixgroup.com/processus/configuration/scheduler" xmlns:ns3="http://www.generix.fr/technicalframework/business/service/common">
<xmlpres><?xml version = '1.0' encoding = 'UTF-8'?> <VueTable type="View" name="Table" habctr="true" total_business_row="2" nbline="400" confNbline="400" numpage="1" nbpage="1">
<JTblView name="JTblView" type="ViewObject" maxfetchsize="999" maxfetchsizeexceeded="false">
<JTblViewRow current="true" type="ViewRow" index="1" business_row_index="1">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>N</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Non</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Non</business_data>
</Lir>
</JTblViewRow>
<JTblViewRow type="ViewRow" index="2" business_row_index="2">
<Cletbl precision="6" type="VARCHAR" pk="true">
<business_data>O</business_data>
</Cletbl>
<Codtbl precision="6" type="VARCHAR" pk="true">
<business_data>001</business_data>
</Codtbl>
<Lib1 precision="30" type="VARCHAR">
<business_data>Oui</business_data>
</Lib1>
<Lib2 precision="30" type="VARCHAR">
<business_data/>
</Lib2>
<Lir precision="10" type="VARCHAR">
<business_data>Oui</business_data>
</Lir>
</JTblViewRow>
</JTblView>
</VueTable></xmlpres>
</BusinessViewServiceexecuteOut>
</executeResponse>
</soap:Body></soap:Envelope>
At least if I could extract what's in the value of "xmlpres", the better I could do:
<table><row><code></code><libelle></libelle/></row></table>
To then turn it into a json response but I can't see ... I just get all the output or in json stream but with everything , which is not usable.
Create an out-mediation sequence with the following content and attach it to the respective API and try out the scenario. This is to extract the xmlpres content and send that as the response to the client
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="out-sequence">
<!-- extract the xmlpres content and store as OM element -->
<property name="XMLBody"
expression="$body//soap:Body//generic:xmlpres"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:gce="urn:GCE"
xmlns:generic="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" type="OM" />
<!-- pass the extracted property as response body -->
<enrich>
<source type="property" property="XMLBody" />
<target type="body" />
</enrich>
</sequence>
Hope this helps you to extract and send the response accordingly.

Dynamically populate version from version.sbt

I'm trying to take the version from version.sbt and and populate it to logback.xml's log appender's applicationVersion field.
version.sbt
version in ThisBuild := "0.4.63"
logback.xml
<configuration debug="true" scan="true" scanPeriod="60 seconds">
<appender name="ADP-MESSAGING" class="com.agoda.adp.messaging.logging.appenders.LogbackAppender">
<applicationName>MyApp</applicationName>
<applicationAssemblyName>myapp</applicationAssemblyName>
<applicationVersion>0.4.61</applicationVersion>
<!-- <applicationVersion>${application.version}</applicationVersion> -->
<apiKey>s234W##$WFW$#$#</apiKey>
<getCallerData>false</getCallerData>
</appender>
....
<root level="WARN">
<appender-ref ref="ADP-MESSAGING" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
I tried by adding ${application.version}, ${version} but no success.
How can I do this?
Please share your thoughts.
Thanks
The values interpolated in a logback.xml file are simply Java system properties. All you have to do is add a value to your Java commandline defining the value you want:
// NOTE: This will only work when running through sbt. You'll have to
// append the same value to your startup scripts when running elsewhere.
javaOptions += "-Dapplication.version=" + version.value
With this flag, you should be able to interpolate the version in your XML file:
<applicationVersion>${application.version}</applicationVersion>
You can add logback PropertyDefiner implementation:
package org.mypackage
import ch.qos.logback.core.PropertyDefinerBase
class VersionPropertyDefiner extends PropertyDefinerBase {
override def getPropertyValue: String = BuildInfo.version
}
You will get autogenerated (managed) scala code BuildInfo.version if you use BuildInfoPlugin in your project build settings.
Then you can define and use variable in your logback.xml configuration:
<configuration debug="true" scan="true" scanPeriod="60 seconds">
<define name="appVersion" class="org.mypackage.VersionPropertyDefiner"/>
<appender name="ADP-MESSAGING" class="com.agoda.adp.messaging.logging.appenders.LogbackAppender">
<applicationName>MyApp</applicationName>
<applicationAssemblyName>myapp</applicationAssemblyName>
<applicationVersion>${appVersion}</applicationVersion>
<apiKey>s234W##$WFW$#$#</apiKey>
<getCallerData>false</getCallerData>
</appender>
....
<root level="WARN">
<appender-ref ref="ADP-MESSAGING" />
<appender-ref ref="STDOUT" />
</root>
</configuration>

.net to coldfusion web service xml parsing

I'm almost there with this project. Given the xml below:
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<debtor xmlns="http://tempuri.org/Database.xsd">
<Customer diffgr:id="Customer1" msdata:rowOrder="0" diffgr:hasErrors="true">
<SeqNo>-1</SeqNo>
<AccGroup>1</AccGroup>
<AccountTypeID>1</AccountTypeID>
<CompaniesOfficeID>-4</CompaniesOfficeID>
<DOB />
<SignupDate>18/04/2007</SignupDate>
<DeferredDate />
<TeleSalesNo>5</TeleSalesNo>
<PIN>4433</PIN>
<Name>MR DAVID GETTI</Name>
<Salutation>MR</Salutation>
<FirstName>DAVID</FirstName>
<LastName>GETTI</LastName>
<Phone>64 7 555 522</Phone>
<Fax />
<CellPhone>64 25 999 999</CellPhone>
<Email>dave.getti#cpass.net.nz</Email>
<AfterHrs_Contact />
<SalesNo>0</SalesNo>
<CreditStatus>1</CreditStatus>
<RefGroupNo>0</RefGroupNo>
<PriceNo>-1</PriceNo>
<SmartLineProvider>-1</SmartLineProvider>
<Contact>DAVID GETTI</Contact>
<CustomerCode>1111111</CustomerCode>
<HasCellPhone>false</HasCellPhone>
<InvoiceOptions>12</InvoiceOptions>
<TradingAs>MR DAVID GETTI</TradingAs>
<FranchiseCode>-1</FranchiseCode>
<Existing>true</Existing>
<Address diffgr:id="Address1" msdata:rowOrder="0">
<SeqNo>-1</SeqNo>
<CustomerSeqNo>-1</CustomerSeqNo>
<Show>30</Show>
<TypeSelected>2</TypeSelected>
<Name>PostalAddress</Name>
<AddressNumber />
<Address1>88 Blue Lane East</Address1>
<Address2>REMA</Address2>
<Address3>AKL</Address3>
<Address4 />
<PostCode>1050</PostCode>
<LocationCode>0</LocationCode>
<AgentID>0</AgentID>
</Address>
<Address diffgr:id="Address2" msdata:rowOrder="1">
<SeqNo>-2</SeqNo>
<CustomerSeqNo>-1</CustomerSeqNo>
<Show>10</Show>
<TypeSelected>2</TypeSelected>
<Name>PhysicalAddress</Name>
<AddressNumber />
<Address1>44 OHINA STREET</Address1>
<Address2>REMA</Address2>
<Address3>AKL</Address3>
<Address4 />
<PostCode>1098</PostCode>
<LocationCode>1</LocationCode>
<AgentID>1</AgentID>
</Address>
I can access all the data, except the address details and populate a query object, using the code below:
<cfset Local.xRows = Local.xData["diffgr:diffgram"]["debtor"] />
<cfloop from="1" to="#arrayLen(Local.xRows.xmlChildren)#" index="Local.i">
<cfset Local.thisRow = Local.xRows.xmlChildren[Local.i] />
<cfset Local.tableName = Local.thisRow.xmlName />
<cfset queryAddRow(Local.result[Local.tableName], 1) />
<cfloop from="1" to="#arrayLen(Local.thisRow.xmlChildren)#" index="Local.j">
<cfif listfindnocase(vCols,Local.thisRow.xmlChildren[Local.j].xmlName)>
<cfset querySetCell(Local.result[Local.tableName], Local.thisRow.xmlChildren[Local.j].xmlName, Local.thisRow.xmlChildren[Local.j].xmlText, Local.result[Local.tableName].recordCount) />
</cfif>
</cfloop>
</cfloop>
However, I am stuck with how to access the individual address detail nodes under the main address node:
<Address diffgr:id="Address1" msdata:rowOrder="0">
Any help would be greatly appreciated.
I think you're trying to reference those individual nodes using an absolute reference instead of the easier local reference you get by using cfloop.
<cfset xmlCustomerInfo = xmlDoc.info[ "Customer" ][ Local.i ] />
<cfset arrAddressList = xmlCustomerInfo[ "Address" ] />
<cfloop
index="Local.j"
from="1"
to="#ArrayLen( arrAddressList )#"
step="1">
<cfset innerAddressNode = arrAddressList[ Local.j ] />
</cfloop>
Here are some great references to parsing XML in Coldfusion.
WARNING: Code is un-tested, just based on what you presented and how coldfusion parses Xml documents.

Resources