Hello Hi,
I keep getting !MESSAGE [SCR] Method was not found: in my component. I have controlled my work times and again, and found no mistake.
Note that, this usually happens for the unbind method.
But I realised, when I add a perameter to that method (e.g the service to be inject), the unbind method is recognised by the ds.
What may be the cause of this?
below is my components xml declaration
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="com.sleepmonitor.rest">
<implementation class="com.sleepmonitor.rest.internal.RESTComponent"/>
<reference unbind="unsetHttpService" bind="setHttpService" cardinality="1..1" interface="org.osgi.service.http.HttpService" name="HttpService" policy="static"/>
<property name="context_path" type="String" value="/src"/>
</scr:component>
public class RESTComponent implements IServletInitConstants {
private HttpService httpService;
public void unsetHttpService() {
if (this.httpService != null)
this.httpService = null;
}
public synchronized void setHttpService(HttpService httpService) {
this.httpService = httpService;
}
...
}
The unbind method: unsetHttpService will only be recognised by ds when i do this: Mark the parameter httpservice
...
public void unsetHttpService(HttpService httpService) {
if (this.httpService != null)
this.httpService = null;
}
...
Could there be a problem with my declaration or anything else?
[Updated on: Sun, 15 May 2016 11:39]
Report message to a moderator