{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/80","repository_url":"https://api.github.com/repos/eclipse-ee4j/krazo","labels_url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/80/comments","events_url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/80/events","html_url":"https://github.com/eclipse-ee4j/krazo/issues/80","id":461129465,"node_id":"MDU6SXNzdWU0NjExMjk0NjU=","number":80,"title":"Krazo starting twice","user":{"login":"mthmulders","id":430114,"node_id":"MDQ6VXNlcjQzMDExNA==","avatar_url":"https://avatars1.githubusercontent.com/u/430114?v=4","gravatar_id":"","url":"https://api.github.com/users/mthmulders","html_url":"https://github.com/mthmulders","followers_url":"https://api.github.com/users/mthmulders/followers","following_url":"https://api.github.com/users/mthmulders/following{/other_user}","gists_url":"https://api.github.com/users/mthmulders/gists{/gist_id}","starred_url":"https://api.github.com/users/mthmulders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthmulders/subscriptions","organizations_url":"https://api.github.com/users/mthmulders/orgs","repos_url":"https://api.github.com/users/mthmulders/repos","events_url":"https://api.github.com/users/mthmulders/events{/privacy}","received_events_url":"https://api.github.com/users/mthmulders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-06-26T18:55:33Z","updated_at":"2019-06-29T09:34:09Z","closed_at":null,"author_association":"NONE","body":"The [Install Guide for Servlet Containers](https://www.mvc-spec.org/krazo/docs/install-servlet.html) provides a sample web.xml file:\r\n\r\n```xml\r\n\r\n\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n         xmlns=\"http://java.sun.com/xml/ns/javaee\"\r\n         xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_4_0.xsd\"\r\n         version=\"4.0\">\r\n\r\n  <!-- omitted for brevity -->\r\n\r\n</web-app>\r\n```\r\n\r\nWhen I do this, I notice that my application logs the following message **twice**:\r\n\r\n    org.eclipse.krazo.bootstrap.Initializer.initialize Initializing Eclipse Krazo...\r\n\r\nI wonder if this intentional. If not, adding the following to the root `web-app` fixed it for me:\r\n\r\n```xml\r\nmetadata-complete=\"true\"\r\n```\r\n\r\nI'm more than willing to provide a PR for this, but I'm not sure if it's correct. Also, I don't know where to find the website source ;-)."},"comment":{"url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/comments/506943559","html_url":"https://github.com/eclipse-ee4j/krazo/issues/80#issuecomment-506943559","issue_url":"https://api.github.com/repos/eclipse-ee4j/krazo/issues/80","id":506943559,"node_id":"MDEyOklzc3VlQ29tbWVudDUwNjk0MzU1OQ==","user":{"login":"chkal","id":159245,"node_id":"MDQ6VXNlcjE1OTI0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/159245?v=4","gravatar_id":"","url":"https://api.github.com/users/chkal","html_url":"https://github.com/chkal","followers_url":"https://api.github.com/users/chkal/followers","following_url":"https://api.github.com/users/chkal/following{/other_user}","gists_url":"https://api.github.com/users/chkal/gists{/gist_id}","starred_url":"https://api.github.com/users/chkal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chkal/subscriptions","organizations_url":"https://api.github.com/users/chkal/orgs","repos_url":"https://api.github.com/users/chkal/repos","events_url":"https://api.github.com/users/chkal/events{/privacy}","received_events_url":"https://api.github.com/users/chkal/received_events","type":"User","site_admin":false},"created_at":"2019-06-29T09:34:09Z","updated_at":"2019-06-29T09:34:09Z","author_association":"CONTRIBUTOR","body":"@mthmulders Thanks for providing more details. A few comments:\r\n\r\n> It's actually pretty strange, when I think of it, because `metadata-complete` is supposed to say that the container doesn't have to do classpath scanning, since `web.xml` is _complete_.\r\n\r\nThat's true. However, most frameworks use a `ServletContainerInitializer` today to ensure that filters/servlets are registered even if `metadata-complete` is set. In case of RESTEasy, it looks like only `HttpServlet30Dispatcher` is registered via the initializer:\r\n\r\nhttps://github.com/resteasy/Resteasy/blob/ccb565ea87972cf032bea0bd66b96b380597e15c/resteasy-servlet-initializer/src/main/java/org/jboss/resteasy/plugins/servlet/ResteasyServletInitializer.java#L107-L110\r\n\r\nThe interesting thing is that the Krazo initialization is triggered via an JAX-RS feature. And actually it should be initialized only once (see `isAlreadyInitialized()` method mentioned above). So my guess is that:\r\n\r\n  * Either `isAlreadyInitialized()` isn't working as expected\r\n  * Or RESTEasy is actually initialized twice and therefore also initialized Krazo twice\r\n\r\nMaybe debugging `isAlreadyInitialized()` can help?\r\n\r\n\r\n"}}
{"actor":{"display_login":"chkal"}}