4

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.

deadghost
  • 5,017
  • 3
  • 34
  • 46

2 Answers2

2

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"/>).

Toby Crawley
  • 617
  • 3
  • 8
  • I assume immutant can use the `jboss-deployment-structure.xml` as well right? If so it can be used to exclude the `pojo` subsystem as well. Though removing it if it's not being used is fine too. – James R. Perkins Sep 28 '15 at 17:30
  • Yes, we include a `jboss-deployment-structure.xml` in the war to set up the module dependencies for the app, and allow the user to provide a customized one, so that would be another option. I had forgotten that subsystems could be disabled from there. – Toby Crawley Sep 28 '15 at 18:01
  • Otherwise remove dependency to netty.jar and reinclude it via jboss-deployment-structure.xml and reference to module org.jboss.netty. – Christian13467 May 09 '16 at 23:21
0

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