users@glassfish.java.net

Problem deploying a rails app with glassfish

From: Jacobo García <jacobo.garcia_at_gmail.com>
Date: Fri, 7 Nov 2008 21:08:40 +0100

Hello,

This is the first time I run glassfish to run a rails app and I'm stuck with
this.

I've been following this tutorial
http://blog.erichsen.net/tag/jruby-glassfish-rails-benchmarks/ just to run a
simple rails app in glassfish

Everything goes fine until I run:

glassfish_rails glassfishtest -n 2


Then I get the following error:

Nov 7, 2008 8:57:20 PM com.sun.enterprise.glassfish.bootstrap.ASMain main
INFO: Launching GlassFish on Apache Felix OSGi platform
Nov 7, 2008 8:57:20 PM com.sun.enterprise.glassfish.bootstrap.ASMainOSGi
findDerbyClient
INFO: Cannot find javadb client jar file, jdbc driver not available

Welcome to Felix.
=================

ERROR: Error starting
file:/home/therobot/glassfish/jruby-1.1.5/lib/ruby/gems/1.8/gems/glassfish-0.9.0-universal-java//modules/osgi-adapter.jar
(org.osgi.framework.BundleException: Activator start error.)
com.sun.enterprise.module.ResolveError: Failed to start
org.glassfish.core.kernel(Kernel Classes):3.0.0.Prelude-b28b
    at
org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:143)
    at
org.jvnet.hk2.osgiadapter.OSGiModuleImpl$1$1$1.loadClass(OSGiModuleImpl.java:280)
    at com.sun.hk2.component.LazyInhabitant.fetch(LazyInhabitant.java:91)
    at com.sun.hk2.component.LazyInhabitant.type(LazyInhabitant.java:78)
    at org.jvnet.hk2.component.Habitat.addIndex(Habitat.java:149)
    at
com.sun.hk2.component.InhabitantsParser.add(InhabitantsParser.java:154)
    at
com.sun.hk2.component.InhabitantsParser.parse(InhabitantsParser.java:133)
    at
org.jvnet.hk2.osgiadapter.OSGiModuleImpl.parseInhabitants(OSGiModuleImpl.java:312)
    at
org.jvnet.hk2.osgiadapter.OSGiModulesRegistryImpl.parseInhabitants(OSGiModulesRegistryImpl.java:128)
    at
com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createHabitat(AbstractModulesRegistryImpl.java:135)
    at com.sun.enterprise.module.bootstrap.Main.createHabitat(Main.java:394)
    at org.jvnet.hk2.osgiadapter.HK2Main.start(HK2Main.java:131)
    at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:591)
    at org.apache.felix.framework.Felix._startBundle(Felix.java:1607)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)
    at
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1135)
    at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)
    at java.lang.Thread.run(Thread.java:636)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in
bundle 13: package; (&(package=org.glassfish.api.branding)(version>=10.0.0))
    at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1725)
    at org.apache.felix.framework.Felix._startBundle(Felix.java:1588)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:371)
    at
org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:137)
    ... 17 more
ERROR: Error starting
file:/home/therobot/glassfish/jruby-1.1.5/lib/ruby/gems/1.8/gems/glassfish-0.9.0-universal-java/modules/kernel.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle 13:
package; (&(package=org.glassfish.api.branding)(version>=10.0.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle 13:
package; (&(package=org.glassfish.api.branding)(version>=10.0.0))
    at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1725)
    at org.apache.felix.framework.Felix._startBundle(Felix.java:1588)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)
    at
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1135)
    at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)
    at java.lang.Thread.run(Thread.java:636)


If I try to run the app with mongrel_cluster the app runs fine

This is the setup I have:

OS: Ubuntu linux 8.04
JVM: openjdk-6-jre
Glassfish: I am using glassfish rubygem 0.9.0
Jruby: jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-07 rev 6586)
[amd64-java]
Rails : 2.1.2
Mysql: 5.0.51
I am using the jdbcmysql gem to connect to database.

I must note that trying to run another rails app that also works perfectly
with mongrel, even with jruby/webrick gives the same error.

Thanks for your time.

Jacobo García López de Araujo
blog: http://robotplaysguitar.wordpress.com