glassfish
  1. glassfish
  2. GLASSFISH-19116

IllegalStateException when framework extension bundle is uninstalled.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_dev
    • Fix Version/s: 4.0_dev
    • Component/s: OSGi
    • Labels:
      None

      Description

      To reproduce:
      Start and stop GlassFish once so that the osgi cache is populated.
      rm one framework extension bundle like modules/webservices-extra-jdk-packages.jar
      Start GlassFish.
      You shall see:
      Launching GlassFish on Felix platform
      29 Sep, 2012 12:21:29 PM BundleProvisioner createBundleProvisioner
      INFO: clazz = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner
      29 Sep, 2012 12:21:29 PM BundleProvisioner uninstall
      INFO: Uninstalled bundle 264 installed from /space/ss141213/WS/gf/trunk/appserver/distributions/glassfish/target/stage/glassfish3/glassfish/modules/webservices-extra-jdk-packages.jar
      Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
      at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
      Caused by: org.glassfish.embeddable.GlassFishException: java.lang.IllegalStateException: Invalid BundleContext.
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:169)
      at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157)
      at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112)
      ... 6 more
      Caused by: java.lang.IllegalStateException: Invalid BundleContext.
      at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:514)
      at org.apache.felix.framework.BundleContextImpl.getBundle(BundleContextImpl.java:173)
      at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.getBundle(BundleProvisioner.java:392)
      at com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner.startBundles(BundleProvisioner.java:216)
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:158)
      ... 9 more
      Error stopping framework: java.lang.NullPointerException
      java.lang.NullPointerException
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)

      Recently a user called Alex raised it in forum as well.

        Activity

        Sanjeeb Sahoo created issue -
        Hide
        Sanjeeb Sahoo added a comment -

        Revisions:
        ----------
        56185

        Modified Paths:
        ---------------
        trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java

        Diffs:
        ------
        Index: trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java
        ===================================================================
        — trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java (revision 56184)
        +++ trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java (revision 56185)
        @@ -312,6 +312,9 @@
        continue;
        }
        try {
        + if (isFrameworkExtensionBundle(bundle))

        { + setSystemBundleUpdationRequired(true); + }

        bundle.uninstall();
        noOfUninstalledBundles++;
        removeBundle(jar);

        Show
        Sanjeeb Sahoo added a comment - Revisions: ---------- 56185 Modified Paths: --------------- trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java Diffs: ------ Index: trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java =================================================================== — trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java (revision 56184) +++ trunk/main/nucleus/core/bootstrap/src/main/java/com/sun/enterprise/glassfish/bootstrap/osgi/BundleProvisioner.java (revision 56185) @@ -312,6 +312,9 @@ continue; } try { + if (isFrameworkExtensionBundle(bundle)) { + setSystemBundleUpdationRequired(true); + } bundle.uninstall(); noOfUninstalledBundles++; removeBundle(jar);
        Sanjeeb Sahoo made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        LeoInside added a comment -

        Hi Sanjeeb,

        I am new to Glassfish and seeing exactly same issue on our server..

        Can you please let me know how this fix can be implemented?..

        Thanks in advance..

        Show
        LeoInside added a comment - Hi Sanjeeb, I am new to Glassfish and seeing exactly same issue on our server.. Can you please let me know how this fix can be implemented?.. Thanks in advance..
        Joe Di Pol made changes -
        Fix Version/s 4.0_dev [ 17784 ]
        Joe Di Pol made changes -
        Affects Version/s 4.0_dev [ 17784 ]

          People

          • Assignee:
            Sanjeeb Sahoo
            Reporter:
            Sanjeeb Sahoo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: