You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Jean-Sebastien Delfino (JIRA)" <tu...@ws.apache.org> on 2007/01/16 00:37:31 UTC

[jira] Updated: (TUSCANY-695) JavaComponentTypeLoader.load() returns PojoComponentType which isn't a ModelObject

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

Jean-Sebastien Delfino updated TUSCANY-695:
-------------------------------------------

    Fix Version/s:     (was: Java-M2)
                   Java-M3

> JavaComponentTypeLoader.load() returns PojoComponentType which isn't a ModelObject
> ----------------------------------------------------------------------------------
>
>                 Key: TUSCANY-695
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-695
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-M2
>         Environment: r440401
>            Reporter: Scott Kurz
>             Fix For: Java-M3
>
>
> When I tried using a componentType file along w/ my Java impl I got:
>  org.apache.tuscany.spi.loader.UnrecognizedElementException : {http://www.osoa.org/xmlns/sca/1.0}componentType [{http://www.osoa.org/xmlns/sca/1.0}componentType ]
> ........
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.load(LoaderRegistryImpl.java:113)
>     at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.loadFromSidefile(JavaComponentTypeLoader.java )
>     at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.load(JavaComponentTypeLoader.java:71)
>     at org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.load(JavaComponentTypeLoader.java :47)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.loadComponentType(LoaderRegistryImpl.java:159)
>     at org.apache.tuscany.core.implementation.java.JavaImplementationLoader.load(JavaImplementationLoader.java :57)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.load(LoaderRegistryImpl.java:92)
>     at org.apache.tuscany.core.loader.ComponentLoader.loadImplementation(ComponentLoader.java:133)
>     at org.apache.tuscany.core.loader.ComponentLoader.load (ComponentLoader.java:84)
>     at org.apache.tuscany.core.loader.ComponentLoader.load(ComponentLoader.java:57)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.load(LoaderRegistryImpl.java:92)
>     at org.apache.tuscany.core.implementation.composite.CompositeLoader.load (CompositeLoader.java:77)
>     at org.apache.tuscany.core.implementation.composite.CompositeLoader.load(CompositeLoader.java:52)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.load(LoaderRegistryImpl.java:92)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.load(LoaderRegistryImpl.java:109)
>     at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.loadFromSidefile(CompositeComponentTypeLoader.java :64)
>     at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.load(CompositeComponentTypeLoader.java:56)
>     at org.apache.tuscany.core.implementation.composite.CompositeComponentTypeLoader.load (CompositeComponentTypeLoader.java:38)
>     at org.apache.tuscany.core.loader.LoaderRegistryImpl.loadComponentType(LoaderRegistryImpl.java:159)
>     at org.apache.tuscany.core.deployer.DeployerImpl.load(DeployerImpl.java :118)
>     at org.apache.tuscany.core.deployer.DeployerImpl.deploy(DeployerImpl.java:93)
>     at org.apache.tuscany.core.launcher.LauncherImpl.bootApplication(LauncherImpl.java:193)
> The problem wasn't the lack of a loader to load <componentType> elems.....rather, it was this line in JavaComponentTypeLoader:
>     protected PojoComponentType loadFromSidefile(URL url, DeploymentContext deploymentContext) throws LoaderException {
>         return loaderRegistry.load(null, url, PojoComponentType.class, deploymentContext);
>     }
> Thie use of 'PojoComponentType.class' as argument is a problem.  In LoaderRegistryImpl.load, we do (line 109):
>                     ModelObject mo = load(parent, reader, ctx);
>                     if (type.isInstance(mo)) {
> So we're loading into a ModelObject, (more specifically, org.apache.tuscany.spi.model.ComponentType), but the 'type' here is :
> PojoComponentType.class
> which is in pkg org.apache.tuscany.core.implementation.java and passed into the load(..) call.
> On the dev list, Raymond Feng answered my email describing the problem with this:
> The ComponentTypeElementLoader creates a generic ComponentType from
> the XML file but the code expects an instance of PojoComponentType. Now the
> question is how to map the generic ComponentType into the PojoComponentType
> if it's required. Jim, do you have ideas?
> Jim Marino replied:
> We should probably have the implementation loader handle creation of
> the particular component type class and populate it by recursing back
> into the loader since it is minimal code
> (ComponentTypeElementLoader). This would be a nice patch for someone
> to work on :-)
> Jim

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org