Bug in Activatable handling if inherited from super type.
---------------------------------------------------------

                 Key: QI-310
                 URL: http://issues.ops4j.org/browse/QI-310
             Project: Qi4j
          Issue Type: Bug
          Components: Core Runtime
    Affects Versions: 1.2
            Reporter: Niclas Hedhman
             Fix For: 1.3



If Activatable is inherited in super type and a mixin is not implementing it 
(i.e. is abstract), then a strange exception is thrown.

{code}
public interface Abc extends Activatable
{
    void domainMethods();
}

public abstract class DefMixin
    implements Abc
{
    public void domainMethods()
    {
      :
    }
}

will trigger this exception.


org.qi4j.api.service.ServiceUnavailableException: Could not activate
service SuperType
       at 
org.qi4j.runtime.service.ServiceReferenceInstance.getInstance(ServiceReferenceInstance.java:123)
       at 
org.qi4j.runtime.service.ServiceReferenceInstance.access$100(ServiceReferenceInstance.java:36)
       at 
org.qi4j.runtime.service.ServiceReferenceInstance$ServiceInvocationHandler.invoke(ServiceReferenceInstance.java:169)
       at $Proxy12.doSomething(Unknown Source)
       at 
org.qi4j.runtime.service.ComplexActivatableTest.validateThatApplicationGotAssembled(ComplexActivatableTest.java:25)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
       at 
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
       at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
       at 
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
       at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
       at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
       at 
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
       at 
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
       at 
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
       at 
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
       at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
       at 
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
       at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
       at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
Caused by: org.qi4j.api.common.ConstructionException: Could not find
the subclass method
       at 
org.qi4j.runtime.composite.CompositeMethodModel.newCompositeMethodInstance(CompositeMethodModel.java:204)
       at 
org.qi4j.runtime.composite.CompositeMethodModel.getInstance(CompositeMethodModel.java:172)
       at 
org.qi4j.runtime.composite.CompositeMethodModel.invoke(CompositeMethodModel.java:156)
       at 
org.qi4j.runtime.composite.CompositeMethodsModel.invoke(CompositeMethodsModel.java:117)
       at 
org.qi4j.runtime.composite.AbstractCompositeModel.invoke(AbstractCompositeModel.java:144)
       at 
org.qi4j.runtime.composite.TransientInstance.invokeComposite(TransientInstance.java:79)
       at 
org.qi4j.runtime.service.ComplexActivatableTest_DomainType_Stub.activate(Unknown
Source)
       at org.qi4j.runtime.composite.MixinModel.activate(MixinModel.java:317)
       at 
org.qi4j.runtime.composite.AbstractMixinsModel.activate(AbstractMixinsModel.java:301)
       at org.qi4j.runtime.service.ServiceModel.activate(ServiceModel.java:339)
       at 
org.qi4j.runtime.service.ServiceInstance.activate(ServiceInstance.java:58)
       at org.qi4j.runtime.service.Activator.activate(Activator.java:61)
       at 
org.qi4j.runtime.service.ServiceReferenceInstance.getInstance(ServiceReferenceInstance.java:118)
       ... 24 more
Caused by: java.lang.NoSuchMethodException:
org.qi4j.runtime.service.ComplexActivatableTest_ActivationMixin_Stub._activate()
       at java.lang.Class.getMethod(Class.java:1605)
       at 
org.qi4j.runtime.composite.CompositeMethodModel.newCompositeMethodInstance(CompositeMethodModel.java:201)
       ... 36 more



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

        

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to