CXF
  1. CXF
  2. CXF-4171

Static resource resolution not possible with CXFNonSpringJaxrsServlet

    Details

    • Estimated Complexity:
      Novice

      Description

      The title says it all. I wanted this to get a full WADL document, and found it's not supported.

      I was able to do it only by changing the source code - adding bean.setStaticSubresourceResolution(true); to ResourceUtils:621 (before bean.setResourceClasses(resourceClasses) ) does the trick.

      Since this requires source code modification or copy-pasting and overriding methods in both CXFNonSpringJaxrsServlet and ResourceUtils I think that there should be a config option similiar to jaxrs.application.address.ignore available for this.

        Activity

        Hide
        Jakub Bocheński added a comment -

        Yes, this seems to be the right thing. I will wait until the snapshot build from this is available for download and test again.

        BTW: I can't find any info on when 2.5.3 will be released as a stable version, is there any planned date?

        Show
        Jakub Bocheński added a comment - Yes, this seems to be the right thing. I will wait until the snapshot build from this is available for download and test again. BTW: I can't find any info on when 2.5.3 will be released as a stable version, is there any planned date?
        Show
        Sergey Beryozkin added a comment - probably... This is now done immediately after setAddress: http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
        Hide
        Jakub Bocheński added a comment -

        Ok - so apparently this is not yet available, on the snapshot page there are files from 2012-03-21 06:45:10, whereas it seems your fix was commited around 22:19:21

        Show
        Jakub Bocheński added a comment - Ok - so apparently this is not yet available, on the snapshot page there are files from 2012-03-21 06:45:10, whereas it seems your fix was commited around 22:19:21
        Hide
        Jakub Bocheński added a comment -

        I'm sorry but I actually forgot to switch off my custom implementation when trying this.
        It still doesn't seem to work
        When looking at the code I don't see any relevant changes - the static resolution is still set after bean.setResourceClasses() call.

        I will double check if I hadn't mixed up the snapshots and let you know.

        Show
        Jakub Bocheński added a comment - I'm sorry but I actually forgot to switch off my custom implementation when trying this. It still doesn't seem to work When looking at the code I don't see any relevant changes - the static resolution is still set after bean.setResourceClasses() call. I will double check if I hadn't mixed up the snapshots and let you know.
        Hide
        Sergey Beryozkin added a comment -

        thanks for the confirmation; at some point we will refactor the server bean to eliminate the ordering issue

        Show
        Sergey Beryozkin added a comment - thanks for the confirmation; at some point we will refactor the server bean to eliminate the ordering issue
        Hide
        Jakub Bocheński added a comment -

        This one seems to be working OK - thanks

        Show
        Jakub Bocheński added a comment - This one seems to be working OK - thanks
        Hide
        Sergey Beryozkin added a comment -

        No problems, thanks for trying it early; I've committed another update - can you please confirm it works as expected ?

        Show
        Sergey Beryozkin added a comment - No problems, thanks for trying it early; I've committed another update - can you please confirm it works as expected ?
        Hide
        Jakub Bocheński added a comment -

        I'm sorry but the fix is useless - the static resolution has to be set before bean.setResourceClasses() call.
        It matters what setting is there when classes are registered!

        In this way they still get dynamic resolution regardless of the setting.

        Show
        Jakub Bocheński added a comment - I'm sorry but the fix is useless - the static resolution has to be set before bean.setResourceClasses() call. It matters what setting is there when classes are registered! In this way they still get dynamic resolution regardless of the setting.

          People

          • Assignee:
            Sergey Beryozkin
            Reporter:
            Jakub Bocheński
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development