0

Trying to get my jee ear deployed to wildfly 15 or 16.

I get this error:

"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"test.ear\".\"web.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of subdeployment \"web.war\" of deployment \"test.ear\" Caused by: java.lang.IllegalArgumentException: Cannot both require and provide same dependency:service jboss.naming.context.java.module.test.web.env.mainDB"}, mainDB is a postgresql datasource configured in standalone.xml.

Any pointers in how I might track the source of the problem would be helpful.

Thanks!

The same exact ear deploys without any problems on wildfly versions prior 14.0.1. Tested on 14.0.1, 10.0.1, 9 and 8.

user3757849
  • 199
  • 2
  • 14

1 Answers1

1

The jboss-web.xml in web.war/WEB-INF had this:

<jboss-web>
  <resource-ref>
    <res-ref-name>mainDB</res-ref-name>
    <jndi-name>mainDB</jndi-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
</jboss-web>

Once I removed this, the ear deployed without any problems on both wildfly 15 and 16.
Apparently, this was used to alias a datasource while migrating code a while back.

What is resource-ref in web.xml used for?

Since then, the code has been updated and the alias was no longer used, which resulted in the alias being the same as the jndi-name, this is no longer necessary and caused the deployment to fail.

user3757849
  • 199
  • 2
  • 14