You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Bradley M. Handy" <br...@williamstonfmc.org> on 2003/06/05 17:35:43 UTC
[betwixt] NPE while using BeanWriter.setWriteEmptyElements()
to "false"
I get the following NPE when setting "writeEmptyElements" property of
"BeanWriter" to false.
Is there something I'm not doing properly. I've got my ".betwixt" files
defined properly, because when the property is set to "true" the test app
runs fine.
I'm using the source from the CVS repository as of 5:00pm -0500 on June 4th.
java.lang.NullPointerException
at
org.apache.commons.betwixt.digester.XMLIntrospectorHelper.isLoopType(XMLIntrospectorHelper.java:575)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.isEmptyElement(AbstractBeanWriter.java:856)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.ignoreElement(AbstractBeanWriter.java:814)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWriter.java:536)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWriter.java:282)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.java:193)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.java:164)
at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:231)
at BetwixtTest.main(BetwixtTest.java:44)
Exception in thread "main"
Brad
Re: [betwixt] NPE while using
BeanWriter.setWriteEmptyElements() to "false"
Posted by "Bradley M. Handy" <br...@williamstonfmc.org>.
I'll do what I can.
Brad
At 05:04 PM 6/5/2003, you wrote:
>hi bradley
>
>i've added a check for null into XMLIntrospectorHelper. so if you build
>from CVS HEAD, that particular problem will mostly likely go away. on the
>other hand. i strongly suspect that this is a symptom rather than the
>actual problem. what i would find very useful would be a test case
>(preferably one which you're willing to donate to the ASF) that
>demonstrates this problem. then i'll be able to run the code on my machine
>and work out whether it's a bug in betwixt or some other issue.
>
>- robert
>
>On Thursday, June 5, 2003, at 04:35 PM, Bradley M. Handy wrote:
>
>>I get the following NPE when setting "writeEmptyElements" property of
>>"BeanWriter" to false.
>>
>>Is there something I'm not doing properly. I've got my ".betwixt" files
>>defined properly, because when the property is set to "true" the test app
>>runs fine.
>>
>>I'm using the source from the CVS repository as of 5:00pm -0500 on June 4th.
>>
>>java.lang.NullPointerException
>> at
>> org.apache.commons.betwixt.digester.XMLIntrospectorHelper.isLoopType
>>(XMLIntrospectorHelper.java:575)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.isEmptyElement
>>(AbstractBeanWriter.java:856)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.ignoreElement(
>>AbstractBeanWriter.java:814)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(
>>AbstractBeanWriter.java:536)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean
>>(AbstractBeanWriter.java:282)
>> at
>> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
>>java:193)
>> at
>> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
>>java:164)
>> at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:
>>231)
>> at BetwixtTest.main(BetwixtTest.java:44)
>>Exception in thread "main"
>>
>>
>>Brad
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [betwixt] NPE while using BeanWriter.setWriteEmptyElements() to "false"
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi brad
i'm sad to say that your attachments appear to have been stripped. could
you resubmit them wrapped in a zip or a tar,gz (these usually make it
through) or add them to a report in bugzilla.
TIA
- robert
On Saturday, June 7, 2003, at 05:36 AM, Bradley M. Handy wrote:
> Here is the test case I said I would submit. I'm not very good at
> writing test cases, but I'm hope I give you what you need.
>
> The attached classes are:
>
> org.apache.commons.betwixt.io.BeanWriterTest
> org.apache.commons.betwixt.CreditCard
> org.apache.commons.betwixt.CreditCardWithDotBetwixt
> org.apache.commons.betwixt.PersonBeanWithBotBetwixt
>
> also 2 ".betwixt" files are attached.
>
> Two things I have found out:
> (1) If I don't create a ".betwixt" file, then there is no exception.
> But, once I create a ".betwixt" file then I get the NPE.
> (2) I don't get an NPE at all when using
> org.apache.commons.betwixt.PersonBean as the test bean (with or w/o a
> ".betwixt" file).
>
> Brad Handy
>
> At 05:04 PM 6/5/2003, you wrote:
>> hi bradley
>>
>> i've added a check for null into XMLIntrospectorHelper. so if you build
>> from CVS HEAD, that particular problem will mostly likely go away. on
>> the other hand. i strongly suspect that this is a symptom rather than
>> the actual problem. what i would find very useful would be a test case
>> (preferably one which you're willing to donate to the ASF) that
>> demonstrates this problem. then i'll be able to run the code on my
>> machine and work out whether it's a bug in betwixt or some other issue.
>>
>> - robert
>>
>> On Thursday, June 5, 2003, at 04:35 PM, Bradley M. Handy wrote:
>>
>>> I get the following NPE when setting "writeEmptyElements" property of
>>> "BeanWriter" to false.
>>>
>>> Is there something I'm not doing properly. I've got my ".betwixt"
>>> files defined properly, because when the property is set to "true" the
>>> test app runs fine.
>>>
>>> I'm using the source from the CVS repository as of 5:00pm -0500 on June
>>> 4th.
>>>
>>> java.lang.NullPointerException
>>> at
>>> org.apache.commons.betwixt.digester.XMLIntrospectorHelper.isLoopType
>>> (XMLIntrospectorHelper.java:575)
>>> at
>>> org.apache.commons.betwixt.io.AbstractBeanWriter.isEmptyElement
>>> (AbstractBeanWriter.java:856)
>>> at
>>> org.apache.commons.betwixt.io.AbstractBeanWriter.ignoreElement(
>>> AbstractBeanWriter.java:814)
>>> at
>>> org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(
>>> AbstractBeanWriter.java:536)
>>> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean
>>> (AbstractBeanWriter.java:282)
>>> at
>>> org.apache.commons.betwixt.io.AbstractBeanWriter.write
>>> (AbstractBeanWriter.
>>> java:193)
>>> at
>>> org.apache.commons.betwixt.io.AbstractBeanWriter.write
>>> (AbstractBeanWriter.
>>> java:164)
>>> at
>>> org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:
>>> 231)
>>> at BetwixtTest.main(BetwixtTest.java:44)
>>> Exception in thread "main"
>>>
>>>
>>> Brad
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [betwixt] NPE while using
BeanWriter.setWriteEmptyElements() to "false"
Posted by "Bradley M. Handy" <br...@williamstonfmc.org>.
Here is the test case I said I would submit. I'm not very good at writing
test cases, but I'm hope I give you what you need.
The attached classes are:
org.apache.commons.betwixt.io.BeanWriterTest
org.apache.commons.betwixt.CreditCard
org.apache.commons.betwixt.CreditCardWithDotBetwixt
org.apache.commons.betwixt.PersonBeanWithBotBetwixt
also 2 ".betwixt" files are attached.
Two things I have found out:
(1) If I don't create a ".betwixt" file, then there is no exception. But,
once I create a ".betwixt" file then I get the NPE.
(2) I don't get an NPE at all when using
org.apache.commons.betwixt.PersonBean as the test bean (with or w/o a
".betwixt" file).
Brad Handy
At 05:04 PM 6/5/2003, you wrote:
>hi bradley
>
>i've added a check for null into XMLIntrospectorHelper. so if you build
>from CVS HEAD, that particular problem will mostly likely go away. on the
>other hand. i strongly suspect that this is a symptom rather than the
>actual problem. what i would find very useful would be a test case
>(preferably one which you're willing to donate to the ASF) that
>demonstrates this problem. then i'll be able to run the code on my machine
>and work out whether it's a bug in betwixt or some other issue.
>
>- robert
>
>On Thursday, June 5, 2003, at 04:35 PM, Bradley M. Handy wrote:
>
>>I get the following NPE when setting "writeEmptyElements" property of
>>"BeanWriter" to false.
>>
>>Is there something I'm not doing properly. I've got my ".betwixt" files
>>defined properly, because when the property is set to "true" the test app
>>runs fine.
>>
>>I'm using the source from the CVS repository as of 5:00pm -0500 on June 4th.
>>
>>java.lang.NullPointerException
>> at
>> org.apache.commons.betwixt.digester.XMLIntrospectorHelper.isLoopType
>>(XMLIntrospectorHelper.java:575)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.isEmptyElement
>>(AbstractBeanWriter.java:856)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.ignoreElement(
>>AbstractBeanWriter.java:814)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(
>>AbstractBeanWriter.java:536)
>> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean
>>(AbstractBeanWriter.java:282)
>> at
>> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
>>java:193)
>> at
>> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
>>java:164)
>> at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:
>>231)
>> at BetwixtTest.main(BetwixtTest.java:44)
>>Exception in thread "main"
>>
>>
>>Brad
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [betwixt] NPE while using BeanWriter.setWriteEmptyElements() to "false"
Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi bradley
i've added a check for null into XMLIntrospectorHelper. so if you build
from CVS HEAD, that particular problem will mostly likely go away. on the
other hand. i strongly suspect that this is a symptom rather than the
actual problem. what i would find very useful would be a test case
(preferably one which you're willing to donate to the ASF) that
demonstrates this problem. then i'll be able to run the code on my machine
and work out whether it's a bug in betwixt or some other issue.
- robert
On Thursday, June 5, 2003, at 04:35 PM, Bradley M. Handy wrote:
> I get the following NPE when setting "writeEmptyElements" property of
> "BeanWriter" to false.
>
> Is there something I'm not doing properly. I've got my ".betwixt" files
> defined properly, because when the property is set to "true" the test app
> runs fine.
>
> I'm using the source from the CVS repository as of 5:00pm -0500 on June
> 4th.
>
> java.lang.NullPointerException
> at
> org.apache.commons.betwixt.digester.XMLIntrospectorHelper.isLoopType
> (XMLIntrospectorHelper.java:575)
> at
> org.apache.commons.betwixt.io.AbstractBeanWriter.isEmptyElement
> (AbstractBeanWriter.java:856)
> at org.apache.commons.betwixt.io.AbstractBeanWriter.ignoreElement(
> AbstractBeanWriter.java:814)
> at org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(
> AbstractBeanWriter.java:536)
> at
> org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean
> (AbstractBeanWriter.java:282)
> at
> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
> java:193)
> at
> org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.
> java:164)
> at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:
> 231)
> at BetwixtTest.main(BetwixtTest.java:44)
> Exception in thread "main"
>
>
> Brad
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>