You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Ignacio Silva-Lepe (JIRA)" <tu...@ws.apache.org> on 2007/05/10 19:30:15 UTC

[jira] Commented: (TUSCANY-1260) NPE when component reference has target composite with custom implementation

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

Ignacio Silva-Lepe commented on TUSCANY-1260:
---------------------------------------------

Notice that the line "<<< getInterfaceContract, interfaceContract [null] ", which prints the return value of DefaultCompositeActivator.getInterfaceContract seems to say that the reference's contract has not been determined. Could this be because the code to match the Java interface, that the reference expects, to the WSDL interface defined by the target component, does not work any more?
I am trying to figure out where this code is, but on the off chance that anyone can tell whether or not this may be the actual problem, I bring it up.


> NPE when component reference has target composite with custom implementation
> ----------------------------------------------------------------------------
>
>                 Key: TUSCANY-1260
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1260
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Model
>    Affects Versions: Java-SCA-0.90
>         Environment: Windows XP
>            Reporter: Ignacio Silva-Lepe
>             Fix For: Java-SCA-0.90
>
>
> A NPE occurs in DefaultCompositeActivator.createWires() when component reference has target composite with custom implementation. This used to work before the last refactor.
> Running org.apache.tuscany.notification.remoteProducer.TrafficAdvisoryTestCase
> *** binding ntm [null], notificationType [trafficAdvisory]
> >>> NotificationImplementationLoader.resolve, tmpUri [TrafficAdvisoryNotificatio
> n.componentType], ctUri [file:/C:/Devt/NotificationComponents/samples/remote-pro
> ducer/target/test-classes/TrafficAdvisoryNotification.componentType]
> Composite assembly problem: No implementation for component: TrafficAdvisoryProd
> ucer
> Composite assembly problem: Reference not found for component reference: Traffic
> AdvisoryProducer/destination
> >>> createWires, component [TrafficAdvisoryProducer], reference [destination], b
> inding [org.apache.tuscany.core.runtime.RuntimeSCABindingImpl@128f6ee]
> org.osoa.sca.ServiceRuntimeException: org.osoa.sca.ServiceRuntimeException: org.
> apache.tuscany.core.runtime.ActivationException: java.lang.NullPointerException
>         at org.apache.tuscany.host.embedded.SCADomain.createNewInstance(SCADomai
> n.java:197)
>         at org.apache.tuscany.host.embedded.SCADomain.newInstance(SCADomain.java
> :73)
>         at org.apache.tuscany.notification.remoteProducer.TrafficAdvisoryTestCas
> e.setUp(TrafficAdvisoryTestCase.java:40)
>         at junit.framework.TestCase.runBare(TestCase.java:132)
>         at junit.framework.TestResult$1.protect(TestResult.java:110)
>         at junit.framework.TestResult.runProtected(TestResult.java:128)
>         at junit.framework.TestResult.run(TestResult.java:113)
>         at junit.framework.TestCase.run(TestCase.java:124)
>         at junit.framework.TestSuite.runTest(TestSuite.java:232)
>         at junit.framework.TestSuite.run(TestSuite.java:227)
>         at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.
> java:35)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
> java:62)
> >>> getInterfaceContract
> *** interfaceContract [null]
> *** provider not null, bindingContract [null]
> <<< getInterfaceContract, interfaceContract [null]
> *** bindingContract [null]
> *** bindingContract.getInterface() [null]
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
> tSet(AbstractDirectoryTestSuite.java:138)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
> stractDirectoryTestSuite.java:125)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
> refireBooter.java:290)
>         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
> ava:818)
> Caused by: org.osoa.sca.ServiceRuntimeException: org.apache.tuscany.core.runtime
> .ActivationException: java.lang.NullPointerException
>         at org.apache.tuscany.host.embedded.impl.DefaultSCADomain.<init>(Default
> SCADomain.java:136)
>         at org.apache.tuscany.host.embedded.SCADomain.createNewInstance(SCADomai
> n.java:186)
>         ... 20 more
> Caused by: org.apache.tuscany.core.runtime.ActivationException: java.lang.NullPo
> interException
>         at org.apache.tuscany.core.runtime.DefaultCompositeActivator.start(Defau
> ltCompositeActivator.java:587)
>         at org.apache.tuscany.host.embedded.impl.DefaultSCADomain.<init>(Default
> SCADomain.java:134)
>         ... 21 more
> Caused by: java.lang.NullPointerException
>         at org.apache.tuscany.core.runtime.DefaultCompositeActivator.createWires
> (DefaultCompositeActivator.java:371)
>         at org.apache.tuscany.core.runtime.DefaultCompositeActivator.createRunti
> meWires(DefaultCompositeActivator.java:255)
>         at org.apache.tuscany.core.runtime.DefaultCompositeActivator.start(Defau
> ltCompositeActivator.java:584)
>         ... 22 more
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.932 sec <<< FA
> ILURE!
> Results :
> Tests in error:
>   testTrafficAdvisoryNotification(org.apache.tuscany.notification.remoteProducer
> .TrafficAdvisoryTestCase)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> The composite being used is:
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>            targetNamespace="http://tuscany.apache.org/xmlns/notification/1.0/samples"
>            xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"
>            name="TrafficAdvisoryNotificationRemoteProducerComposite">
>     <component name="TrafficAdvisoryProducer">
> 		<implementation.java class="org.apache.tuscany.notification.remoteProducer.TrafficAdvisoryProducer"/>
>         <reference name="destination" target="TrafficAdvisoryNotificationComponent"/>
>     </component>
>     <component name="TrafficAdvisoryNotificationComponent">
>         <implementation.notification name="TrafficAdvisoryNotification"/>
>     </component>
>     
>     <reference name="TrafficAdvisoryNotificationCompositeReference"
>                promote="TrafficAdvisoryNotificationComponent/TrafficAdvisoryNotificationReference">
>         <interface.wsdl interface="http://example.com/TrafficAdvisory.wsdl#wsdl.interface(TrafficAdvisoryPortType)"
>             wsdli:wsdlLocation="http://example.com/TrafficAdvisory.wsdl wsdl/TrafficAdvisory.wsdl">
>             <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
>         </interface.wsdl>
>         <binding.notification notificationType="trafficAdvisory"/>
>     </reference>
> </composite>
> the custom component type is:
> <componentType xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance">
>      <service name="TrafficAdvisoryNotificationService">
>            <interface.wsdl interface="http://example.com/TrafficAdvisory.wsdl#wsdl.interface(TrafficAdvisoryPortType)"
>                wsdli:wsdlLocation="http://example.com/TrafficAdvisory.wsdl wsdl/TrafficAdvisory.wsdl">
>                <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
>            </interface.wsdl>
>      </service>
>      <reference name="TrafficAdvisoryNotificationReference"
>                 multiplicity="0..n">
>            <interface.wsdl interface="http://example.com/TrafficAdvisory.wsdl#wsdl.interface(TrafficAdvisoryPortType)"
>                wsdli:wsdlLocation="http://example.com/TrafficAdvisory.wsdl wsdl/TrafficAdvisory.wsdl">
>                <db:databinding xmlns:db="http://tuscany.apache.org/xmlns/sca/databinding/1.0" name="org.apache.axiom.om.OMElement" />
>            </interface.wsdl>
>      </reference>
> </componentType>
> the interface.java being used is:
> public interface TrafficAdvisory {
>     void trafficNotification(String report);
> }
> and the interface.wsdl being used is:
> <definitions name="TrafficAdvisory"
>              targetNamespace="http://example.com/TrafficAdvisory.wsdl"
>              xmlns:tns="http://example.com/TrafficAdvisory.wsdl"
>              xmlns:xsd1="http://example.com/TrafficAdvisory.xsd"
>              xmlns="http://schemas.xmlsoap.org/wsdl/">
>     <types>
>         <schema targetNamespace="http://example.com/TrafficAdvisory.xsd"
>                 xmlns:tns="http://example.com/TrafficAdvisory.xsd"
>                 xmlns="http://www.w3.org/2001/XMLSchema">
>             <element name="trafficNotification">
>                 <complexType>
>                     <sequence>
>                         <element name="report" type="string" />
>                     </sequence>
>                 </complexType>
>             </element>
>         </schema>
>     </types>
>     <message name="TrafficNotificationInput">
>         <part name="body" element="xsd1:trafficNotification" />
>     </message>
>     <portType name="TrafficAdvisoryPortType">
>         <operation name="trafficNotification">
>             <input message="tns:TrafficNotificationInput" />
>         </operation>
>     </portType>
> </definitions>

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org