Skip to main content



      Home
Home » Eclipse Projects » Equinox » !MESSAGE [SCR] Method was not found:(ds with equinox and eclipse PDE, unbind method not found)
!MESSAGE [SCR] Method was not found: [message #1732304] Sun, 15 May 2016 07:38 Go to next message
Eclipse UserFriend
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 07:39] by Moderator

Re: !MESSAGE [SCR] Method was not found: [message #1732316 is a reply to message #1732304] Sun, 15 May 2016 13:22 Go to previous message
Eclipse UserFriend
DS does not support no arg event methods. See 112.3.2 of the spec.
Previous Topic:Creating custom product/site/repository
Next Topic:How to pass attributes from java filter to doFilter
Goto Forum:
  


Current Time: Mon Apr 21 10:51:34 EDT 2025

Powered by FUDForum. Page generated in 0.04337 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top