Trying to read multiple lines from txt file separated with :, but I'm getting imbRecoverableException caught from worker -> parseNext - parent-child

As I'm new to IBM MQ and IIB I'm trying to experiment around with online tutorials. At the moment I'm trying to make a simple app that reads several lines in txt file separated by colon and writes them into XML file. Currently I'm stuck at reading multiple lines from file. I know how to make it work with only one line, but can't with more than one. I do know that there should be a parent-child relationship between two complex types but can't configure them properly. Also im using RFHUtil to send message file into queue.
Since I can't find much googling it, I hope someone with right knowledge could help around.
Don't have any code, but got my message definition picture: http://prnt.sc/nv9npr
Here is the error I'm getting: http://prnt.sc/nv9nyi

So two things I can see in your current screen shots.
In the first screenshot I can see \r\n i.e. CRLF which indicates that your separator needs to either be CRLF or your model needs to deal with the CRLF.
In the second you've got a partially parsed message. Try setting the Advanced Parser options on your Input node to ParseComplete things will still blow up but you should get some better diagnostic information in the ExceptionList.
Looks like you are trying use the MRM parser which has been replaced by the DFDL parser. I suggest you find some tutorials on the DFDL parser, it's much more efficient. Also there is support built into the Toolkit which will let you debug the Message Model you create Testing a DFDL schema by parsing test input data

Related

Open a XML file not knowing the complete name and parse xml

I am using robot framework with RIDE, and for a test I need to find a XML file on my computer and open it to parse the xml and be able to use the datas.
The thing is that I don't know the exact name of the file; the format is numberNameOfTheFile, so it could be 1NameOfTheFile or 25NameOfTheFile.
How can I use regexp in my keyword? Or any other way to achieve this?
Thank you
How would you do it manually - how would you pick the file to use for the verification?
I presume, you are going to look at all the files that are matching a specific name pattern; in Robot Framework you can do that with OperatingSystem's List Files In Directory keyword, which supports passing a name pattern:
${the files}= List Files In Directory /the/path/to/the/dir *NameOfTheFile.xml
Now you have a list object with the filenames that match; if it's empty - there's no such file, which may be a problem (depends on your test/reqs, I don't know). If it has a single member - great, that's your file.
And if there are multiple files - that's another "problem". How would you pick the right file manually? It could be that the newest file is the target one - for that you would go over all of them and find the one through OperatingSystem's Get Modified Tume; or it can be the largest; or the number in its suffix would be the biggest. This really depends on your requirements, and what you are trying to achieve.
"How would you do it manually" is probably the most important question to ask. Think and break down to steps the individual tasks you would do, and now you have the algorithm; see how to put that in code - and presto, the implementation. This applies to scripts, test cases, and business process automation (e.g. software).
I was tempted to mark the question for closing, because precisely this - the algorithm - was missing, only the end goal is stated - while SO is for helping in the implementation part. But, here we are :)

DTD parsing error in R

I've got a bit of a problem with an xml tree in r. I have a treebank, containing the corpus - stuff I really need. What I want is to take the XML files, parse them with the help of the DTD on my computer, and then just create a corpus afterwards.
So far I've tried
xmlTreeParse(doc, options=XML::DTDLOAD)
and
xmlParse(doc)
and also
parseDTD(dtd)
but all of them throw back an error. First two still say "entity not defined", and the parsing function gives back "failed to load external entity "yaddayadda.dtd"". In this question the treeparse function was given as an answer, but it does not work for me. The xml files have a SYSTEM "../yaddayadda.dtd" designation.
What I plan to do with this, is to somehow create a VCorpus object in the tm package from the parsed text, to use it in later textmining research.
Could you help me please? Will provide further details if needed.
The parser, which you are telling to load the DTD, is seeing a reference to "../yaddayadda.dtd" and not finding it.
The most likely cause is that you have no file named "yaddayadda.dtd" on the appropriate file system, or that you have it in the wrong place; the parser should be looking for it in the directory one level up from the XML document which refers to it.
If you have it in what you think is the right location, then apparently you and the parser do not agree on what the right location is. Good luck.

Is there a way to extract actual call stack addresses from a Windows Performance Recorder trace (WPR)?

