I'm getting a NullPointerException when reading the leaves of the XML data

I can read the XML File correctly, I can walk through the XML structure correctly, I can print it correctly.

    String file = "D:/Htb/Dev/message/EE07_xmlbean.xml";
    File inputFile = new File(file);
    try
    {
      MCCIMT000100HT02Message message = MCCIMT000100HT02Message.Factory.parse(inputFile);
      System.out.println(message.xmlText());


However, when I want to retrieve specific values from the xml file, I get a NullPointerException.

          String extension = (String)message.getId().getExtension();

-->
java.lang.NullPointerException
    at parser.TestMyXMLBean.doAll(TestMyXMLBean.java:42)
    at parser.TestMyXMLBean.main(TestMyXMLBean.java:82)
Process exited with exit code 0.

Any hints and tips are very much appreciated.

Thanks,

Peter-Paul

--

 


 

 

Peter-Paul Rang
Development Specialist
Business Technology Solutions

 

Oracle Nederland BV
Consulting

 

Rijnzathe 6
P.O. Box 147

 

 

phone
fax

+31 30 669 8248
+31 30 669 9966

 

 

3454 ZJ De Meern

 

 

[EMAIL PROTECTED]

 

 

The Netherlands

 

 


 


 

Voor meer informatie over onze diensten bezoek ons op internet

 


 

Reply via email to