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

Scott Kurz commented on TUSCANY-695:
------------------------------------

Since I opened this.. I just checked and can see that the specific issue 
mentioned in the JIRA title has been addressed and a ModelObject is returned 
now by JavaComponentTypeLoader.load().      I'm not sure if this was done by 
following up on Jim's suggestion. 



> 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 Kernel
>    Affects Versions: Java-SCA-2.0-Alpha
>         Environment: r440401
>            Reporter: Scott Kurz
>         Assigned To: Jeremy Boynes
>             Fix For: Java-SCA-2.0-Alpha
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to