According to https://randomascii.wordpress.com/2013/11/04/exporting-arbitrary-data-from-xperf-etl-files/, wpaexporter.exe should be the right tool to do so.
I manage to prepare a profile with the right data, but, unfortunately, wpaexporter keep trying to translate addresses, even if "-symbols" is not given to the command line, generating some useless
/<ModuleName.dll>!<Symbols disabled>
warnings.
This is annoying because part of our application use some Delphi code that can not generate symbols in a Microsoft compatible format. With addresses, we would be able to find the Delphi symbols in the call stack using map files.
Is there a way to extract call stack addresses from a wpr trace ?
Thanks, i completely missed processing options of xperf...
In the meantime, i found that LogParser (https://www.microsoft.com/en-us/download/details.aspx?id=24659) can also export an etl file to a csv (with actual values as well) :
LogParser.exe" "Select * from file.etl" -i:ETW -o:CSV -oTsFormat "HH:mm:ss.ln" > output_file.csv
From what i have seen so far, LogParser output might be more suitable for automatic parsing (only one line per event in the file, no header) while xperf output is more suitable for human processing (tabular representation).
Yes. You can also use xperf.exe. Have you tried the actions option?
xperf -a stack should help here I expect.
You can see detailed info with xperf -help processing command.

lupdate - common single words in the ts file?

Im learning how to use QT's translate stuff for the first time for work.
They already have things working to some degree and its my job to clean
things up and get it working properly as well as using lupdate to keep
things in sync when they change etc. We are also using QML in which we
wrote a wrapper function for all our strings, so lupdate does not find
our function to add to the .ts XML file. The reason we use a wrapper is
for centralizing other functions at once place for all strings. We also
dont always use a string literal in our 'source' argument but a defined
property, such as:
property string buttonTxt: "ButtonText"
then: commonTRFunction(context, buttonTxt)
which of course lupdate does not find for both reasons.
Ive looked into updating the lupdate source very briefly
and Im not sure if its worth trying to hack it to find our function or
write our own parser to find the standard QT tags AND also our new ones?
Secondly, and related to the first part, Id like a way to make one
context section that contains all the common words we use in our app
such as 'Back', 'Save', 'Ok' etc etc without repeating it over and over
throughout the .ts file. lupdate seems to repeat things over and over
in multiple contexts which seems both inefficient and a waste of lines
in the ts file.
I haven't found any QT docs that really explain the differences between tr(), qsTr(), qsTranslate(), QT_TR_NOOP() and QT_TRANSLATE_NOOP(). I know you sometimes need a context and the source,
and other times just use the source without a context. We dont use
the disambigous arg. Most of our code is in QML and not C++.
Also we are running lupdate from the command line.
Does anyone have thoughts, suggestions or even a tool someone wrote
that can be used for what we have? I appreciate your help.

BizTalk messages overwriting each other?

I have an odd situation that has only come up in this one orchestration I'm working on.
I have a Receive message come in. I use an Expression shape and write it to a variable "xmlDoc" so I can verify what is in it. I then have a Message Assignment shape where I Load a string of XML to a variable "xmlDoc2" and assign that variable to a second message and write it out so I can verify it. I then have another Expression shape and attempt to write out the first message again and it's apparently been replaced with the second message information.
It's not in a Parallel shape, and the Message Assignment is only building the second message. Between the receive and where I'm seeing this issue, I'm doing a few Decide shapes and building other messages from the Receive message. They all work fine and don't overwrite anything (do the same processes as what I'm trying to do later.)
Anyone seen this before or see something I'm missing?
ETA: The process works a bit like this:
Send Message comes in
xmlDoc = Send Message
xmlDoc.OuterXml is written to a table
xmlDoc2 = "<root><xml></xml></root>"
Second Message = xmlDoc2
xmlDoc2.OuterXml is written to a table
xmlDoc = Send Message <-- What should happen
xmlDoc = Second Message <-- What is happening
I could not reproduce your exact problem but I got close. I think there are some implied statements in your process outline that would be critical for us to understand what's really happening. In any case, I think your BizTalk messages do not get overwritten, but that the XmlDocument variables are.
I think you may have been hit by one of the fundamental confusions a developer coming from a Java or VB6 background encounters when working with C#.
C# is a Managed Language
Please, remember that C# is a managed language, in that it uses a garbage collector to reclaim unused references to objects. The key word here is Reference.
When you write the following lines:
xmlDoc2 = "<root><xml/></root>";
SecondMessage = xmlDoc2;
Basically, you have two references to the same content. Namely, two references xmlDoc2 and SecondMessage which refer to the assigned string.
So, depending upon the code you use to "write out" the XML content of your BizTalk messages, you may be overwriting some references.
Furthermore, if this happens in the context of a Construct shape, you may be inadvertently overwriting the content of the BizTalk message itself.
A Solution?
This problem does not usually manifest itself when working with BizTalk. I personally never encountered this issue.
If you update your original question with the exact code for both Expression shapes and the Assignment shape, I'll update this response with more appropriate guidance.

Resources