Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5205

REST plugin cannot start due to injection error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.0.0
    • 6.0.3
    • Plugin - REST
    • None

    Description

      While attempting to instantiate REST plugin's ContentTypeHandlerManager, the initialization fails with the following error:

      org.springframework.beans.factory.UnsatisfiedDependencyExceptionError creating bean with name 'org.apache.struts2.rest.ContentTypeInterceptor': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.struts2.rest.ContentTypeHandlerManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} 

      Tested using Spring as the Object Factory.

      The issue seems to be present only in struts >= 6.0.0, likely caused by this commit https://github.com/apache/struts/commit/e9d0a5518cd0671d9ad0353a2c87246ef0d2061b

      In Struts 2.5.x the bean is injected correctly, as an internal bean.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rproserpio Riccardo Proserpio
              Votes:
              5 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m