On Sep 5, 2006, at 5:08 PM, Raymond Feng wrote:

Hi, Scott.

Thank you for all the details. It helps me confirm this is a bug in the code. 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?

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

Scott, would you please go ahead to open a JIRA for this issue?

Thanks,
Raymond

----- Original Message ----- From: "Scott Kurz" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, September 05, 2006 4:11 PM
Subject: JavaComponentTypeLoader broken - load() should return ModelObject - JIRA needed?


Didn't see a JIRA open but thought I'd ask before loading one..

This is r440401....

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.l oadFromSidefile
(JavaComponentTypeLoader.java)
   at
org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.l oad(
JavaComponentTypeLoader.java:71)
   at
org.apache.tuscany.core.implementation.java.JavaComponentTypeLoader.l oad(
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.CompositeComponentTy peLoader.loadFromSidefile
(CompositeComponentTypeLoader.java:64)
   at
org.apache.tuscany.core.implementation.composite.CompositeComponentTy peLoader.load
(CompositeComponentTypeLoader.java:56)
   at
org.apache.tuscany.core.implementation.composite.CompositeComponentTy peLoader.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.....it
was this line in JavaComponentTypeLoader:

protected PojoComponentType loadFromSidefile(URL url, DeploymentContext
deploymentContext) throws LoaderException {
       return loaderRegistry.load(null, url, PojoComponentType.class,
deploymentContext);
   }

This 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

Should I open a JIRA for this?

Thanks,
Scott


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



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

Reply via email to