You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by yaoming <ya...@duketechnology.com> on 2011/07/18 11:59:21 UTC
no support or is there a bug in ipojo ?
Dear sir :
When I was using the maven-ipojo-plugin ,I found something confused me .
I wrote a class with a static field , and set meta.xml in order to inject
the value of this field by ipojo , but when the maven-ipojo-plugin executed
the goal ,there threw an exception : MojoExecutionException, and the logger
info is as follows :
The field canvas is referenced in the metadata but does not exist in the
com/duketechnology/platform/core/RepaintManager.class class
I found that when I deleted the modifier "static" , the problem disappeared
!
I'm wondering whether or not ipojo does support the injection for the static
field .
My source code and configure file are as follows:
/******************************************************************
*
* meta.xml
*******************************************************************
*
*/
<ipojo
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="org.apache.felix.ipojo
http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
xmlns="org.apache.felix.ipojo">
<component classname="com.duketechnology.platform.core.RepaintManager">
<requires field="canvas"/>
<provides/>
</component>
...
</ipojo>
/******************************************************************
*
* RepaintManager.java
*******************************************************************
*
*/
public final class RepaintManager {
private static ICanvas canvas;
.........
}
Looking forward to your response.
yours sincerely
Re: no support or is there a bug in ipojo ?
Posted by Clement Escoffier <cl...@gmail.com>.
Hi,
No iPOJO does not inject static members. Only instance members are injected.
Regards,
Clement
On 18.07.2011, at 11:59, yaoming wrote:
> Dear sir :
>
> When I was using the maven-ipojo-plugin ,I found something confused me .
>
> I wrote a class with a static field , and set meta.xml in order to inject
> the value of this field by ipojo , but when the maven-ipojo-plugin executed
> the goal ,there threw an exception : MojoExecutionException, and the logger
> info is as follows :
>
>
>
> The field canvas is referenced in the metadata but does not exist in the
> com/duketechnology/platform/core/RepaintManager.class class
>
>
>
> I found that when I deleted the modifier "static" , the problem disappeared
> !
>
> I'm wondering whether or not ipojo does support the injection for the static
> field .
>
> My source code and configure file are as follows:
>
>
>
>
>
> /******************************************************************
>
> *
>
> * meta.xml
>
> *******************************************************************
>
> *
>
> */
>
>
>
> <ipojo
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="org.apache.felix.ipojo
> http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
>
> xmlns="org.apache.felix.ipojo">
>
>
>
> <component classname="com.duketechnology.platform.core.RepaintManager">
>
> <requires field="canvas"/>
>
> <provides/>
>
> </component>
>
>
>
> ...
>
> </ipojo>
>
>
>
>
>
> /******************************************************************
>
> *
>
> * RepaintManager.java
>
> *******************************************************************
>
> *
>
> */
>
>
>
> public final class RepaintManager {
>
>
>
>
>
> private static ICanvas canvas;
>
>
>
> .........
>
> }
>
>
>
>
>
>
>
> Looking forward to your response.
>
> yours sincerely
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org