I am trying to generate AST after parsing a HTML file.
grammar XHTML2CSV;
options {
output=AST;
ASTLabelType=CommonTree;
}
tokens {
CELLULE;
LIGNE;
CELLULEG = '<td>';
CELLULED = '</td>';
DEBUTCOL = '<tr>';
FINCOL = '</tr>';
DTAB = '<table';
STAB = ' align=\"center\"';
FTAB = ' border=\"1\">';
FINTAB ='</table>';
ligne
: DEBUTCOL cellule+ FINCOL -> ^(LIGNE cellule);
cellule : CELLULEG CHAINE CELLULED
-> ^(CELLULE CHAINE);
And when I parse somthing like :
<tr>
<td>"Cellule 1"</td>
<td>"Cellule 2"</td>
<td>"Cellule 3"</td>
</tr>
I just get the tree : nil ---> LIGNE ---> CELLULE ---> "Cellule 1"
How can I do to get all the children of LIGNE in the AST ?
Thanks
It seems you forgot a + in your rewrite rule:
ligne
: DEBUTCOL cellule+ FINCOL -> ^(LIGNE cellule+)
; // ^
// |
// +--- ici!
FYI: there's an HTML grammar on the ANTLR website: http://www.antlr.org/grammar/HTML
Related
I have a yaml file that I want to read its contents in scala , so I parse it using io.circe.yaml to json
var js = yaml.parser.parse(ymlText)
var json=js.valueOr(null)
var jsonstring=json.toString
val json2 = parse(jsonstring)
the yamltext is like this:
ALL:
Category1:
Subcategory11 : 1.5
Subcategory12 : 0
Subcategory13 : 0
Subcategory14 : 0.5
Category2:
Subcategory21 : 1.5
Subcategory22 : 0.3
Subcategory23 : 0
Subcategory24 : 0
what I want is to filter the subcategories that has Zero values, I've used this code:
val elements = (json2 \\"ALL" ).children.map(x=>(x.values))
var subCategories=elements.map{case(a,b)=>(b)}
var cats=elements.map{case(a,b)=>(b.asInstanceOf[Map[String,Double]])}
cats.map(x=>x.filter{case(a,b)=>b>0.0})
But the last line gives me this error:
scala.math.BigInt cannot be cast to java.lang.Double
I'm not sure why you do toString + parse and which parse is used but you probably don't need it. Also you didn't describe your expected result so here are a few guesses of what you might need:
import java.io._
import io.circe._
import io.circe.yaml._
import io.circe.parser._
def test(): Unit = {
// test data instead of a file
val ymlText =
"""
|ALL:
| Category1:
| Subcategory11 : 1.5
| Subcategory12 : 0
| Subcategory13 : 0
| Subcategory14 : 0.5
| Category2:
| Subcategory21 : 1.5
| Subcategory22 : 0.3
| Subcategory23 : 0
| Subcategory24 : 0
""".stripMargin
var js = yaml.parser.parse(new StringReader(ymlText))
var json: Json = js.right.get
val categories = (json \\ "ALL").flatMap(j => j.asObject.get.values.toList)
val subs = categories.flatMap(j => j.asObject.get.toList)
val elements: List[(String, Double)] = subs.map { case (k, v) => (k, v.asNumber.get.toDouble) }
.filter {
case (k, v) => v > 0.0
}
println(s"elements: $elements")
val allCategories = (json \\ "ALL").flatMap(j => j.asObject.get.toList).toMap
val filteredTree: Map[String, Map[String, Double]] = allCategories
.mapValues(catJson => catJson.asObject.get.toList.map { case (subName, subJson) => (subName, subJson.asNumber.get.toDouble) }
.filter { case (subName, subValue) => subValue > 0.0 }
.toMap)
println(s"filteredTree : $filteredTree")
}
And the output for that is:
elements: List((Subcategory11,1.5), (Subcategory14,0.5), (Subcategory21,1.5), (Subcategory22,0.3))
filteredTree : Map(Category1 -> Map(Subcategory11 -> 1.5, Subcategory14 -> 0.5), Category2 -> Map(Subcategory21 -> 1.5, Subcategory22 -> 0.3))
Hope one of those version is what you needed.
I developed IDE using eclipse EMF/RCP in that I Developed one editor using xtext,rcp and emf
Following is my grammar for that Section
// automatically generated by Xtext
grammar com.xyz.pmide.RoutingLineINI with org.eclipse.xtext.common.Terminals
import "platform:/resource/com.xyz.pmide.routingline.xtext.model/model/pmrouting.ecore"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
IniRoutingLineProject:
{IniRoutingLineProject}
(iniRoutingConfig=IniRoutingConfiguration)?
;
IniRoutingConfiguration:
{IniRoutingConfiguration}
(iniRoutingSectConfig=IniRoutingLogicSection)
(iniLogMessageSectionConfig=IniLogMessageSet)?
(iniPreDefGroupSectionConfig=IniPreDefGroupVariableSet)?
(iniRegWSSectionConfig=IniRegisterWSCommandSet)?
(iniOtherRoutingSectionConfig=IniRoutingPropertySet)
(iniGlobalRoutingSectionConfig=IniGlobalRoutingSection)?
(iniAlarmSignalSectionConfig=IniAlarmSignalSection)?
(iniOptionPopupSectionConfig=IniOptionPopupSection)
;
IniRoutingLogicSection:
{IniRoutingLogicSection}
'[Routing]'('\r\n')*
// ('Warning_Rate='warningRate=ANS1TERM)?('\r\n')*
// ('Busy_Rate='busyRate=ANS1TERM)?('\r\n')*
// ('MaxRecursionConcurence=' maxRecursionOccurence=ANS1TERM)?('\r\n')*
// ('WS_Speed=' wsSpeed=ANS1TERM)?('\r\n')*
// ('ReactivationTime=' reactivationTime=ANS1TERM)?('\r\n')*
// ('WaitTime_WS_Reuse=' waitTimeWSReuse=ANS1TERM)?('\r\n')*
(routingLines+=IniRoutingLine)*('\r\n')*
;
terminal ALPHA :('a'..'z'|'A'..'Z');
terminal NUM:('0'..'9')+;
terminal SYMBOL : ('.'|','|'('|')'|'{'|'}'|'<'|'>'|'+'|'-'|'*'|'%'|'!'|'"'|':'|'|'|'?'|'#'|'_'|' '|'=');
terminal SYMBOL1 : ('['|']')*;
terminal SYMBOL2 : ('/'|';')* ;
terminal ANS : (ALPHA|NUM|SYMBOL)* SYMBOL2;
terminal SL_COMMENT : '//-' !('\n'|'\r')* ('\r'? '\n')?;
terminal ML_COMMENT : '//*' -> '*//';
ANSTERM : ANS;
ANSS1TERM : (ANS|SYMBOL1)+;
GRPCOMMENT_STR_END : SYMBOL2("===========================================================================================================================================================================") ;
GRPCOMMENT :
(GRPCOMMENT_STR_END)('\r\n')*
SYMBOL2(ANSS1TERM)('\r\n')*
(GRPCOMMENT_STR_END)('\r\n')*
;
LINECOMMENT :
// (LINECOMMENT_STR_END)('\r\n')*
// (ANSS1TERM|LINECOMMENT)('\r\n')*
// (LINECOMMENT_STR_END)?('\r\n')*;
(('/*'('\r\n')*
(ANSS1TERM)('\r\n')*
(LINECOMMENT)?('\r\n')*
'*/'?('\r\n')*)|GENCOMMENT)
;
IniTimeStampSampleSectPropSet:
{IniTimeStampSampleSectPropSet}
'[TimeStamp_Sample]'('\r\n')*
(inLabKeyValue+=IniUnitPositionsPair)*('\r\n')*
;
IniPositionConnect:
{IniPositionConnect}
// (srcPosition=ANS1TERM)(destPosition=ANS1TERM)?('\r\n')*
(src_dest_Pos=ANSS1TERM)('\r\n')*
;
IniListSampleSection:
{IniListSampleSection}
'[LISTSAMPLE]'('\r\n')*
(iniOnType+=IniListSample_OnType)*('\r\n')*
;
IniListSample_OnType:
{IniListSample_OnType}
(sampleType=('OnType'|ANSS1TERM))(popUpNo=ANSS1TERM)?('\r\n')*
;
IniGeneralRoutingSectPropSet:
{IniGeneralRoutingSectPropSet}
'[General]'('\r\n')*
// (version=('version='|ANSTERM))?('\r\n')*
(keySet+=IniNewKey_NL)*('\r\n')*
;
IniChildWSTriggerSectionSet:
{IniChildWSTriggerSectionSet}
(iniTriggerSectionConfig+=IniTriggerSectionConfiguration)*('\r\n')*
;
IniTriggerSectionConfiguration:
{IniTriggerSectionConfiguration}
SYMBOL1(sectName=ANSTERM)SYMBOL1('\r\n')*
(triggerUnit=('TriggerUnit='|ANSTERM))?('\r\n')*
(createPoint=('CreatePoint='|ANSTERM))?('\r\n')*
;
Following is my part validation or u can say check rules for my sections in editor
#Check
def validate_TriggerSectionConfiguration(IniTriggerSectionConfiguration iniTriggerSectionConfiguration){
val value = iniTriggerSectionConfiguration.sectName;
if (value.startsWith("[") && !value.endsWith("]")) {
error("Missing \"]\"",iniTriggerSectionConfiguration, PmroutingPackage.Literals.INI_TRIGGER_SECTION_CONFIGURATION__SECT_NAME)
}
}
Following is my part of editor
If I change above name by capital S
If I will go to red error mark this error message I am getting
I am trying to find solution I didn’t find. My problem is in checkRule
If I haven’t write any validation for that error why xtext giving such
error. This Problem I got when my name starts with this Capital
letters error A, G, L, M, O, P, R, S, T, W. Is this my code issue or
xtext has some bugs or I am missing something?
Fetching data from url:
suppressMessages(library(readr))
suppressMessages(library(RCurl))
amazon_url <- getURL('http://s3.amazonaws.com/assets.datacamp.com/production/course_935/datasets/500_amzn.csv',
ssl.verifyhost=FALSE, ssl.verifypeer=FALSE)
amazon <- read.csv(textConnection(amazon_url), header = TRUE)
Create amzn_cons:
amazon_cons <- amazon$cons
Build cleaning function based qdap package for text organization:
suppressWarnings(library(qdap))
qdap_clean <- function(x) {
x <- replace_abbreviation(x)
x <- replace_contraction(x)
x <- replace_number(x)
x <- replace_ordinal(x)
x <- replace_symbol(x)
x <- tolower(x)
return(x)
}
Build cleaning function based on tm package for text organization:
suppressWarnings(library(tm))
tm_clean <- function(corpus) {
corpus<- tm_map(corpus, removePunctuation)
corpus <- tm_map(corpus, stripWhitespace)
corpus <- tm_map(corpus, removeWords,
c(stopwords("en"), "Amazon","company"))
return(corpus)
}
Word cleaning:
amzn_cons <- qdap_clean(amazon_cons)
amzn_cons <- VCorpus(VectorSource(amzn_cons))
amzn_cons_corp <- tm_clean(amzn_cons)
Build custom function to extract bigram features:
suppressWarnings(library(RWeka))
tokenizer <- function(x)
NGramTokenizer(x, Weka_control(min = 2, max = 2))
Apply tokenization function to get bigrams words:
amzn_c_tdm <- TermDocumentMatrix(
amzn_cons_corp,control = list(tokenize = tokenizer) )
This results in the following error:
Error in .jcall("RWekaInterfaces", "[S", "tokenize", .jcast(tokenizer, :
java.lang.NullPointerException
How to solve this error?
I have a problem in Java with DOM...
Here is the XML code :
<?xml version="1.0" encoding="UTF-8"?>
<bib>
<domain>
<title>Specifications</title>
<bib_ref>
<year>March 2000</year>
<title>MOF 1.3</title>
<author>OMG</author>
<weblink>D:\SALIM\Docs\Specifications\MOF1_3.pdf</weblink>
</bib_ref>
<bib_ref>
<year>August 2002</year>
<title>IDLto Java LanguageMapping Specification</title>
<author>OMG</author>
<weblink>D:\SALIM\Docs\Specifications\IDL2Java.pdf</weblink>
</bib_ref>
<bib_ref>
<year>1999</year>
<title>XML Metadata Interchange (XMI) Version 1.1</title>
<author>OMG</author>
<weblink>D:\SALIM\Docs\Specifications\xmi-1.1.pdf</weblink>
</bib_ref>
<bib_ref>
<year>2002</year>
<title>XML Metadata Interchange (XMI) Version 2</title>
<author>"OMG</author>
<weblink>D:\SALIM\Docs\Specifications\XMI2.pdf</weblink>
</bib_ref>
<bib_ref>
<year>2002</year>
<title>XMI Version 1Production of XML Schema Specification</title>
<author>OMG</author>
<weblink>D:\SALIM\Docs\Specifications\XMI1XSD.pdf</weblink>
</bib_ref>
<bib_ref>
<year>2002</year>
<title>EDOC</title>
<author>OMG</author>
<weblink>D:\SALIM\Docs\Specifications\EDOC02-02-05.pdf</weblink>
</bib_ref>
</domain>
<domain>
<title>Theses</title>
<bib_ref>
<year>Octobre 2001</year>
<title>Echanges de Spécifications Hétérogènes et Réparties</title>
<author>Xavier Blanc</author>
<weblink>D:\SALIM\Docs\Theses\TheseXavier.pdf</weblink>
</bib_ref>
<bib_ref>
<year>Janvier 2001</year>
<title>Composition of Object-Oriented Software Design Models</title>
<author>Siobhan Clarke</author>
<weblink>D:\SALIM\Docs\Theses\SClarkeThesis.pdf</weblink>
</bib_ref>
......
......
After, in Java main function, I call the dispContent function which is just there:
public void dispContent (Node n)
{
String domainName = null;
// we are in an element node
if (n instanceof Element) {
Element e = ((Element) n);
// domain title
if (e.getTagName().equals("title") && e.getParentNode().getNodeName().equals("domain")) {
domainName = e.getTextContent();
DomaineTemplate(domainName);
}
else if (e.getTagName().equals("bib_ref")) {
NodeList ref = e.getChildNodes();
for (int i = 0; i < ref.getLength(); i++) {
Node temp = (Node) ref.item(i);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
if (temp.getNodeType() == org.w3c.dom.Node.TEXT_NODE)
continue;
out.println(temp.getNodeName() + " : " + temp.getTextContent() + "\n");
}
}
}
else {
NodeList sub = n.getChildNodes();
for(int i=0; (i < sub.getLength()); i++)
dispContent(sub.item(i));
}
}
/*else if (n instanceof Document) {
NodeList fils = n.getChildNodes();
for(int i=0; (i < fils.getLength()); i++) {
dispContent(fils.item(i));
}
}*/
}
The "domaineTemplate" function just displays its parameter!
My problem happens when I browse the "bib_ref" tag in Java. For each "bib_ref" loop, it displays all the contents of all "bib_ref" tags... in one line! I want to display only one content (year, title, author and weblink tag) per "bib_ref".
Here is what it is displaying at the moment when I browse bib_ref :
Specifications
year : March 2000 title : MOF 1.3 author : OMG weblink : D:\SALIM\Docs\Specifications\MOF1_3.pdf year : August 2002 title : IDLto Java LanguageMapping Specification author : OMG weblink : D:\SALIM\Docs\Specifications\IDL2Java.pdf year : 1999 title : XML Metadata Interchange (XMI) Version 1.1 author : OMG weblink : D:\SALIM\Docs\Specifications\xmi-1.1.pdf year : 2002 title : XML Metadata Interchange (XMI) Version 2 author : OMG weblink : D:\SALIM\Docs\Specifications\XMI2.pdf year : 2002 title : XMI Version 1Production of XML Schema Specification author : OMG weblink : D:\SALIM\Docs\Specifications\XMI1XSD.pdf year : 2002 title : EDOC author : OMG weblink : D:\SALIM\Docs\Specifications\EDOC02-02-05.pdf
Theses
year : Octobre 2001 title : Echanges de Sp�cifications H�t�rog�nes et R�parties author : Xavier Blanc weblink : D:\SALIM\Docs\Theses\TheseXavier.pdf year : Janvier 2001 title : Composition of Object-Oriented Software Design Models author : Siobhan Clarke weblink : D:\SALIM\Docs\Theses\SClarkeThesis.pdf year : Juin 2002 title : Contribution � la repr�sentation de processu par des techniques de m�ta mod�lisation author : Erwan Breton weblink : D:\SALIM\Docs\Theses\ErwanBretonThesis.pdf year : Octobre 2000 title : Technique de Mod�lisation et de M�ta mod�lisation author : Richard Lemesle weblink : D:\SALIM\Docs\Theses\RichardLemesle.pdf year : Juillet 2002 title : Utilsation d'agents mobiles pour la construction des services distribu�s author : Siegfried Rouvrais weblink : D:\SALIM\Docs\Theses\theserouvrais.pdf
...
...
Can you help me ?
I'm just a beginner in xml with java and I'm searching some solution for about 3 hours... Thank's a lot!
I called dispContent(doc.getFirstChild()); where doc is the Document with your given xml file contents.
Assumptions: out.println() is System.out.println() and DomaineTemplate(domainName); adds a newline (based on your output provided)
I get the following print out in the console:
Specifications
year : March 2000
title : MOF 1.3
author : OMG
weblink : D:\SALIM\Docs\Specifications\MOF1_3.pdf
year : August 2002
title : IDLto Java LanguageMapping Specification
author : OMG
weblink : D:\SALIM\Docs\Specifications\IDL2Java.pdf
year : 1999
title : XML Metadata Interchange (XMI) Version 1.1
author : OMG
weblink : D:\SALIM\Docs\Specifications\xmi-1.1.pdf
year : 2002
title : XML Metadata Interchange (XMI) Version 2
author : "OMG
weblink : D:\SALIM\Docs\Specifications\XMI2.pdf
year : 2002
title : XMI Version 1Production of XML Schema Specification
author : OMG
weblink : D:\SALIM\Docs\Specifications\XMI1XSD.pdf
year : 2002
title : EDOC
author : OMG
weblink : D:\SALIM\Docs\Specifications\EDOC02-02-05.pdf
Theses
year : Octobre 2001
title : Echanges de Spécifications Hétérogènes et Réparties
author : Xavier Blanc
weblink : D:\SALIM\Docs\Theses\TheseXavier.pdf
year : Janvier 2001
title : Composition of Object-Oriented Software Design Models
author : Siobhan Clarke
weblink : D:\SALIM\Docs\Theses\SClarkeThesis.pdf
If you're having an issue with "\n" creating a new line, you can try using what the System uses:
public static final String NEW_LINE = System.getProperty("line.separator");
If you don't want the new lines between each line of the "bib_ref" node's children print outs, change:
else if (e.getTagName().equals("bib_ref")) {
NodeList ref = e.getChildNodes();
for (int i = 0; i < ref.getLength(); i++) {
Node temp = (Node) ref.item(i);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
if (temp.getNodeType() == org.w3c.dom.Node.TEXT_NODE)
continue;
out.println(temp.getNodeName() + " : " + temp.getTextContent() + "\n");
}
}
}
to:
else if (e.getTagName().equals("bib_ref")) {
NodeList ref = e.getChildNodes();
for (int i = 0; i < ref.getLength(); i++) {
Node temp = (Node) ref.item(i);
if (temp.getNodeType() == Node.ELEMENT_NODE) {
if (temp.getNodeType() == org.w3c.dom.Node.TEXT_NODE)
continue;
// Removed "\n":
out.println(temp.getNodeName() + " : " + temp.getTextContent());
}
}
// Added out.println();
out.println();
}
Results:
Specifications
year : March 2000
title : MOF 1.3
author : OMG
weblink : D:\SALIM\Docs\Specifications\MOF1_3.pdf
year : August 2002
title : IDLto Java LanguageMapping Specification
author : OMG
weblink : D:\SALIM\Docs\Specifications\IDL2Java.pdf
year : 1999
title : XML Metadata Interchange (XMI) Version 1.1
author : OMG
weblink : D:\SALIM\Docs\Specifications\xmi-1.1.pdf
year : 2002
title : XML Metadata Interchange (XMI) Version 2
author : "OMG
weblink : D:\SALIM\Docs\Specifications\XMI2.pdf
year : 2002
title : XMI Version 1Production of XML Schema Specification
author : OMG
weblink : D:\SALIM\Docs\Specifications\XMI1XSD.pdf
year : 2002
title : EDOC
author : OMG
weblink : D:\SALIM\Docs\Specifications\EDOC02-02-05.pdf
Theses
year : Octobre 2001
title : Echanges de Spécifications Hétérogènes et Réparties
author : Xavier Blanc
weblink : D:\SALIM\Docs\Theses\TheseXavier.pdf
year : Janvier 2001
title : Composition of Object-Oriented Software Design Models
author : Siobhan Clarke
weblink : D:\SALIM\Docs\Theses\SClarkeThesis.pdf
Of course, now I see you have tagged your question with html and your code has nothing to do with html so far. So I asume out.println is some OutputStream for a Servlet and you're trying to Output html.
So the println linebreak, and the "\n" linebreaks are just available in the html sourcecode. The browser will skip this.
Change this line
out.println(temp.getNodeName() + " : " + temp.getTextContent() +
"\n");
to
out.println(temp.getNodeName() + " : " + temp.getTextContent() + "< br
/>");
and a servlet should output just fine with the linebreaks.
I'm using Message Broker 8 and MQ 7. When I try to use a Mapping Node in my message flow I get a java.lang.RuntimeException.
Here is what the event viewer shows:
( BROKER8.default ) The map script generation for QName ''{practica}:CambioFecha'' has failed, with the following details: ''java.lang.RuntimeException: ''.
The generation of the map has failed.
Review and resolve the problems indicated in the message from the map generation.
The full exception stack is:
ExceptionList: ( ['MQROOT' : 0xe052600]
(0x01000000:Name):RecoverableException = (
(0x03000000:NameValue):File = 'F:\build\S000_P\src\DataFlowEngine\PluginInterface\ImbJniNode.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 1170 (INTEGER)
(0x03000000:NameValue):Function = 'ImbJniNode::evaluate' (CHARACTER)
(0x03000000:NameValue):Type = 'ComIbmMSLMappingNode' (CHARACTER)
(0x03000000:NameValue):Name = 'practica/DATAGRAMA#FCMComposite_1_7' (CHARACTER)
(0x03000000:NameValue):Label = 'practica.DATAGRAMA.Cambio Formato Fecha' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 2230 (INTEGER)
(0x03000000:NameValue):Text = 'Caught exception and rethrowing' (CHARACTER)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = 'MbErrorHandler.java' (CHARACTER)
(0x03000000:NameValue):Line = 146 (INTEGER)
(0x03000000:NameValue):Function = 'evaluate' (CHARACTER)
(0x03000000:NameValue):Type = '' (CHARACTER)
(0x03000000:NameValue):Name = '' (CHARACTER)
(0x03000000:NameValue):Label = '' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 3946 (INTEGER)
(0x03000000:NameValue):Text = 'Caught BrokerXCIStaticException' (CHARACTER)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = '{practica}:CambioFecha' (CHARACTER)
)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'java.lang.RuntimeException: ' (CHARACTER)
)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = 'MbErrorHandler.java' (CHARACTER)
(0x03000000:NameValue):Line = 310 (INTEGER)
(0x03000000:NameValue):Function = 'throwableToMbException' (CHARACTER)
(0x03000000:NameValue):Type = '' (CHARACTER)
(0x03000000:NameValue):Name = '' (CHARACTER)
(0x03000000:NameValue):Label = '' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 3949 (INTEGER)
(0x03000000:NameValue):Text = 'Caught BrokerXCIStaticException' (CHARACTER)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'java.lang.RuntimeException:
' (CHARACTER)
)
)
)
)
)
The entire message flow was working fine. So, I think it is not an error of the mapping node. Another detail, in others flows the mapping node doesn't work at all and gives the same error. I don't know what could be the problem. Maybe a JRE error?
Any idea?
Thanks!
Josué
This is most probably due to the large Java heap size on 64 bit machines, as all the references are 4 bytes larger. To make it work, you could simply run it on a 32 bit broker or try any of the following -
Use Xcompressedrefs (the explanation about it is here -
http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.60%2Fdiag%2Funderstanding%2Fmm_compressed_references.html)
a) Execute the following command in the broker prompt
mqsichangeproperties --broker name-- -e --EG name-- -o
ComIbmJVMManager -n jvmSystemProperty -v \"-Xcompressedrefs\"
b) Verify that the JVM option is successfully applied
mqsireportproperties --broker name-- -e --EG name-- -o
ComIbmJVMManager -n jvmSystemProperty
The system should display -
-Xcompressedrefs
c) Restart the Execution Group
Increase the JVM memory, the default is 256MB
a) Execute the following command
mqsichangeproperties --broker name-- -e --EG name-- -o
ComIbmJVMManager -n jvmMaxHeapSize -v 536870912
b) Verify that the JVM option is successfully applied
mqsireportproperties --broker name-- -e --EG name-- -o
ComIbmJVMManager -n jvmMaxHeapSize
c) Restart the Execution Group
Hope this helps