[ 
https://issues.apache.org/jira/browse/FELIX-5278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15320373#comment-15320373
 ] 

Aygalinc Colin commented on FELIX-5278:
---------------------------------------

It throws the exception in this case:
- A CustomInstanceManager extends InstanceManager.
- This manager creates the POJO before calling start method.
- In the first call of the start method, exception is thrown.

As example in createObject, at line 746 or 757, iPOJO uses 
InstanceManager.class to find the appropriate constructor and i think the same 
mechanism must be used in managedInjectedObject because of the invariant 
behavior of iPOJO bytecode manipulation.

> Error in method managedInjectedObject of InstanceManager
> --------------------------------------------------------
>
>                 Key: FELIX-5278
>                 URL: https://issues.apache.org/jira/browse/FELIX-5278
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: ipojo-runtime-1.12.1
>         Environment: Ubuntu 
>            Reporter: Aygalinc Colin
>              Labels: patch
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In InstanceManager.java, the method managedInjectedObject at line 1016 can 
> throw an java.lang.NoSuchMethodException in case of extension of the 
> InstanceManager.
> I recommend to change the line 1016:
> Method setIM = m_clazz.getDeclaredMethod("_setInstanceManager", new 
> Class[]{this.getClass()});
> by :    
> Method setIM = m_clazz.getDeclaredMethod("_setInstanceManager", new new 
> Class[]{InstanceManager.class});
> because iPOJO manipulation always produces a _setInstanceManager method with 
> an InstanceManager.class attribute.
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to