Jorge Cercas created FELIX-5884:
-----------------------------------

             Summary: HTTP Jetty Managed Service Factory (Factory 
Configuration) not working
                 Key: FELIX-5884
                 URL: https://issues.apache.org/jira/browse/FELIX-5884
             Project: Felix
          Issue Type: Bug
          Components: HTTP Service
    Affects Versions: http.jetty-4.0.0
         Environment: - Linux
- Apache Felix Framework 6.0.0
- Apache Felix Fileinstall 3.6.4
- Apache Felix ConfigAdmin 1.9.2
- SCR 2.1.0
- org.apache.felix.http.servlet-api 1.1.2
- org.apache.felix.http.jetty 4.0.0
- org.apache.felix.http.whiteboard 4.0.0

            Reporter: Jorge Cercas


When providing multiple org.apache.felix.http PID's in order to create multiple 
Jetty services on different ports, the HTTP Jetty 4.0.0 implementation never 
creates more than one. The same setup works with version 3.4.8.

+*Sample setup*+ 
- config file *org.apache.felix.http.cfg*: 
{code:java}
org.apache.felix.http.enable=false
{code}
- config file *org.apache.felix.http-8081.cfg*: 
{code:java}
org.apache.felix.http.enable=true
org.osgi.service.http.port=8081
{code}
- config file *org.apache.felix.http-8082.cfg*: 
{code:java}
org.apache.felix.http.enable=true
org.osgi.service.http.port=8082
{code}

With the above setup, the observed behaviour is that only port 8082 is 
accessible.

+*Captured logs*+

 
{code:java}
Started Jetty 9.4.9.v20180320 at port(s) HTTP:8081 on context path / 
[minThreads=8,maxThreads=200,acceptors=1,selectors=4]
ServiceEvent REGISTERED - [org.osgi.service.http.HttpService] - 
org.apache.felix.http.jetty
ServiceEvent REGISTERED - [org.osgi.service.http.runtime.HttpServiceRuntime] - 
org.apache.felix.http.jetty
ServiceEvent REGISTERED - [org.osgi.service.http.context.ServletContextHelper] 
- org.apache.felix.http.jetty
[ServiceReference 46 from bundle 17 : org.apache.felix.http.jetty:4.0.0 
ref=[org.osgi.service.http.context.ServletContextHelper] 
properties={objectClass=[org.osgi.service.http.context.ServletContextHelper], 
osgi.http.whiteboard.context.name=default, osgi.http.whiteboard.context.path=/, 
service.bundleid=17, service.id=46, service.ranking=-2147483648, 
service.scope=bundle}] Ignoring shadowed ServletContextHelper service
[ServiceReference 41 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[jmdsc.osgi.example.http.user.UserResource] properties={component.id=0, 
component.name=jmdsc.osgi.example.http.user.UserResource, 
objectClass=[jmdsc.osgi.example.http.user.UserResource], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=Users), 
osgi.http.whiteboard.resource.pattern=[/img/*], 
osgi.http.whiteboard.resource.prefix=/META-INF/resources/users/img, 
service.bundleid=18, service.id=41, service.scope=bundle}] Ignoring unmatching 
Resource service
[ServiceReference 39 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[java.lang.Object] properties={objectClass=[java.lang.Object], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=App1), 
osgi.http.whiteboard.resource.pattern=/img/*, 
osgi.http.whiteboard.resource.prefix=/META-INF/resources/app1/img, 
service.bundleid=18, service.id=39, service.scope=singleton}] Ignoring 
unmatching Resource service
[ServiceReference 46 from bundle 17 : org.apache.felix.http.jetty:4.0.0 
ref=[org.osgi.service.http.context.ServletContextHelper] 
properties={objectClass=[org.osgi.service.http.context.ServletContextHelper], 
osgi.http.whiteboard.context.name=default, osgi.http.whiteboard.context.path=/, 
service.bundleid=17, service.id=46, service.ranking=-2147483648, 
service.scope=bundle}] Ignoring shadowed ServletContextHelper service
[ServiceReference 42 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[javax.servlet.Servlet] properties={component.id=1, 
component.name=jmdsc.osgi.example.http.user.UserServlet, 
objectClass=[javax.servlet.Servlet], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=Users), 
osgi.http.whiteboard.servlet.pattern=[/*], service.bundleid=18, service.id=42, 
service.scope=bundle}] Ignoring unmatching Servlet service
ServiceEvent REGISTERED - [javax.servlet.Servlet] - org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - [org.osgi.service.http.HttpService] - 
org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - [javax.servlet.Servlet] - 
org.apache.felix.http.jetty
[ServiceReference 38 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[javax.servlet.Servlet] properties={objectClass=[javax.servlet.Servlet], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=App1), 
osgi.http.whiteboard.servlet.pattern=/, service.bundleid=18, service.id=38, 
service.scope=singleton}] Ignoring unmatching Servlet service
ServiceEvent UNREGISTERING - 
[org.osgi.service.http.context.ServletContextHelper] - 
org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - [org.osgi.service.http.runtime.HttpServiceRuntime] 
- org.apache.felix.http.jetty
Stopped Jetty.
ServiceEvent UNREGISTERING - [org.osgi.service.http.HttpService] - 
org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - [javax.servlet.Servlet] - 
org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - 
[org.osgi.service.http.context.ServletContextHelper] - 
org.apache.felix.http.jetty
ServiceEvent UNREGISTERING - [org.osgi.service.http.runtime.HttpServiceRuntime] 
- org.apache.felix.http.jetty
Stopped Jetty.
Jetty not started (HTTP and HTTPS disabled)
Started Jetty 9.4.9.v20180320 at port(s) HTTP:8082 on context path / 
[minThreads=8,maxThreads=200,acceptors=1,selectors=4]
ServiceEvent REGISTERED - [org.osgi.service.http.HttpService] - 
org.apache.felix.http.jetty
ServiceEvent REGISTERED - [org.osgi.service.http.runtime.HttpServiceRuntime] - 
org.apache.felix.http.jetty
ServiceEvent REGISTERED - [org.osgi.service.http.context.ServletContextHelper] 
- org.apache.felix.http.jetty
[ServiceReference 41 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[jmdsc.osgi.example.http.user.UserResource] properties={component.id=0, 
component.name=jmdsc.osgi.example.http.user.UserResource, 
objectClass=[jmdsc.osgi.example.http.user.UserResource], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=Users), 
osgi.http.whiteboard.resource.pattern=[/img/*], 
osgi.http.whiteboard.resource.prefix=/META-INF/resources/users/img, 
service.bundleid=18, service.id=41, service.scope=bundle}] Ignoring unmatching 
Resource service
[ServiceReference 39 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[java.lang.Object] properties={objectClass=[java.lang.Object], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=App1), 
osgi.http.whiteboard.resource.pattern=/img/*, 
osgi.http.whiteboard.resource.prefix=/META-INF/resources/app1/img, 
service.bundleid=18, service.id=39, service.scope=singleton}] Ignoring 
unmatching Resource service
[ServiceReference 38 from bundle 18 : jmdsc.osgi.example.http:1.0.0 
ref=[javax.servlet.Servlet] properties={objectClass=[javax.servlet.Servlet], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=App1), 
osgi.http.whiteboard.servlet.pattern=/, service.bundleid=18, service.id=38, 
service.scope=singleton}] Ignoring unmatching Servlet service
ServiceEvent REGISTERED - [javax.servlet.Servlet] - org.apache.felix.http.jetty
ServiceEvent MODIFIED - [org.osgi.service.http.runtime.HttpServiceRuntime] - 
org.apache.felix.http.jetty
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to