Aliaksei
Aliaksei

Reputation: 1457

WildFly dependencies

Plese help me set dependencies in Wildfly. I have Maven project Parent:

Service is EJB. Web is WAR using utils.jar from Service.ear

Service.ejb Utils.jar in lib

   <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>${maven-ear-plugin.version}</version>
                <configuration>
                    <earName>${project.build.finalName}</earName>
                    <modules>
...
                        <javaModule>
                            <groupId>by.services</groupId>
                            <artifactId>by.utils</artifactId>
                            <bundleDir>lib</bundleDir>
                        </javaModule>
...

Jboss-deployment-strucuture.xml in Web.war

<jboss-deployment-structure>
    <!--<ear-subdeployments-isolated>false</ear-subdeployments-isolated>-->
    <deployment name="mobile-console.war">
        <dependencies>
            <module name="by.lib" meta-inf="export" export="true"/>
            <module name="deployment.services-1.0.5.ear.model-core-1.1.jar"/>
            <module name="deployment.services-1.0.5.ear.by.utils-1.0.2.jar"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

So I have error

11:58:25,987 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "web.war")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "module.resolved.service.\"deployment.web.war\".main",
        "jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.module.service.\"deployment.web.war\".main is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main, module.resolved.service.\"deployment.web.war\".main]",
        "jboss.module.resolve.phase.\"deployment.web.war\".main.1 is missing [jboss.module.spec.service.\"deployment.mobile.bank.services-1.0.5.ear.by.utils-1.0.2.jar\".main]"
    ]
}
11:58:25,988 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "web.war" was rolled back with the following failure message: 
{
    "WFLYCTL0412: Required services that are not installed:" => [
        "module.resolved.service.\"deployment.web.war\".main",
        "jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.module.service.\"deployment.web.war\".main is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main, module.resolved.service.\"deployment.web.war\".main]",
        "jboss.module.resolve.phase.\"deployment.web.war\".main.1 is missing [jboss.module.spec.service.\"deployment.services-1.0.5.ear.by.utils-1.0.2.jar\".main]"
    ]
}
11:58:26,001 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment web.war (runtime-name: web.war) in 12ms
11:58:26,002 INFO  [org.jboss.as.controller] (management-handler-thread - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.module.service."deployment.web.war".main (missing) dependents: [service jboss.deployment.unit."web.war".FIRST_MODULE_USE] 
      service jboss.module.spec.service."deployment.web.war".main (missing) dependents: [service jboss.module.service."deployment.web.war".main] 
      service jboss.module.spec.service."deployment.services-1.0.5.ear.by.utils-1.0.2.jar".main (missing) dependents: [service jboss.module.service."deployment.web.war".main, service jboss.module.resolve.phase."deployment.web.war".main.1] 
      service module.resolved.service."deployment.web.war".main (missing) dependents: [service jboss.module.service."deployment.web.war".main] 

What do I do wrong?

Upvotes: 0

Views: 2021

Answers (1)

Steve C
Steve C

Reputation: 19445

You don't need to build an EAR file.

You probably already have the

<dependency>
   <groupId>by.services</groupId>
   <artifactId>by.utils</artifactId>
   <version>...</version>
</dependency>

and the EJB dependency in the pom.xml for your web application.

Just build and deploy the resulting WAR file, even if you're using EJBs. Both the dependent jars should finish up in the WAR file's WEB-INF/lib directory.

You don't need any special deployment descriptors and you don't need to know the class visibility rules for modules in EAR files.

Upvotes: 1

Related Questions