Switch from Saxon HE to Saxon PE in WSO2 BPS - wso2

I need to switch WSO2 Business process server to use Saxon PE, rather than embedded Saxon HE as I'm using Saxon extensions for XSLTs.
I tried to remove the initial plugin from /repository/components/plugins/saxon.he_9.4.0.wso2v1.jar and put both Saxon PE jar and licence file into /lib and /lib/endrosed as was suggested here
That didn't help much as I'm still getting:
TID: [0] [BPS] [2013-01-09 11:08:08,551] INFO {org.apache.ode.bpel.runtime.ASSIGN} - Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault,lineNo=96,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault: org.apache.ode.utils.xsl.XslTransformException: XSL Transformation failed! {org.apache.ode.bpel.runtime.ASSIGN}
TID: [0] [BPS] [2013-01-09 11:08:08,551] INFO {org.apache.ode.bpel.runtime.ASSIGN} - Assignment Fault: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault,lineNo=96,faultExplanation={http://docs.oasis-open.org/wsbpel/2.0/process/executable}subLanguageExecutionFault: org.apache.ode.utils.xsl.XslTransformException: XSL Transformation failed! {org.apache.ode.bpel.runtime.ASSIGN}
The transformation fails however the same request gets transformed as expected and without any errors in unit test, so I presume BPS doesn't aware that it should use PE.
Also if an element that needs to be transformed using the extension is not arriving in the request - transformation works well.
Could anyone advise on this please?

This solution worked perfectly for me (just few easy steps to follow).

Related

how to do xsl:include over https in saxon?

I'm trying to run a transform directly from github. Saxon opens the initial xsl, but barfs on included xsls:
transform -xsl:https://raw.githubusercontent.com/VladimirAlexiev/LODE/master/src/main/webapp/extraction.xsl -s:ebg-ontology.rdf -o:index.html
Error on line 35 column 43 of extraction.xsl:
XTSE0165: I/O error reported by XML parser processing
https://raw.githubusercontent.com/VladimirAlexiev/LODE/master/src/main/webapp/swrl-module.xsl:
unknown protocol: https
Question Saxon error with XSLT import statement is slightly related but it uses java whereas I run from the command line. #michael-kay suggests there to add a base URL: I've added xml:base="." to no avail (and as you can see from the error message, the url of the module is correct).
What should I to do to enable Saxon to handle https? Running SaxonHE9-7-0-21N-setup.exe

GATE_Using for Thesis_Run-time Error

When I am trying to run corpus pipeline on language resources. It is throwing the below (even though I follow the order as Document reset, english tokeniser, sentence splitter)
Can someone help me with the process to debug this run-time error
Error:
gate.creole.ExecutionException: No sentences or tokens to process in document Password_Safe-window1.txt_0003E
Please run a sentence splitter and tokeniser first!
at gate.creole.POSTagger.execute(POSTagger.java:257)
at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
at gate.creole.SerialController.runComponent(SerialController.java:225)
at gate.creole.SerialController.executeImpl(SerialController.java:157)
at gate.creole.SerialAnalyserController.executeImpl(SerialAnalyserController.java:223)
at gate.creole.SerialAnalyserController.execute(SerialAnalyserController.java:126)
at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
at gate.gui.SerialControllerEditor$RunAction$1.run(SerialControllerEditor.java:1759)
at java.lang.Thread.run(Thread.java:745)
Edit:
The files are not empty. As i tried to implement #dedek's suggestion, it has thrown no errors. But raised one more problem as follows:
Exception in thread "ApplicationViewer1" java.lang.OutOfMemoryError: Java heap space
I think it is because your document is empty.
Can you confirm that?
There is a run-time param failOnMissingInputAnnotations of the POSTagger, set it to false and it should be ok.
See also the docs:
failOnMissingInputAnnotations - if set to false, the PR will not fail with an ExecutionException if no input Annotations are found and instead only log a single warning message per session and a debug message per document that has no input annotations (run-time, default = true).
Concerning the OutOfMemoryError: Java heap space
See following questions:
Getting OOM while using GATE on large data set
GATE PersistenceManager.loadObjectFromFile outofmemory error while loading .gapp files
JAVA PermGem memory

cascade face detection C++ Opencv 3.0

I am trying to implement face detection mentioned in the tutorial
http://docs.opencv.org/3.0-beta/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier
I am using OpenCV 3.0 on Ubuntu 14.04.
I downloaed the cascade xml files from here
https://github.com/opencv/opencv/tree/master/data/haarcascades
When I compile the code it gives me this error message:
OpenCV Error: Parsing error (/...../haarcascade_frontalcatface.xml(5): Valid XML should start with '<?xml ...?>') in icvXMLParse, file /home/taleb/opencv3/opencv/modules/core/src/persistence.cpp, line 2220
terminate called after throwing an instance of 'cv::Exception'
what(): /home/taleb/opencv3/opencv/modules/core/src/persistence.cpp:2220: error: (-212) /home/taleb/pythonproject/test1/haarcascade_frontalcatface.xml(5): Valid XML should start with '<?xml ...?>' in function icvXMLParse
Any suggestion?
I found a couple of fixes in stack overflow and other websites. They are as follows:
Change the character encoding from UTF-8 to ANSI with Notepad++.
Previous answer:
convert_cascade is for cascades trained by haartraining application and it does not support a format of cascades trained by traincascade application.
To do this with traincascade, just run opencv_traincascade again with
the same "-data" but set "-numStages" to the point you want to
generate up to. The application will load the trained stages, realize
that there is required number of stages, write the result cascade in
xml and finish a work. Interrupting the process during a stage could
result in corrupt data, so if you're best off deleting the stage in
completion.
refrence: https://stackoverflow.com/a/25831423/5671364.
XML Standard states:
if no encoding declaration is present in the XML document (and no
external encoding declaration mechanism such as the HTTP header is
available), the assumed encoding of an XML document depends on the
presence of the Byte-Order-Mark (BOM).
There are 3 ways to fix this:
Let OpenCV just put the ´encoding="ASCII"´ tag into the top root XML
tag.
Leave the top root XML tag, but encode everything as UTF-8
before writing it to file.
Do something else, with Byte-Order-Mark,
but keep it to the standard.
refrence: http://code.opencv.org/issues/976

What XSLT do you use to format MsBuild XML output in CruiseControl.Net?

We currently don't format our msbuild output in CC.NET (CruiseControl.Net) and as a result, finding the cause of a broken build involves reading the XML to find the last 'success="false"' instance in the output.
What XSLT do you use to format your msbuild output, and are you happy with the resulting HTML? I.e. do you find it easy to identify the cause of a broken build?
Thanks
b
EDIT:
Here's a sanitised sample of one of our CC project XML elements. I'm now wondering whether the merge of logs is the issue.
<project name="StackOverflowSample">
<workingDirectory>D:\_300</workingDirectory>
<webURL>&viewFarmReportWebURL;</webURL>
<sourcecontrol type="multi">
<sourceControls>
<vsts>
<!-- We get latest from TSF -->
</vsts>
</sourceControls>
</sourcecontrol>
<triggers>
<intervalTrigger seconds="60" />
</triggers>
<tasks>
<msbuild>
<executable>&msbuildExecutable;</executable>
<workingDirectory>app\consoleApp1</workingDirectory>
<projectFile>consoleApp1.sln</projectFile>
<buildArgs>/noconlog /p:Configuration=Release /v:quiet</buildArgs>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,"D:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"</logger>
</msbuild>
<nunit>
<path>&nunitConsoleExecutable;</path>
<assemblies>
<assembly> D:\_300\app\consoleApp1\bin\Release\consoleApp1.exe</assembly>
</assemblies>
</nunit>
<exec>
<executable>&ncoverExecutable;</executable>
<buildArgs>"&nunitConsoleExecutable;" "app\consoleApp1\bin\Release\consoleApp1.exe" /nologo</buildArgs>
</exec>
<exec>
<executable>&ndependExecutable;</executable>
<buildArgs>D:\_300\app\consoleApp1.xml /Silent</buildArgs>
</exec>
<merge>
<files>
<file>D:\_300\app\consoleApp1\unit-test.xml</file>
<file>D:\_300\app\consoleApp1\ApplicationMetrics.xml</file>
<file>D:\_300\app\consoleApp1\AssembliesBuildOrder.xml</file>
<file>D:\_300\app\consoleApp1\AssembliesDependencies.xml</file>
<file>D:\_300\app\consoleApp1\AssembliesMetrics.xml</file>
<file>D:\_300\app\consoleApp1\CQLResult.xml</file>
<file>D:\_300\app\consoleApp1\InfoWarnings.xml</file>
<file>D:\_300\app\consoleApp1\NDependMain.xml</file>
<file>D:\_300\app\consoleApp1\TypesDependencies.xml</file>
<file>D:\_300\app\consoleApp1\TypesMetrics.xml</file>
</files>
</merge>
</tasks>
<publishers>
<merge>
<files>
<file>D:\_300\app\consoleApp1\SymbolModule.Xml</file>
</files>
</merge>
<xmllogger logDir="." />
&emailconsoleApp1;
</publishers>
</project>
I've tried CruiseControl.Net 1.4.4.83 with Rodemeyer.MsBuildToCCnet.dll 1.0.0.5 as a logger coupled with msbuild2ccnet.xsl, and the output is nothing like the output samples from the article:
Build started
Project "" (Integration.Common.csproj target(s)):
error CS1002:
Build succeeded
error CS1002:
1 Error(s)
0 Warning(s)
Time elapsed
Using ThoughtWorks.CruiseControl.MSBuild.dll as a logger coupled with msbuild.xsl, the results are just fine:
Build started 07/16/2009 13:46:38
Person.cs (18,53): error CS1002: ; expected
Build FAILED
Person.cs (18,53): error CS1002: ; expected
1 Error(s)
0 Warning(s)
Time elapsed 00:00:00
After a conversation the developers (I have been told that the alternative logger you link to is quite old and it's usage is discouraged), I am using the default, standard logger and xslt. If it does cause problems for you, please report a bug on CruiseControl.Net Jira, the more people vote on this the sooner someone with commit access to the code might look into it.
"View Build Log" is a raw view, not usable except for debugging the build server setup - for some of my project this is almost 5MB large and does not cause any problems for the server (although opening it hangs the browser for a while). NCover can cause problems inflating buildlog.xml to over 100MB - you have to use NCoverExplorer to analyze the results before merging them if this happens(but don't bother before you start getting exceptions from the server).
To see the formatted MSBuild results in the WebDashboard, make sure that the dashboard configuration includes msbuild.xsl (this will give you a link to "MSBuild Report" on ViewBuildReport page and include some basic information on the page itself).
It feels a bit wierd answering my own question, but there is a chance that someone might have the same question and appreciate my answer so here it is.
I visited the following page http://confluence.public.thoughtworks.org/display/CCNETCOMM/Improved+MSBuild+Integration that describes the use of a different logger than the traditional logger (normal logger produces very large files that bog the server down when performing the XSLT transformations).
The page provides the logger and an XSLT file along with simple and clear instructions on how to incorporate this into your CC.Net project. I tried this logger and XSLT and found I was still getting the raw XML; in fact, ALL of the XML combined in one HUGE page.

Getting HTTP xml error response using cURL

I am currently using cURL to communicate to a cloud site... everything is going well except for an annoying issue. The issue is that I cannot get the site's xml response when there is an error. for example, when I use Wire Shark to check the transfer I can see that in the HTTP header that I'm getting which contains the error code; there is an XML data that contains in addition to the error code, a message that describes the code. I have tried many cURL options to try and get the XML but all my attempts failed.
Could someone tell me how can I get the XML. please note that I'm using the cURL C APIs as my code is in c++ and moreover, I can get XML responses when the operation succeeds using my write callback function.
Set CURLOPT_FAILONERROR to 0. If this is set to 1, then any HTTP response >= 300 will result in an error rather than processing like you want.