dev@glassfish.java.net

GlassFish fails to start in HK2 mode and breaks gem startup

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Tue, 26 Aug 2008 19:19:27 -0700

I was trying to deploy a rails application using glassfish gem. Please
note that the gem works in HK2 mode so looks like some recent change has
caused this regression. Try starting glassfish in HK2 mode, you will get
the same error. Since it is critical for the gem so reported a P1.

Why we can't use Osgi(Felix) mode for gem is discussed in this thread:

http://www.nabble.com/ASMain()-does-not-work--in-OSGi-mode-td18074243.html

On the startup it gives up with the following message:

vivekmz_at_boson(512)> jruby -S glassfish_rails .
Aug 26, 2008 5:57:59 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on HK2 platform
Aug 26, 2008 5:57:59 PM com.sun.enterprise.glassfish.bootstrap.ASMainHK2
findDerbyClient
INFO: Cannot find javadb client jar file, jdbc driver not available
Aug 26, 2008 5:57:59 PM
com.sun.enterprise.glassfish.bootstrap.ExtensibleClassLoader <init>
INFO: Added file:/tools/jdk5/lib/tools.jar to shared classpath
Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
javax/xml/stream/XMLStreamException
    at
com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createHabitat(AbstractModulesRegistryImpl.java:137)
    at com.sun.enterprise.module.bootstrap.Main.createHabitat(Main.java:394)
    at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:309)
    at com.sun.enterprise.module.bootstrap.Main.start(Main.java:172)
    at com.sun.enterprise.module.bootstrap.Main$1.run(Main.java:102)


I see the same failure when trying to start the latest GlassFish in HK2
mode:

vivekmz_at_boson(507)> java -DJRUBY_HOME=/root/tmp/jruby-1.1.3
-DGlassFish_Platform=HK2 -jar modules/glassfish-10.0-SNAPSHOT.jar
Aug 26, 2008 6:10:58 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on HK2 platform
Aug 26, 2008 6:10:59 PM
com.sun.enterprise.glassfish.bootstrap.ExtensibleClassLoader <init>
INFO: Added file:/tools/jdk5/lib/tools.jar to shared classpath
Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
javax/xml/stream/XMLStreamException
    at
com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createHabitat(AbstractModulesRegistryImpl.java:137)
    at com.sun.enterprise.module.bootstrap.Main.createHabitat(Main.java:394)
    at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:309)
    at com.sun.enterprise.module.bootstrap.Main.start(Main.java:172)
    at com.sun.enterprise.module.bootstrap.Main$1.run(Main.java:102)