Issue Details (XML | Word | Printable)

Key: TUSCANY-141
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jeremy Boynes
Reporter: ant elder
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Tuscany

interface.wsdl doesn't work in .componentType side files

Created: 28/Mar/06 09:43 PM   Updated: 28/Apr/06 12:54 AM
Return to search
Component/s: Java SCA Core Runtime
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Reference
 

Resolution Date: 27/Apr/06 04:17 PM


 Description  « Hide
Using interface.wsdl in .componentType side file fails as it can't find the WSDL.

It looks like the import.wsdl doesn't get processed until after the side file is processed. The JavaScript sample 7 can be used to recreate the problem, look in HelloWorldImpl.componentType and there's a commented out interface.wsdl, change to use that gives this exception:

java.lang.IllegalArgumentException: Cannot find WSDL definition for http://helloworld.samples.tuscany.apache.org
at org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl.getPortType(WSDLServiceContractImpl.java:158)
at org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl.initialize(WSDLServiceContractImpl.java:103)
at org.apache.tuscany.model.assembly.impl.PortImpl.initialize(PortImpl.java:77)
at org.apache.tuscany.model.assembly.impl.ComponentTypeImpl.initialize(ComponentTypeImpl.java:117)
at org.apache.tuscany.model.assembly.impl.ComponentImplementationImpl.initialize(ComponentImplementationImpl.java:62)
at org.apache.tuscany.container.js.assembly.impl.JavaScriptImplementationImpl.initialize(JavaScriptImplementationImpl.java:73)
at org.apache.tuscany.model.assembly.impl.ComponentImpl.initialize(ComponentImpl.java:115)
at org.apache.tuscany.model.scdl.loader.impl.SCDLModelContentHandlerImpl$9.run(SCDLModelContentHandlerImpl.java:409)
at org.apache.tuscany.model.util.ModelTransformerImpl.transformPass2(ModelTransformerImpl.java:122)
at org.apache.tuscany.model.util.ModelTransformerImpl.transform(ModelTransformerImpl.java:42)
at org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl.transform(SCDLAssemblyModelLoaderImpl.java:198)
at org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl.loadModule(SCDLAssemblyModelLoaderImpl.java:107)
at org.apache.tuscany.core.config.impl.ModuleComponentConfigurationLoaderImpl.loadModule(ModuleComponentConfigurationLoaderImpl.java:48)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:98)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:88)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:61)
at org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:100)
at org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:64)
at sample.Sample7Client.invoke(Sample7Client.java:38)
at sample.Sample7TestCase.testGeetings(Sample7TestCase.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jean-Sebastien Delfino added a comment - 15/Apr/06 07:53 AM
I was able to reproduce the problem with the steps you indicated.

Usage of WSDL interfaces on components doesn't work at all so I am also raising the priority of this JIRA issue to critical.

I am getting a new exception now. See the exception I pasted at the bottom.

My analysis after stepping through the code is the following:

- o.a.t.core.loader.assembly.ComponentLoader is invoking ComponentInfoImpl.initialize() too early, I think it's actually the only case where initialize is called explicitly and so early in the loading cycle. I don't think that this right. We should wait for all the fragments of a module and all the <import.wsdl> they contain to be loaded before trying to initialize model objects.

- o.a.t.core.loader.assembly.ImportWSDLLoader is now using a new WSDLDefinitionRegistry to load WSDL files, and the WSDLDefinitionRegistry is not used by WSDLServiceContract to lookup the portType specified on <interface.wsdl>. Actually WSDLDefinitionRegistry is not even passed to WSDLServiceContract so I don't understand how this can work at all. I looked for references to WSDLDefinitionRegistry and could only find references to it in the loader and WSDLDefinitionRegistryImpl.

Jeremy, you added the new loader code and this new WSDLDefinitionRegistry recently and you understand how they are supposed to be used. It looks to me like a piece is missing in the integration of the WSDLDefinitionRegistry. So I'm going to assign the JIRA to you, more work is necessary to integrate the WSDLDefinitionRegistry and get support for WSDL working. Can you please help? Thanks.

Here's the new exception:
Exception in thread "main" java.lang.IllegalArgumentException: Cannot find WSDL definition for http://helloworld.samples.tuscany.apache.org
at org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl.getPortType(WSDLServiceContractImpl.java:158)
at org.apache.tuscany.model.types.wsdl.impl.WSDLServiceContractImpl.initialize(WSDLServiceContractImpl.java:103)
at org.apache.tuscany.model.assembly.impl.PortImpl.initialize(PortImpl.java:59)
at org.apache.tuscany.model.assembly.impl.ComponentInfoImpl.initialize(ComponentInfoImpl.java:118)
at org.apache.tuscany.model.assembly.impl.ImplementationImpl.initialize(ImplementationImpl.java:47)
at org.apache.tuscany.core.loader.assembly.ComponentLoader.load(ComponentLoader.java:83)
at org.apache.tuscany.core.loader.assembly.ComponentLoader.load(ComponentLoader.java:1)
at org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl.load(StAXLoaderRegistryImpl.java:62)
at org.apache.tuscany.core.loader.assembly.AggregateLoader.loadAggregate(AggregateLoader.java:43)
at org.apache.tuscany.core.loader.assembly.ModuleLoader.load(ModuleLoader.java:39)
at org.apache.tuscany.core.loader.assembly.ModuleLoader.load(ModuleLoader.java:1)
at org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl.load(StAXLoaderRegistryImpl.java:62)
at org.apache.tuscany.core.config.impl.StAXModuleComponentConfigurationLoaderImpl.loadModule(StAXModuleComponentConfigurationLoaderImpl.java:50)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:98)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:88)
at org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:61)
at org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:105)
at org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:69)
at sample.Sample7Client.invoke(Sample7Client.java:38)
at sample.Sample7Client.main(Sample7Client.java:31)


