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

Struts2 OSGi plugin does not work with GlassFish

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.15
    • Component/s: Other
    • Labels:
      None
    • Environment:

      GlassFish 3.1.2.2

      Description

      The OSGi plugin does not work with GlassFish where Felix is already included. When including in the Struts web application a bundle containing an activator class the following exception occurs:

      java.lang.ClassCastException: myosgi.Activator cannot be cast to org.osgi.framework.BundleActivator

      while when including a bundle with a class which implements BundleContextAware the following exception occurs:

      Exception starting filter struts2 java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/searchpolicy/ContentClassLoader) previously initiated loading for a different type with name "org/osgi/framework/BundleContext"

      It also seems that the plugin uses an old version of Felix which could be (at least partly) responsible for the errors since GlassFish uses a newer one.

      More details on the errors also available in this stackoverflow post

        Attachments

        1. Struts2OSGi.zip
          266 kB
          Christina Kaskoura
        2. 2.3.8-error.txt
          20 kB
          Christina Kaskoura

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                chrisie Christina Kaskoura
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: