Skip to content

Unable to re-deploy rails app (java.lang.RuntimeException: BUG: could not initialize constructor handle) #4442

@aldrinmartoq

Description

@aldrinmartoq

Environment

  • jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.111-b14 on 1.8.0_111-b14 +jit [linux-x86_64]
  • Linux 2.6.18-398.el5 break script engine #1 SMP Tue Aug 12 06:26:17 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
  • rails 4.2.7.1
  • JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1)

Expected Behavior

We need to reinstall a rails application without restarting the JBoss application server.

Actual Behavior

We are trying to redeploy our rails app into a JBoss Server (rm -f jboss-eap-7.0/standalone/deployments/prueba.war; cp -f prueba.war jboss-eap-7.0/standalone/deployments/ ), but it fails with an exception. If we restart JBoss, the application runs fine.

We can reproduce the error with the following:

$ rvm use jruby-9.1.7.0
$ gem install rails -v 4.2.7.1
$ gem install warbler
$ rails new prueba
$ cd prueba
$ warble war
$ cp -f prueba.war jboss-eap-7.0/standalone/deployments/
# wait the app is running
$ rm -f jboss-eap-7.0/standalone/deployments/prueba.war
$ cp -f prueba.war jboss-eap-7.0/standalone/deployments/
# exception occurs

Here is the error log:

13:44:09,592 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "prueba.war" (runtime-name: "prueba.war")
13:44:11,988 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 66) INFO: jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.111-b14 on 1.8.0_111-b14 +jit [linux-x86_64]
13:44:11,991 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 66) INFO: using a shared (threadsafe!) runtime

13:44:12,182 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 66) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./prueba: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./prueba: java.lang.ExceptionInInitializerError
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.ExceptionInInitializerError
	at org.jruby.runtime.ThreadContext.<init>(ThreadContext.java:214)
	at org.jruby.runtime.ThreadContext.newContext(ThreadContext.java:85)
	at org.jruby.internal.runtime.ThreadService.initMainThread(ThreadService.java:166)
	at org.jruby.Ruby.init(Ruby.java:1161)
	at org.jruby.Ruby.newInstance(Ruby.java:334)
	at org.jruby.rack.DefaultRackApplicationFactory.newRuntime(DefaultRackApplicationFactory.java:337)
	at org.jruby.rack.DefaultRackApplicationFactory$RackApplicationImpl.<init>(DefaultRackApplicationFactory.java:438)
	at org.jruby.rack.DefaultRackApplicationFactory.createApplication(DefaultRackApplicationFactory.java:426)
	at org.jruby.rack.DefaultRackApplicationFactory.newApplication(DefaultRackApplicationFactory.java:99)
	at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:113)
	at org.jruby.rack.SharedRackApplicationFactory.doInit(SharedRackApplicationFactory.java:34)
	at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:100)
	at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
	at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
	at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198)
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
	... 6 more
Caused by: java.lang.RuntimeException: BUG: could not initialize constructor handle
	at org.jruby.runtime.scope.ManyVarsDynamicScope.<clinit>(ManyVarsDynamicScope.java:39)
	... 23 more

13:44:12,184 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "prueba.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./prueba" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./prueba: java.lang.ExceptionInInitializerError
    Caused by: java.lang.ExceptionInInitializerError
    Caused by: java.lang.RuntimeException: BUG: could not initialize constructor handle"}}
13:44:12,202 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed "prueba.war" (runtime-name : "prueba.war")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions