Deploying Multiple Immutant WAR files to Wildfly

1.9k Views Asked by At

I don't think this is version specific but I'll specify I'm on Immutant 2.1.0 and Wildfly 9.0.1.Final.

I start with a stock, freshly unzipped wildfly download and run it with $ wildfly-9.0.1.Final/bin/standalone.sh. I run $ lein immutant war in my clojure project with the following in my project.clj:

:immutant {:war {:destination "/srv/wildfly-9.0.1.Final/standalone/deployments/"
                 :context-path "/app1}}

This works fine and I have my app at http://localhost:8080/app1. The problem is when I do this with a second app with :context-path "/app2", wildfly complains:

>Caused by: org.jboss.msc.service.DuplicateServiceException: 
 Service jboss.pojo.\"org.jboss.netty.internal.LoggerConfigurator\".DESCRIBED 
 is already registered"

If I do this process with app2 before app1, app2 gets correctly deployed but app1 gets a complaint. Both can be deployed individually but not at the same time.

I don't know if I'm missing a step at WAR time or missing wildfly configuration or what.

2

There are 2 best solutions below

3
Toby Crawley On

This is caused by the netty jar having a jboss-beans.xml file, which is detected by the "pojo" subsystem in WildFly, and used to set up a LoggerConfigurator bean. Each app must have a dependency on netty (probably transitively), which causes WildFly to attempt to deploy the same bean twice. One workaround is to disable the pojo subsystem in WildFly by editing the appropriate standalone/configuration/standalone*.xml file and commenting out the pojo subsystem (you may need to comment out both <extension module="org.jboss.as.pojo"/> and <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>).

0
Dariusz Dudziński On

I had a similar problem, when I was trying to deploy two applications on jboss with hornetq-jms-server. The root cause was an extra jboss-beans.xml in the netty jar. I am not sure in which version exactly was it removed, but switching to hornet 2.4.7.Final, that uses netty-all 4.0.13.Final did the job. Here is information about the defect https://github.com/netty/netty/issues/1996