Jean-Sebastien Delfino made changes - 15/Apr/06 07:57 AM
Field Original Value New Value
Priority Major [ 3 ] Critical [ 2 ]
Jean-Sebastien Delfino made changes - 15/Apr/06 07:57 AM
Assignee Jeremy Boynes [ jboynes ]
ant elder added a comment - 24/Apr/06 05:06 PM
This has now changed so that the problem can be fixed by moving up the import.wsdl to be above the component in the sca.module file. (moving up the import didn't used to fix the problem).

This still needs to be fixed but I'll lower the priority from blocker to major.

This now exposes another problem. The object returned to a J2SE client or a component with a service refernece to a component using interface.wsdl is a proxy which implements an interface thats dynamically generated to represent the WSDL portType. This happens even if the client has an existing interface gen'd from the WSDL. So the only way to use this the proxy object is something like:

        Object o = moduleContext.locateService("HelloWorldComponent");
        Method m = o.getClass().getDeclaredMethod("getGreetings", new Class[] {String.class});
        String value = (String) m.invoke(o, in);


ant elder made changes - 24/Apr/06 05:07 PM
Priority Critical [ 2 ] Major [ 3 ]
ant elder added a comment - 25/Apr/06 04:25 PM
A related JIRA about J2SE clients using externalServices with interface.wsdl is TUSCANY-123

Repository Revision Date User Message
ASF #397489 Thu Apr 27 09:31:42 UTC 2006 jsdelfino Fix for TUSCANY-141 - changed XSD to place import statements at the top of SCDL files
Files Changed
MODIFY /incubator/tuscany/java/sca/model/src/main/resources/model/sca-core.xsd
MODIFY /incubator/tuscany/java/sca/model/src/main/resources/model/sca-interface-wsdl.xsd

Jean-Sebastien Delfino added a comment - 27/Apr/06 04:17 PM
This is now fixed. <import.wsdl> needs to be at the top of the SCDL file.
The issue with the runtime still generating a Java interface even if you already have one is already reported as TUSCANY-178.

Jean-Sebastien Delfino made changes - 27/Apr/06 04:17 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Jeremy Boynes made changes - 28/Apr/06 12:53 AM
Link This issue relates to TUSCANY-178 [ TUSCANY-178 ]
Jeremy Boynes added a comment - 28/Apr/06 12:54 AM
Closing as the import issue is fixed and the other problems are not related to the sidefile.

Jeremy Boynes made changes - 28/Apr/06 12:54 AM
Status Resolved [ 5 ] Closed [ 6 ]