It seems to be a Java issue. If I create a standalone Java application (see the attached parse.java file) that does the same parsing as your parsejob.xml file, it gets a NullPointerException (unless I change the formatting of the config.xml file):
$ java parse
machine_name=etr6506l3-sun66.ca.com
prerequisitescript=update.exp
acbuildpath=/CR_80SP1/80_builds/Unix/CR16/TestFix
testsuitscript=runQuickSanity.sh
reportname=BATReport
testdir=/testQuickSanity
testconfig=BlueExpress.tar
java.lang.NullPointerException
at parse.main(parse.java:198)
Line 198 in the parse.java file is:
String ver = nodebegin.item(1).getNodeName();
which is the equivalent line (560) in your parsejob.xml file that gets the
error:
ver = nodebegin.item(1).getNodeName()
AttributeError: 'None' object has no attribute 'getNodeName'
So it seems that unless you change the formatting of the config.xml file,
nodebegin.item(1) is null.
(See attached file: parse.java)
Thanks,
David
David Bender 11501 Burnet Rd. Phone (T/L): 1-512-286-5315
STAF/STAX Development Bldg. 903-5B002 (363-5315)
Austin, TX ITN: 23635315
IBM Software Group, 78758-3400 Email: [email protected]
WPLC
From: Sangram Bakshi <[email protected]>
To: David Bender/Austin/i...@ibmus
Cc: [email protected]
Date: 03/15/2010 10:48 AM
Subject: Re: [staf-users] Getting attribut error "AttributeError: 'None'
object has no attribute 'getNodeName'" on parsign a xml
file.
Hi David ,
I am generating the xml file through dom in javascript. The same xml file
i can read through javascript dom methods , i am able to read the xml even
if it is not formatted as you say. I am attaching here the code for that .
Try this asp file try to read the xml from "c:/config.xml". But the same
xml file i am not able to read from staf job.
But surprisingly if i open it in a editor , do nothing and simply save the
file , it gets read from staf job.
I am not sure if this is some xml encoding problem. I was able to read
similar xml file before from staf.
Regards
Sangram
On Mon, Mar 15, 2010 at 7:17 PM, David Bender <[email protected]> wrote:
The config.xml file is not formatted correctly. When I open it, the
elements are all on a single line:
<?xml version="1.0" encoding="utf-8"?>
<operating_system><unix_r12><tests
type="quickSanityTest"><prerequisitescript>update.exp</prerequisitescript><acbuildpath>/CR_80SP1/80_builds/Unix/CR16/TestFix</acbuildpath><testsuitscript>runQuickSanity.sh</testsuitscript><testdir>/testQuickSanity</testdir><testconfig>BlueExpress.tar</testconfig><reportname>BATReport</reportname></tests><machine_name>
etr6506l3-sun66.ca.com</machine_name></unix_r12></operating_system>
And when I run your parsejob.xml job with the config.xml file, I get the
same error. If I format the config.xml file as:
<?xml version="1.0" encoding="utf-8"?>
<operating_system>
<unix_r12>
<tests type="quickSanityTest">
<prerequisitescript>update.exp</prerequisitescript>
<acbuildpath>/CR_80SP1/80_builds/Unix/CR16/TestFix</acbuildpath>
<testsuitscript>runQuickSanity.sh</testsuitscript>
<testdir>/testQuickSanity</testdir>
<testconfig>BlueExpress.tar</testconfig>
<reportname>BATReport</reportname>
</tests>
<machine_name>etr6506l3-sun66.ca.com</machine_name>
</unix_r12>
</operating_system>
Then the error no longer occurs when running parsejob.xml.
Thanks,
David
David Bender 11501 Burnet Rd. Phone (T/L): 1-512-286-5315
STAF/STAX Development Bldg. 903-5B002 (363-5315)
Austin, TX ITN: 23635315
IBM Software Group, 78758-3400 Email: [email protected]
WPLC
Inactive hide details for Sangram Bakshi ---03/15/2010 04:59:01 AM---Hi ,
I am encountering the following error :Sangram Bakshi ---03/15/2010
04:59:01 AM---Hi , I am encountering the following error :
From: Sangram Bakshi <[email protected]>
To: [email protected]
Date: 03/15/2010 04:59 AM
Subject: [staf-users] Getting attribut error "AttributeError: 'None'
object has no attribute 'getNodeName'" on parsign a xml file.
Hi ,
I am encountering the following error :
"AttributeError: 'None' object has no attribute 'getNodeName'" on parsing
a xml file."
This a new problem i am getting , never earlier got this problem .
The xml file to be parsed is :
=====================
<?xml version="1.0" encoding="utf-8"?>
<operating_system>
<unix_r12>
<tests type="quickSanityTest">
<prerequisitescript>update.exp</prerequisitescript>
<acbuildpath>/CR_80SP1/80_builds/Unix/CR16/TestFix</acbuildpath>
<testsuitscript>runQuickSanity.sh</testsuitscript>
<testdir>/testQuickSanity</testdir>
<testconfig>BlueExpress.tar</testconfig>
<reportname>BATReport</reportname>
</tests>
<machine_name>etr6506l3-sun66.ca.com</machine_name>
</unix_r12>
</operating_system>
Attached is the exact file that i am using to parse:
The staf job file "parsejob.xml is also attached here:
I get the error :
20100315-15:09:48 STAXPythonEvaluationError signal raised. Terminating
job.
===== XML Information =====
File: C:\STAF\stax_jobs\parsejob.xml, Machine: baksa03-xp.ca.com
Line 403: Error in element type "script".
===== Python Error Information =====
com.ibm.staf.service.stax.STAXPythonEvaluationException:
Traceback (innermost last):
File "<pyExec string>", line 157, in ?
AttributeError: 'None' object has no attribute 'getNodeName'
===== Call Stack for STAX Thread 1 =====
[
function: Main (Line: 8, File: C:\STAF\stax_jobs\parsejob.xml, Machine:
baksa03-xp.ca.com)
sequence: 1/31 (Line: 10, File: C:\STAF\stax_jobs\parsejob.xml,
Machine: baksa03-xp.ca.com)
function: parseXML (Line: 383, File: C:\STAF\stax_jobs\parsejob.xml,
Machine: baksa03-xp.ca.com)
sequence: 2/4 (Line: 391, File: C:\STAF\stax_jobs\parsejob.xml,
Machine: baksa03-xp.ca.com)
]
I have validated the xml file to be valid by MSXML valid . It is valid .
Now the same xml file gets read if i Ctrl-x the following in the xml
file :
<tests type="quickSanityTest">
<prerequisitescript>update.exp</prerequisitescript>
<acbuildpath>/CR_80SP1/80_builds/Unix/CR16/TestFix</acbuildpath>
<testsuitscript>runQuickSanity.sh</testsuitscript>
<testdir>/testQuickSanity</testdir>
<testconfig>BlueExpress.tar</testconfig>
<reportname>BATReport</reportname>
and paste it again at the same location in the xml file. The xml file
then gets parsed through the staf job as i have attched.
Please suggest , i am not understanding this problem .
Regards
Sangram
[attachment "config.xml" deleted by David Bender/Austin/IBM] [attachment
"parsejob.xml" deleted by David Bender/Austin/IBM]
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
[attachment "try22.asp" deleted by David Bender/Austin/IBM]
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
parse.java
Description: Binary data
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ staf-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/staf-users
