[ 
https://issues.apache.org/jira/browse/TUSCANY-2377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Kurz updated TUSCANY-2377:
--------------------------------

    Attachment: 2377.itest.example.diff

I didn't see an example for using XJC, so I just hand-gen'd the Java from 
rcprops.xsd into src/main/java. Note I use JAXB customizations so this is a 
non-default mapping, but I think the customizations are irrelevant to this JIRA 
.

> problem reading complex property from @file
> -------------------------------------------
>
>                 Key: TUSCANY-2377
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2377
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>            Reporter: Scott Kurz
>         Attachments: 2377.itest.example.diff, 2377.itest.example.diff
>
>
> I'm having trouble reading a complex property from a file pointed to via the 
> <property> @file attr. 
> I'm using a JAXB to hold the prop value in my Java impl, but in looking at 
> this briefly in the debugger I think the problem might be in the DOM object 
> before it is ever transformed into a JAXB (in my case).
> I think the problem is in the code:
> public class JavaPropertyValueObjectFactory
>     public ObjectFactory createValueFactory(Property property, Object 
> propertyValue, Class javaType) {
>         ... 
>         } else {
>             if (isSimpleType) {
>               ....
>             } else {
>                 List<Node> nodes = getComplexPropertyValues(doc);
>                 Object value = null;
>                 if (!nodes.isEmpty()) {
>                     value = nodes.get(0);
>                 }
>                 return new ObjectFactoryImpl(property, value, isSimpleType, 
> javaType);
>             }
> I'm not skilled with DOM... but I think this code is expecting a wrapper 
> around the real property value, which is why we do a 
> nodes.get(0) to get the first child.   
> I think this wrapper must be there in the case that the property value is set 
> inline in the SCDL or via a Composite property definition, but I think 
> there's a wrapper missing in the case that we use @file, in which case we get 
> a "raw" document.
> I'll attach a patch of an existing itest adding a couple tests to to show an 
> example.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to