I am trying to creata a Domino OSGI plugin which exposes a simple Hello World servlet. To do this I created in eclipse a plugin project(with web.xml and the servlet in place) , a feature project containing this plugin and an updated site project.
After this I created an application in Domino designer using the 'Eclipse Update Site' as template (name RestDemoUpdateSite.nsf). With this application open in Domino administrator, I successfully imported my eclipse update site.
Finally I copied RestDemoUpdateSite.nsf to the folder - C:\Program Files\IBM\Domino\data and added the line OSGI_HTTP_DYNAMIC_BUNDLES=RestDemoUpdateSite.nsf in notes.ini.
The link http://<>/RestDemoUpdateSite.nsf opens fine
A GET request to http://<>/RestDemoUpdateSite.nsf/api/ gives the json response
{
"services":[
{
"name":"Data",
"enabled":false,
"version":"9.0.1",
"href":"\/RestDemoUpdateSite.nsf\/api\/data"
},
{
"name":"Calendar",
"enabled":false,
"version":"9.0.1",
"href":"\/RestDemoUpdateSite.nsf\/api\/calendar"
},
{
"name":"Core",
"enabled":true,
"version":"9.0.1",
"href":"\/RestDemoUpdateSite.nsf\/api\/core"
}
]
}
A GET request to my servlet http://<>/RestDemoUpdateSite.nsf/serviceapi/student gives the error
HTTP Web Server: Couldn't find design note - serviceapi/student [/RestDemoUpdateSite.nsf/serviceapi/student] Anonymous
Any suggestion or hints as to what might be going wrong would be of great help.
Thank you
The first step is to make sure your plugin is being loaded by the OSGi framework. Execute the following server console command:
tell http osgi ss {bundle.name}
For example, tell http osgi ss com.ibm.domino.services
lists all the plugins matching the given name. The listing tells you whether a plugin is ACTIVE, RESOLVED, INSTALLED, etc.
Assuming your plugin is being loaded, the next step is to make sure you are defining your servlet correctly. You said you included a web.xml file, but OSGi servlets are typically defined in plugin.xml. They implement the org.eclipse.equinox.http.registry.servlets
extension. You can find more details in these slides. See the section starting with "Creating, deploying & debugging a simple servlet".