Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Register Servlet as Service vs using equinox servlet registry
Register Servlet as Service vs using equinox servlet registry [message #1713924] Sun, 08 November 2015 15:07 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
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,
Re: Register Servlet as Service vs using equinox servlet registry [message #1715851 is a reply to message #1713924] Thu, 26 November 2015 15:58 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
Still stuck on this, is Http White-board model is supposed to be supported in equinox ? any info on how to properly register servlet as service in equinox and properties to set ?
Re: Register Servlet as Service vs using equinox servlet registry [message #1717063 is a reply to message #1715851] Wed, 09 December 2015 18:45 Go to previous message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 220
Registered: March 2010
Location: France
Senior Member
For those who want to solve this, I finally found how to fix this, it is necessary to add a service property "osgi.http.whiteboard.context.select" with value="(equinox.legacy.context.helper=true)" when registering the filter or the servlet, then it works ....
Previous Topic:Creates dropins folder in my product.
Next Topic:[p2] Querying Babel p2 repository for language packs
Goto Forum:
  


Current Time: Mon Sep 24 05:15:10 GMT 2018

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

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

Back to the top