Re: WOXMLDecoder NullPointerException

2010-03-14 Thread Shravan Kumar. M
Okay. Will try it out! Thanks for your suggestion, Simon!





From: Simon 
To: Shravan Kumar. M 
Cc: WO Dev Group 
Sent: Sun, March 14, 2010 4:35:04 PM
Subject: Re: WOXMLDecoder NullPointerException

my advice is to use a mapping file. no mapping file = debugging nightmare

simon

On 13 March 2010 11:45, Shravan Kumar. M  wrote:
> Hi Group,
>
> Following code to decode an xml file or xml string is resuting in NPE, could
> you any one please advise what's going wrong here:
>
> WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder();
> //InputStream is =
> application().resourceManager().inputStreamForResourceNamed("supra.xml",
> null, null);
> //System.out.println("is..." + is);
> //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024));
> String xmlString = " encoding='UTF-8'?>123";
> StringReader stringReader = new StringReader(xmlString);
> InputSource is = new InputSource(stringReader);
> Object obj = xmlDecoder.decodeRootObject(is);
> System.out.println("childe: " + xmlDecoder.valueForKey("childe"));
>
> java.lang.NullPointerException
> [2010-03-13 17:08:56 IST]  java.lang.NullPointerException
> at
> com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744)
> at
> com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31)
> at
> com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706)
> at your.app.components.Main.submitData(Main.java:160)
>
> Thank You,
> Shravan Kumar. M
> ---
>
>
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk
>
> This email sent to si...@potwells.co.uk
>



   ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: WOXMLDecoder NullPointerException

2010-03-14 Thread Simon
my advice is to use a mapping file. no mapping file = debugging nightmare

simon

On 13 March 2010 11:45, Shravan Kumar. M  wrote:
> Hi Group,
>
> Following code to decode an xml file or xml string is resuting in NPE, could
> you any one please advise what's going wrong here:
>
>         WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder();
>         //InputStream is =
> application().resourceManager().inputStreamForResourceNamed("supra.xml",
> null, null);
>         //System.out.println("is..." + is);
>         //Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024));
>         String xmlString = " encoding='UTF-8'?>123";
>         StringReader stringReader = new StringReader(xmlString);
>         InputSource is = new InputSource(stringReader);
>         Object obj = xmlDecoder.decodeRootObject(is);
>         System.out.println("childe: " + xmlDecoder.valueForKey("childe"));
>
> java.lang.NullPointerException
> [2010-03-13 17:08:56 IST]  java.lang.NullPointerException
>     at
> com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744)
>     at
> com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31)
>     at
> com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706)
>     at your.app.components.Main.submitData(Main.java:160)
>
> Thank You,
> Shravan Kumar. M
> ---
>
>
>  ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/simon%40potwells.co.uk
>
> This email sent to si...@potwells.co.uk
>
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Fw: WOXMLDecoder NullPointerException

2010-03-13 Thread Shravan Kumar. M
Any suggestions please?

Fw: WOXMLDecoder NullPointerException
WOXMLDecoder NullPointerException
Sat Mar 13 17:15:22 2010
From: 
"Shravan Kumar. M" 
To: 
"WO Dev Group" 
Hi Group,

Following code to decode an xml file or xml string is resuting in NPE, could 
you any one please advise what's going wrong here:

WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder();
//InputStream is = 
application().resourceManager().inputStreamForResourceNamed("supra.xml", null, 
null);
//supra.xml has similar xml as shown in xmlString below, but little elaborated.
//System.out.println("is..." + is);
//Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024));
String xmlString = "123";
StringReader stringReader = new StringReader(xmlString); 
InputSource is = new InputSource(stringReader); 
Object obj = xmlDecoder.decodeRootObject(is);
System.out.println("childe: " + xmlDecoder.valueForKey("childe"));

java.lang.NullPointerException
[2010-03-13 17:08:56 IST]  java.lang.NullPointerException
at 
com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744)
at 
com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31)
at 
com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706)
at your.app.components.Main.submitData(Main.java:160)

Thank You,
Shravan Kumar. M
---


   ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

WOXMLDecoder NullPointerException

2010-03-13 Thread Shravan Kumar. M
Hi Group,

Following code to decode an xml file or xml string is resuting in NPE, could 
you any one please advise what's going wrong here:

WOXMLDecoder xmlDecoder = WOXMLDecoder.decoder();
//InputStream is = 
application().resourceManager().inputStreamForResourceNamed("supra.xml", null, 
null);
//System.out.println("is..." + is);
//Object obj = xmlDecoder.decodeRootObject(new NSData(is, 1024));
String xmlString = "123";
StringReader stringReader = new StringReader(xmlString); 
InputSource is = new InputSource(stringReader); 
Object obj = xmlDecoder.decodeRootObject(is);
System.out.println("childe: " + xmlDecoder.valueForKey("childe"));

java.lang.NullPointerException
[2010-03-13 17:08:56 IST]  java.lang.NullPointerException
at 
com.webobjects.appserver.xml.WOXMLDecoder.decodeObjectForKey(WOXMLDecoder.java:744)
at 
com.webobjects.appserver.xml._private._DecodingHandler.root(_DecodingHandler.java:31)
at 
com.webobjects.appserver.xml.WOXMLDecoder.decodeRootObject(WOXMLDecoder.java:706)
at your.app.components.Main.submitData(Main.java:160)

Thank You,
Shravan Kumar. M
---



   ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com