{"action":"closed","issue":{"url":"https://api.github.com/repos/mvc-spec/ozark/issues/143","repository_url":"https://api.github.com/repos/mvc-spec/ozark","labels_url":"https://api.github.com/repos/mvc-spec/ozark/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/mvc-spec/ozark/issues/143/comments","events_url":"https://api.github.com/repos/mvc-spec/ozark/issues/143/events","html_url":"https://github.com/mvc-spec/ozark/issues/143","id":270622458,"number":143,"title":"multiple Application classes","user":{"login":"tompasik","id":2171509,"avatar_url":"https://avatars1.githubusercontent.com/u/2171509?v=4","gravatar_id":"","url":"https://api.github.com/users/tompasik","html_url":"https://github.com/tompasik","followers_url":"https://api.github.com/users/tompasik/followers","following_url":"https://api.github.com/users/tompasik/following{/other_user}","gists_url":"https://api.github.com/users/tompasik/gists{/gist_id}","starred_url":"https://api.github.com/users/tompasik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tompasik/subscriptions","organizations_url":"https://api.github.com/users/tompasik/orgs","repos_url":"https://api.github.com/users/tompasik/repos","events_url":"https://api.github.com/users/tompasik/events{/privacy}","received_events_url":"https://api.github.com/users/tompasik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-02T11:38:53Z","updated_at":"2018-04-22T06:50:53Z","closed_at":"2018-04-22T06:50:53Z","author_association":"NONE","body":"Hey guys,\r\n\r\nI've started playing around with MVC/Ozark and immediately stumbled upon an issue that may need resolving or at least discussing.\r\n\r\nI've decided splitting template based resources (handled by MVC) from regular resources handled by JAX-RS implementation using different `javax.ws.rs.core.Application` classes annotated with `@ApplicationPath` in a way that _/views/*_ urls are handled by the former class and _/api/*_ by the latter.\r\n\r\nApparently such a scheme is not handled correctly by Ozark :-( The JAX-RS spec does not seem to constrain this (multiple classes extending `javax.ws.rs.core.Application` classes are not forbidden and hence allowed ? :-) ) and the MVC spec does not seem to mention anything regarding this - so I would assume this should be handled just fine.\r\n\r\nI've been testing this on Payara-5 and got the following error:\r\n\r\n```\r\n  Error invoking ServletContainerInitializer org.mvcspec.ozark.servlet.OzarkContainerInitializer\r\njava.lang.IllegalStateException: More than one JAX-RS ApplicationPath detected!\r\n\tat org.mvcspec.ozark.servlet.OzarkContainerInitializer.onStartup(OzarkContainerInitializer.java:57)\r\n[...]\r\n```\r\n\r\nPlease let me know if you consider this a bug which should be fixed or is it an expected behavior that was decided on which I might not be aware of. In the latter case maybe some note in documentation would be helpful as this kind of constrains the usage of JAX-RS in an application.\r\n\r\nPS. there is also another issue that I've noticed in `OzarkContainerInitializer`. The classes provided to the `onStartup` are a set and as the iteration order cannot be relied upon and in fact with each restart/redeploy of the application the order is different, the observed behavior implemented by the class is different - the exception noted above is not thrown every time. Sometimes it is and sometimes the loop ends before the exception is thrown due to the `break` on line 67 (1.0.0-m03-SNAPSHOT)."}}
{"actor":{"display_login":"chkal"}}