You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by keinmensch <ke...@mailhaven.com> on 2010/01/03 15:19:42 UTC

Re: Non-Simple Property Injected with XML Fails with NPE

keinmensch wrote:
> ant elder wrote:
>   
>> Hi Ivan, could you raise a JIRA for this and if possible attach to it
>> the sca contribution you're trying to get to work, and I or someone
>> else will try to get it fixed for you.
>>     
>
> Hi!
> Many thanks!
> I did try to look into the problem myself, but after four hours, I just
> felt like I had been walking around in circles. :-P
> I have prepared a unit test and will create a JIRA as soon as I have a
> little more time (later next week, I guess).
> Note that this issue is in no way critical to me and I am not in a hurry.
> Best wishes!
>  Ivan
>
>   
Hello again!
After some more digging, I have found that there is already a unit test
that fails with a NullPointerException during circumstances that seems
indentical to those I have experienced.
So, before creatinga JIRA entry, I want to check with others to make
sure that this is not an isolated issue I am experiencing.
The unit test in question is:
Package: org.apache.tuscany.sca.deployment.impl
Class: DeployerImplTestCase
Method: testBuild

Thanks and best wishes!
 Ivan

Re: Non-Simple Property Injected with XML Fails with NPE

Posted by Brent Daniel <br...@gmail.com>.
Hi,
I think it's still a legitimate problem. Right now the XSDType of the
Property introspected from the java class will always be null (unless
it's a simple type.) I think the introspection code should probably be
checking for JAXB annotations on the class and getting the appropriate
XSDType from there.. ie, something like this in
AbstractPropertyProcessor.createProperty()...

 property.setXSDType(JavaXMLMapper.getXMLType(baseType));

        if ( property.getXSDType() == null ) {
        	XmlType cl = baseType.getAnnotation(XmlType.class);
        	if ( cl != null ) {
        		property.setXSDType(new QName(cl.namespace(), cl.name()));
        	}
        }

In the case where the xsd type can't be inferred at all, it makes
sense to me to make the check less restrictive.

Brent


On Fri, Jan 15, 2010 at 4:58 PM, keinmensch <ke...@mailhaven.com> wrote:
> Hi!
> Yes, I opened a Jira, TUSCANY-3409, but also closed it, since it looked
> like the unit test that was failing here was successfull when run by Hudson.
> I assumed that my environment or something caused the issue. I still
> haven't managed to solve, or workaround, the problem, by the way.
> Best wishes!
>

Re: Non-Simple Property Injected with XML Fails with NPE

Posted by keinmensch <ke...@mailhaven.com>.
Hi!
Yes, I opened a Jira, TUSCANY-3409, but also closed it, since it looked
like the unit test that was failing here was successfull when run by Hudson.
I assumed that my environment or something caused the issue. I still
haven't managed to solve, or workaround, the problem, by the way.
Best wishes!

Re: Non-Simple Property Injected with XML Fails with NPE

Posted by Brent Daniel <br...@gmail.com>.
Was a JIRA ever opened for this? I just ran into the same problem
trying to run a similar complexType property test case on 2.x.

Brent

On Sun, Jan 3, 2010 at 6:19 AM, keinmensch <ke...@mailhaven.com> wrote:
> keinmensch wrote:
>> ant elder wrote:
>>
>>> Hi Ivan, could you raise a JIRA for this and if possible attach to it
>>> the sca contribution you're trying to get to work, and I or someone
>>> else will try to get it fixed for you.
>>>
>>
>> Hi!
>> Many thanks!
>> I did try to look into the problem myself, but after four hours, I just
>> felt like I had been walking around in circles. :-P
>> I have prepared a unit test and will create a JIRA as soon as I have a
>> little more time (later next week, I guess).
>> Note that this issue is in no way critical to me and I am not in a hurry.
>> Best wishes!
>>  Ivan
>>
>>
> Hello again!
> After some more digging, I have found that there is already a unit test
> that fails with a NullPointerException during circumstances that seems
> indentical to those I have experienced.
> So, before creatinga JIRA entry, I want to check with others to make
> sure that this is not an isolated issue I am experiencing.
> The unit test in question is:
> Package: org.apache.tuscany.sca.deployment.impl
> Class: DeployerImplTestCase
> Method: testBuild
>
> Thanks and best wishes!
>  Ivan
>