[jira] [Commented] (FELIX-5319) HttpServiceRuntime provides incorrect info for service that is both Servlet and Resource
[ https://issues.apache.org/jira/browse/FELIX-5319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15409596#comment-15409596 ] Derek Baum commented on FELIX-5319: --- Hi Carsten, Thanks for fixing this so quickly. I can confirm that a local build of 3.2.3-SNAPSHOT works fine for me. -- Derek > HttpServiceRuntime provides incorrect info for service that is both Servlet > and Resource > > > Key: FELIX-5319 > URL: https://issues.apache.org/jira/browse/FELIX-5319 > Project: Felix > Issue Type: Bug > Components: HTTP Service >Affects Versions: http.base-3.0.10, http.jetty-3.2.2, http.bridge-3.0.10 >Reporter: Derek Baum >Assignee: Carsten Ziegeler >Priority: Minor > Fix For: http.base-3.0.12, http.jetty-3.2.4, http.bridge-3.0.12 > > > I have a servlet defined as follows: > Note: it defines _both_ servlet and resource properties. > @Component(property = { > HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME + "=Hello > World", > HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + > "=/hello/sayHello", > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + > "=/hello/static/*", > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX + "=/static" > }) > public class HelloWorldServlet extends HttpServlet implements Servlet { > } > I am using the HttpServiceRuntime to discover servlet info, but this servlet > does not appear. > @Reference > HttpServiceRuntime httpRuntime; > RuntimeDTO runtimeDTO = httpRuntime.getRuntimeDTO(); > for (ServletContextDTO servletContextDTO : runtimeDTO.servletContextDTOs) { > ServletDTO[] servletDTOs = servletContextDTO.servletDTOs; > // servletDTOs.length == 0 > } > The equivalent code for ResourceDTO _does_ find a ResourceDTO for this > servlet, but it contains servlet, rather than resource info: > resourceDTO.patterns = [/hello/sayHello] > resourceDTO.prefix = null > If I remove this resource property from the servlet, then the above code > finds the servlet, as expected: > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + "=/hello/static/*" -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FELIX-5319) HttpServiceRuntime provides incorrect info for service that is both Servlet and Resource
[ https://issues.apache.org/jira/browse/FELIX-5319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15409497#comment-15409497 ] Carsten Ziegeler commented on FELIX-5319: - Thanks for reporting, as a first step I've added a test case for that to our integration tests...and the test fails of course atm, with the problem mentioned in the description > HttpServiceRuntime provides incorrect info for service that is both Servlet > and Resource > > > Key: FELIX-5319 > URL: https://issues.apache.org/jira/browse/FELIX-5319 > Project: Felix > Issue Type: Bug > Components: HTTP Service >Affects Versions: http.jetty-3.2.2 >Reporter: Derek Baum >Assignee: Carsten Ziegeler >Priority: Minor > Fix For: http.jetty-3.2.4 > > > I have a servlet defined as follows: > Note: it defines _both_ servlet and resource properties. > @Component(property = { > HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME + "=Hello > World", > HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + > "=/hello/sayHello", > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + > "=/hello/static/*", > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX + "=/static" > }) > public class HelloWorldServlet extends HttpServlet implements Servlet { > } > I am using the HttpServiceRuntime to discover servlet info, but this servlet > does not appear. > @Reference > HttpServiceRuntime httpRuntime; > RuntimeDTO runtimeDTO = httpRuntime.getRuntimeDTO(); > for (ServletContextDTO servletContextDTO : runtimeDTO.servletContextDTOs) { > ServletDTO[] servletDTOs = servletContextDTO.servletDTOs; > // servletDTOs.length == 0 > } > The equivalent code for ResourceDTO _does_ find a ResourceDTO for this > servlet, but it contains servlet, rather than resource info: > resourceDTO.patterns = [/hello/sayHello] > resourceDTO.prefix = null > If I remove this resource property from the servlet, then the above code > finds the servlet, as expected: > HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + "=/hello/static/*" -- This message was sent by Atlassian JIRA (v6.3.4#6332)