OpenWebBeans
  1. OpenWebBeans
  2. OWB-582

Support for Java 1.5 (needed for WebSphere 6.1)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.1
    • Component/s: Core
    • Labels:
      None

      Description

      I would be nice, if OWB supports Java 1.5, e. g. to run with WebSphere 6.1.
      It can be implemented with low effort.

      There is one basic dependency to Java 1.6: java.util.ServiceLoader
      To solve this problem, I've added a utility class in my local copy and delegate calls to ServiceLoader to this utility.

      The utility class itself calls ServiceLoader, if the class is available (Java 1.6) or uses com.googlecode.bspi.ServiceLoader (Java 1.5).
      So the application needs one new dependency (only in the case of Java 1.5).

      I've also changed the maven-compiler-plugin to generate Java 1.5 compatible byte code.

      1. OWB-582.patch
        10 kB
        Udo Schnurpfeil
      2. OWB-582_pluggable_service_loader_and_java5_support.patch
        22 kB
        Gerhard Petracek
      3. OWB-582_maven_config.patch
        0.5 kB
        Gerhard Petracek

        Issue Links

          Activity

          Hide
          Mark Struberg added a comment -

          closing, as issues are fixed in OpenWebBeans-1.1.1

          Show
          Mark Struberg added a comment - closing, as issues are fixed in OpenWebBeans-1.1.1
          Hide
          Gerhard Petracek added a comment -

          sounds like it should get fixed in geronimo

          Show
          Gerhard Petracek added a comment - sounds like it should get fixed in geronimo
          Hide
          Mark Struberg added a comment -

          Geronimo cannot use the default config mechanism because the properties files from the core don't get exported via OSGi. Thus Geronimo injects the configuration from 'outside'.

          Show
          Mark Struberg added a comment - Geronimo cannot use the default config mechanism because the properties files from the core don't get exported via OSGi. Thus Geronimo injects the configuration from 'outside'.
          Hide
          Gerhard Petracek added a comment -

          thx david for checking it with geronimo.
          i'm basically ok with the workaround. however, i'm wondering a bit about the fix because DefaultImplementationLoaderService is configured in the default owb config. that would mean that the config approach of owb doesn't work in geronimo.

          Show
          Gerhard Petracek added a comment - thx david for checking it with geronimo. i'm basically ok with the workaround. however, i'm wondering a bit about the fix because DefaultImplementationLoaderService is configured in the default owb config. that would mean that the config approach of owb doesn't work in geronimo.
          Hide
          David Jencks added a comment -

          This breaks the geronimo integration and requires users to configure the ImplementationLoaderService. In rev 1153739 I changed this to use the default service if none is configured. In rev 1153741 I changed this to only try to create one if there is none in the initial services.

          Show
          David Jencks added a comment - This breaks the geronimo integration and requires users to configure the ImplementationLoaderService. In rev 1153739 I changed this to use the default service if none is configured. In rev 1153741 I changed this to only try to create one if there is none in the initial services.
          Hide
          Udo Schnurpfeil added a comment -

          looks good

          Show
          Udo Schnurpfeil added a comment - looks good
          Hide
          Gerhard Petracek added a comment -

          hi udo,

          thx - i used some parts of you patch to create this one. furthermore, this patch implements a simple serviceloader as fallback for java 1.5 (it's based on the implementation available in myfaces codi). since it's pluggable, you could also provide an adapter to use any custom implementation. e.g. to use the implementation provided by myfaces codi:

          public class ServiceLoaderAdapter implements ImplementationLoaderService
          {
          public <T> List<T> load(Class<T> serviceType)

          { return ServiceProvider.loadServices(serviceType); }

          }

          to use this service-loader as replacement for the owb service-loader, you have to configure it in the openwebbeans.properties via:
          configuration.ordinal=11
          org.apache.webbeans.spi.ImplementationLoaderService=custom.ServiceLoaderAdapter

          this patch doesn't support CdiTestContainerLoader because there is no dependency to owb-impl.

          Show
          Gerhard Petracek added a comment - hi udo, thx - i used some parts of you patch to create this one. furthermore, this patch implements a simple serviceloader as fallback for java 1.5 (it's based on the implementation available in myfaces codi). since it's pluggable, you could also provide an adapter to use any custom implementation. e.g. to use the implementation provided by myfaces codi: public class ServiceLoaderAdapter implements ImplementationLoaderService { public <T> List<T> load(Class<T> serviceType) { return ServiceProvider.loadServices(serviceType); } } to use this service-loader as replacement for the owb service-loader, you have to configure it in the openwebbeans.properties via: configuration.ordinal=11 org.apache.webbeans.spi.ImplementationLoaderService=custom.ServiceLoaderAdapter this patch doesn't support CdiTestContainerLoader because there is no dependency to owb-impl.

            People

            • Assignee:
              Gerhard Petracek
              Reporter:
              Udo Schnurpfeil
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development