jersey
  1. jersey
  2. JERSEY-2173

Port number configuration for test running does not work for OSGi tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.5
    • Component/s: tools
    • Labels:
      None

      Description

      When building master I get the following build error:

      --- jetty-maven-plugin:8.1.8.v20121106:run (start-jetty) @ servlet-2.5-autodiscovery-2 ---
      Configuring Jetty for project: jersey-tests-integration-servlet-2.5-autodiscovery-2
      webAppSourceDirectory not set. Defaulting to C:\Users\Gili\Documents\jersey2\tests\integration\servlet-2.5-autodiscovery-2\src\main\webapp
      Reload Mechanic: automatic
      Classes = C:\Users\Gili\Documents\jersey2\tests\integration\servlet-2.5-autodiscovery-2\target\classes
      Context path = /
      Tmp directory = C:\Users\Gili\Documents\jersey2\tests\integration\servlet-2.5-autodiscovery-2\target\tmp
      Web defaults = org/eclipse/jetty/webapp/webdefault.xml
      Web overrides =  none
      web.xml file = file:/C:/Users/Gili/Documents/jersey2/tests/integration/servlet-2.5-autodiscovery-2/src/main/webapp/WEB-INF/web.xml
      Webapp directory = C:\Users\Gili\Documents\jersey2\tests\integration\servlet-2.5-autodiscovery-2\src\main\webapp
      2013-10-28 06:41:29.371:INFO:oejs.Server:jetty-8.1.8.v20121106
      2013-10-28 06:41:29.771:INFO:oejpw.PlusConfiguration:No Transaction manager found - if your webapp requires one, please configure one.
      Null identity service, trying login service: null
      Finding identity service: null
      2013-10-28 06:41:31.626:WARN:oejuc.AbstractLifeCycle:FAILED o.m.j.p.JettyWebAppContext{/,file:/C:/Users/Gili/Documents/jersey2/tests/integration/servlet-2.5-autodiscovery-2/src/main/webapp/},file:/C:/Users/Gili/Documents/jersey2/tests/integration/servlet-2.5-autodiscovery-2/src/main/webapp/: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file org/glassfish/jersey/server/ResourceConfig
      java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file org/glassfish/jersey/server/ResourceConfig
      

      It sounds like the wrong version of the servlet JAR is being used. Perhaps this is a bug in the Maven configuration for this project?

        Activity

        Hide
        cowwoc added a comment -

        It looks like most of the example code is correct. It extends JerseyTest and uses super.getBaseUri(). Do you know why ExtendedWadlWebappOsgiTest doesn't do the same?

        I'm going to do my best to submit a pull request for this issue, but I need your help to resolve these kinds of questions.

        Show
        cowwoc added a comment - It looks like most of the example code is correct. It extends JerseyTest and uses super.getBaseUri() . Do you know why ExtendedWadlWebappOsgiTest doesn't do the same? I'm going to do my best to submit a pull request for this issue, but I need your help to resolve these kinds of questions.
        Hide
        cowwoc added a comment -

        I managed to build all of Jersey up until the last module (jersey-tests-osgi-functional) and then got stuck.

        jersey-tests-osgi-functional uses maven-paxexam-plugin to launch unit tests in a forked JVM which means they ignore "jersey.config.test.container.port". I need someone familiar with this plugin to help me figure out how to fix this.

        Show
        cowwoc added a comment - I managed to build all of Jersey up until the last module (jersey-tests-osgi-functional) and then got stuck. jersey-tests-osgi-functional uses maven-paxexam-plugin to launch unit tests in a forked JVM which means they ignore "jersey.config.test.container.port". I need someone familiar with this plugin to help me figure out how to fix this.
        Hide
        Jakub Podlesak added a comment -

        Re-opening as there still seems to be an issue with configuring port numbers for OSGi testing.

        Show
        Jakub Podlesak added a comment - Re-opening as there still seems to be an issue with configuring port numbers for OSGi testing.
        Hide
        Jakub Podlesak added a comment -

        Adjusted report title to better describe the issue.

        Show
        Jakub Podlesak added a comment - Adjusted report title to better describe the issue.
        Hide
        cowwoc added a comment -

        Fixed. I can now build Jersey2 "master" branch, including all unit tests.

        Thank you for your help!

        Show
        cowwoc added a comment - Fixed. I can now build Jersey2 "master" branch, including all unit tests. Thank you for your help!

          People

          • Assignee:
            Michal Gajdos
            Reporter:
            cowwoc
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: