[GLASSFISH-19116] IllegalStateException when framework extension bundle is uninstalled. Created: 29/Sep/12  Updated: 22/Nov/12  Resolved: 29/Sep/12

Status: Resolved
Project: glassfish
Component/s: OSGi
Affects Version/s: 4.0_b56_ms5
Fix Version/s: 4.0_b57

Type: Bug Priority: Major
Reporter: Sanjeeb Sahoo Assignee: Sanjeeb Sahoo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Sanjeeb Sahoo [ 29/Sep/12 ]

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);

Comment by LeoInside [ 22/Nov/12 ]

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..

Generated at Mon Aug 31 08:07:39 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.