jersey
  1. jersey
  2. JERSEY-1618

archetype fails out of the box; always uses "com.example" as package

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.16
    • Fix Version/s: 1.17
    • Component/s: None
    • Labels:
      None
    • Environment:

      Java 1.7u9

      Description

      What

      If you create a grizzly2 archetype, you'll actually get an error unless you happen to use com.example as your package:

      Exception in thread "main" com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
      	at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:99)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1331)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:168)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:774)
      	at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:770)
      	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
      

      Why

      The generate Main.java has:

      protected static HttpServer startServer() throws IOException {
              ResourceConfig resourceConfig = new PackagesResourceConfig("com.example");
      

      Notice that com.example is hardcoded. I'm guessing the template doesn't use the user-specified package.

      Other

      This is actually using 1.16, which is available on Maven Central but there's no entry for it in JIRA.

        Activity

        Hide
        the_alchemist added a comment -

        I forgot to mention which archetype:

        • GroupId: com.sun.jersey.archetypes
        • ArtifactId: jersey-quickstart-grizzly2
        Show
        the_alchemist added a comment - I forgot to mention which archetype: GroupId: com.sun.jersey.archetypes ArtifactId: jersey-quickstart-grizzly2
        Hide
        Pavel Bucek added a comment -

        fixed in the trunk;

        thanks!

        Show
        Pavel Bucek added a comment - fixed in the trunk; thanks!

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            the_alchemist
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: