You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benjamin Debeerst <Be...@younicos.com> on 2014/07/17 19:28:50 UTC

iPojo ProvidedService handler: ArrayIndexOutOfBoundsException

Hallo there,

I have an iPOJO (1.11.2) component using the @ServiceController annotation to control the service publishing. Most of the time this works perfectly fine, but occasionally I get an ArrayIndexOutOfBoundsException.

java.lang.ArrayIndexOutOfBoundsException: 4
               at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.__M_onSet(ProvidedServiceHandler.java:416)[83:org.apache.felix.ipojo:1.11.2]
               at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.onSet(ProvidedServiceHandler.java)[83:org.apache.felix.ipojo:1.11.2]
               at org.apache.felix.ipojo.InstanceManager.onSet(InstanceManager.java:1401)[83:org.apache.felix.ipojo:1.11.2]
               [..] (My own code following, where the service controller boolean is manipulated)

Unfortunately I cannot share the consumer code nor reproduce the problem. I looked into iPOJOs code to see what's going on [1], and there we have:

for (int j = 0; j < svc.getProperties().length; j++) {
Property prop = svc.getProperties()[j];
               [...]
}

Which looks like a proper race condition to me, if svc.getProperties() changes its value in the meantime because of missing synchronizations. I don't see any synchronizations there, but I also don't know if they would be appropriate in the first place.

Has anyone seen this failure? Any insights would be helpful.

Cheers,
Benjamin


[1] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.felix/org.apache.felix.ipojo/1.11.2/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java#416


RE: iPojo ProvidedService handler: ArrayIndexOutOfBoundsException

Posted by Benjamin Debeerst <Be...@younicos.com>.
Sure:

https://issues.apache.org/jira/browse/FELIX-4565

Thanks.

-----Original Message-----
From: Clement Escoffier [mailto:clement.escoffier@gmail.com] 
Sent: Donnerstag, 17. Juli 2014 19:58
To: users@felix.apache.org
Subject: Re: iPojo ProvidedService handler: ArrayIndexOutOfBoundsException

Hi,

It looks like a bug. Could you open an issue ?

Regards,

Clement

On 17 juillet 2014 at 19:29:26, Benjamin Debeerst (benjamin.debeerst@younicos.com) wrote:

Hallo there, 

I have an iPOJO (1.11.2) component using the @ServiceController annotation to control the service publishing. Most of the time this works perfectly fine, but occasionally I get an ArrayIndexOutOfBoundsException. 

java.lang.ArrayIndexOutOfBoundsException: 4 at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.__M_onSet(ProvidedServiceHandler.java:416)[83:org.apache.felix.ipojo:1.11.2]
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.onSet(ProvidedServiceHandler.java)[83:org.apache.felix.ipojo:1.11.2]
at org.apache.felix.ipojo.InstanceManager.onSet(InstanceManager.java:1401)[83:org.apache.felix.ipojo:1.11.2]
[..] (My own code following, where the service controller boolean is manipulated) 

Unfortunately I cannot share the consumer code nor reproduce the problem. I looked into iPOJOs code to see what's going on [1], and there we have: 

for (int j = 0; j < svc.getProperties().length; j++) { Property prop = svc.getProperties()[j]; [...] } 

Which looks like a proper race condition to me, if svc.getProperties() changes its value in the meantime because of missing synchronizations. I don't see any synchronizations there, but I also don't know if they would be appropriate in the first place. 

Has anyone seen this failure? Any insights would be helpful. 

Cheers,
Benjamin 


[1] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.felix/org.apache.felix.ipojo/1.11.2/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java#416 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

Re: iPojo ProvidedService handler: ArrayIndexOutOfBoundsException

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

It looks like a bug. Could you open an issue ?

Regards,

Clement

On 17 juillet 2014 at 19:29:26, Benjamin Debeerst (benjamin.debeerst@younicos.com) wrote:

Hallo there, 

I have an iPOJO (1.11.2) component using the @ServiceController annotation to control the service publishing. Most of the time this works perfectly fine, but occasionally I get an ArrayIndexOutOfBoundsException. 

java.lang.ArrayIndexOutOfBoundsException: 4 
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.__M_onSet(ProvidedServiceHandler.java:416)[83:org.apache.felix.ipojo:1.11.2] 
at org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler.onSet(ProvidedServiceHandler.java)[83:org.apache.felix.ipojo:1.11.2] 
at org.apache.felix.ipojo.InstanceManager.onSet(InstanceManager.java:1401)[83:org.apache.felix.ipojo:1.11.2] 
[..] (My own code following, where the service controller boolean is manipulated) 

Unfortunately I cannot share the consumer code nor reproduce the problem. I looked into iPOJOs code to see what's going on [1], and there we have: 

for (int j = 0; j < svc.getProperties().length; j++) { 
Property prop = svc.getProperties()[j]; 
[...] 
} 

Which looks like a proper race condition to me, if svc.getProperties() changes its value in the meantime because of missing synchronizations. I don't see any synchronizations there, but I also don't know if they would be appropriate in the first place. 

Has anyone seen this failure? Any insights would be helpful. 

Cheers, 
Benjamin 


[1] http://grepcode.com/file/repo1.maven.org/maven2/org.apache.felix/org.apache.felix.ipojo/1.11.2/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandler.java#416