You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Brian Kierstead <br...@fluidmedia.com> on 2005/10/18 19:32:04 UTC

Error in IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties

Hello,

I think I've noticed an error in 
IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties:

<snip>
    XmlNode nodeProperties = 
configurationScope.NodeContext.SelectSingleNode("properties");

            configurationScope.ErrorContext.Resource = 
nodeProperties.InnerXml.ToString();
            configurationScope.ErrorContext.MoreInfo = "add global 
properties";

            if (nodeProperties != null)
            {
</snip>

In the above code, if no 'properties' node is found, nodeProperties will 
be null and trying to access its InnerXml property will throw a 
System.NullReferenceException execption.  Should the test for null be 
before this line?  As far as I can tell from xsd, the properties node is 
not required.

I'm not sure if this is the right place for this post, but I figure 
there must be people on this list who know what to do with it if I'm right.

Brian


Re: Error in IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties

Posted by Brian Kierstead <br...@fluidmedia.com>.
Ah yes - my bad - I'm not on the SVN so this may have already been taken 
care of... I'm using the version which on the apache site: Source 
Revision 179390 
<http://prdownloads.sourceforge.net/ibatisnet/iBATIS-src-SVN-179390.zip?download>.

Brian

Gilles Bayon wrote:

> Which version do you used ?
> I don't see problem with SVN code
>
>  
> On 10/18/05, *Brian Kierstead* <brian@fluidmedia.com 
> <ma...@fluidmedia.com>> wrote:
>
>     Hello,
>
>     I think I've noticed an error in
>     IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties
>     :
>
>     <snip>
>        XmlNode nodeProperties =
>     configurationScope.NodeContext.SelectSingleNode("properties");
>
>                configurationScope.ErrorContext.Resource =
>     nodeProperties.InnerXml.ToString ();
>                configurationScope.ErrorContext.MoreInfo = "add global
>     properties";
>
>                if (nodeProperties != null)
>                {
>     </snip>
>
>     In the above code, if no 'properties' node is found,
>     nodeProperties will
>     be null and trying to access its InnerXml property will throw a
>     System.NullReferenceException execption.  Should the test for null be
>     before this line?  As far as I can tell from xsd, the properties
>     node is
>     not required.
>
>     I'm not sure if this is the right place for this post, but I figure
>     there must be people on this list who know what to do with it if
>     I'm right.
>
>     Brian
>
>



Re: Error in IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties

Posted by Gilles Bayon <ib...@gmail.com>.
Which version do you used ?
I don't see problem with SVN code

 On 10/18/05, Brian Kierstead <br...@fluidmedia.com> wrote:
>
> Hello,
>
> I think I've noticed an error in
>
> IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties
> :
>
> <snip>
> XmlNode nodeProperties =
> configurationScope.NodeContext.SelectSingleNode("properties");
>
> configurationScope.ErrorContext.Resource =
> nodeProperties.InnerXml.ToString();
> configurationScope.ErrorContext.MoreInfo = "add global
> properties";
>
> if (nodeProperties != null)
> {
> </snip>
>
> In the above code, if no 'properties' node is found, nodeProperties will
> be null and trying to access its InnerXml property will throw a
> System.NullReferenceException execption. Should the test for null be
> before this line? As far as I can tell from xsd, the properties node is
> not required.
>
> I'm not sure if this is the right place for this post, but I figure
> there must be people on this list who know what to do with it if I'm
> right.
>
> Brian
>
>

Re: Error in IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties

Posted by Brian Kierstead <br...@fluidmedia.com>.
I've worked around it by adding a settings line to the config file which 
points to an empty file.

Brian


Brian Kierstead wrote:

> Hello,
>
> I think I've noticed an error in 
> IBatisNet.DataAccess.Configuration.DomDaoManagerBuilder.ParseGlobalProperties: 
>
>
> <snip>
>    XmlNode nodeProperties = 
> configurationScope.NodeContext.SelectSingleNode("properties");
>
>            configurationScope.ErrorContext.Resource = 
> nodeProperties.InnerXml.ToString();
>            configurationScope.ErrorContext.MoreInfo = "add global 
> properties";
>
>            if (nodeProperties != null)
>            {
> </snip>
>
> In the above code, if no 'properties' node is found, nodeProperties 
> will be null and trying to access its InnerXml property will throw a 
> System.NullReferenceException execption.  Should the test for null be 
> before this line?  As far as I can tell from xsd, the properties node 
> is not required.
>
> I'm not sure if this is the right place for this post, but I figure 
> there must be people on this list who know what to do with it if I'm 
> right.
>
> Brian
>