Register Servlet as Service vs using equinox servlet registry [message #1713924] |
Sun, 08 November 2015 15:07 |
Arnaud MERGEY Messages: 243 Registered: March 2010 Location: France |
Senior Member |
|
|
Hello,
Since Mars registering a Servlet as javax.servlet.Servlet service is working, but the behavior changes compared to servlet registration using equinox http registry.
My application run as a legacy WAR application using equinox servlet bridge, and when I tried to register servlet as service directly instead of using the equinox extension point I noticed some servlets does not work anymore.
The one that retrieve something from JNDI or the one that requires authentication are not working anymore. If i use extension point it works as expected.
I noticed when I use extension point, I can see my servlet as a service but there is more properties
Quote:[javax.servlet.Servlet]
equinox.legacy.tccl org.eclipse.osgi.internal.framework.ContextFinder@1f03ce40
osgi.http.whiteboard.servlet.name helloServlet
service.ranking 2147483647
osgi.http.whiteboard.context.select (service.id=215)
osgi.http.whiteboard.servlet.pattern /ws
/ws/*
osgi.http.whiteboard.target (equinox.http.id=5877577461146792947)
service.bundleid 138
service.scope singleton
Using Bundles org.eclipse.equinox.http.servlet (203)
if I register my servlet as a service
Quote:
[javax.servlet.Servlet]
osgi.http.whiteboard.servlet.pattern /ws
service.bundleid 138
service.scope bundle
Using Bundles org.eclipse.equinox.http.servlet (203)
So I guess the different behavior is because of the missing properties if I use direct registration instead of the extension point. The culprit is probably the missing equinox.legacy.tccl, osgi.http.whiteboard.context.select or osgi.http.whiteboard.target properties.
These properties values are objects, not string, so I cannot set them in my declarative service file, so I cannot test if it is related to my issue.
for now I still need to register servlets using equinox registry, I would prefer to use declarative service, is this ring some bell to someone ?
thanks,
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03461 seconds