1 Reply Latest reply on Jul 9, 2016 5:13 PM by Joe Punk

    Dependency on ear's ejb.jar in separate war

    Joe Punk Newbie

      Hi, Im am making some kind of plugin system in Wildfly. What I want to do is to have main application bundled as ear and other plugins as separate war(s).

      So the deployments folder in Wildfly looks like this:

      my-app.ear

        --ejb1.jar

        --app.war(not important here)

      plugin.war

       

      plugin.war has provided maven dependency on ejb1.jar but this exception is thrown:

      WFLYSRV0179: Failed to load module: deployment.plugin.war:main

        at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

        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)

      Caused by: org.jboss.modules.ModuleNotFoundException: my-app.ear:main

        at org.jboss.modules.Module.addPaths(Module.java:1092)

        at org.jboss.modules.Module.link(Module.java:1448)

        at org.jboss.modules.Module.relinkIfNecessary(Module.java:1476)

        at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)

        at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)

        ... 5 more

       

      I also tried adding jboss-deployment-structure.xml in plugin.war WEB-INF folder with this content but it did not help:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure>

      <deployment>

         <dependencies>

         <module name="my-app.ear" export="TRUE"/>

         <module name="my-app.ear.ejb1.jar" export="TRUE"/>

         </dependencies>

      </deployment>

      </jboss-deployment-structure>


      Is Wildfly capable of doing such thing?

        • 1. Re: Dependency on ear's ejb.jar in separate war
          Joe Punk Newbie

          Ok i got it working somehow.

          First thing - mistake in jboss-deployments-structure.xml module name should start with deployment. so correct is:

            <module name="deployment.my-app.ear" export="TRUE"/>

            <module name="deployment.my-app.ear.ejb1.jar" export="TRUE"/>


          Second - When injecting ejb I have to use @EJB(lookup=GLOBAL_JNDI_NAME) with that jndi path which sucks but I can live with that. Without path it throws WFLYEJB0406 and @Inject annotation throws WELD-001408.

          If someone knows about some kind of idea how to realize idea about plugin system in Wildfly(or generally JEE) please post it here thanks.